diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000000..303892559d
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,16 @@
+name: Publish all php docker images
+on: [push]
+jobs:
+ login:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v1
+ - uses: azure/docker-login@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+ - name: Publish All
+ run: ./publish-all.sh
+ shell: bash
+ working-directory: ./polyscripting/tools/
diff --git a/7.2/alpine3.11/fpm/Dockerfile b/7.2/alpine3.11/fpm/Dockerfile
index 7174e301dd..465f2eb073 100644
--- a/7.2/alpine3.11/fpm/Dockerfile
+++ b/7.2/alpine3.11/fpm/Dockerfile
@@ -1,5 +1,4 @@
-FROM polyverse/php-polyscripting-builder:latest as builder
-
+FROM polyverse/php-polyscripting-builder:latest as polyscripter
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
@@ -10,7 +9,7 @@ FROM alpine:3.11
# dependencies required for running "phpize"
# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed)
-ENV PHPIZE_DEPS \
+ENV PHPIZE_DEPS bison bash \
autoconf \
dpkg-dev dpkg \
file \
@@ -23,15 +22,10 @@ ENV PHPIZE_DEPS \
# persistent / runtime deps
RUN apk add --no-cache \
- $PHPIZE_DEPS \
ca-certificates \
curl \
tar \
- vim \
- bison \
xz \
- libxml2-dev \
- bash \
# https://github.com/docker-library/php/issues/494
openssl
@@ -61,18 +55,17 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
-# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated)
# https://github.com/docker-library/php/issues/272
# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php)
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
-ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
+ENV PHP_LDFLAGS="-Wl,-O1 -pie"
ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F
-ENV PHP_VERSION 7.2.27
-ENV PHP_URL="https://www.php.net/get/php-7.2.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.27.tar.xz.asc/from/this/mirror"
-ENV PHP_SHA256="7bd0fb9e3b63cfe53176d1f3565cd686f90b3926217158de5ba57091f49e4c32" PHP_MD5=""
+ENV PHP_VERSION 7.2.30
+ENV PHP_URL="https://www.php.net/distributions/php-7.2.30.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-7.2.30.tar.xz.asc"
+ENV PHP_SHA256="aa93df27b58a45d6c9800ac813245dfdca03490a918ebe515b3a70189b1bf8c3" PHP_MD5=""
RUN set -eux; \
\
@@ -109,7 +102,7 @@ COPY docker-php-source /usr/local/bin/
ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting"
ENV PHP_SRC_PATH "/usr/src/php"
WORKDIR $POLYSCRIPT_PATH
-COPY --from=builder /polyscripting/ ./
+COPY --from=polyscripter /polyscripting/ ./
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
@@ -136,7 +129,7 @@ RUN set -eux; \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
\
-# make sure invalid --configure-flags are fatal errors intead of just warnings
+# make sure invalid --configure-flags are fatal errors instead of just warnings
--enable-option-checking=fatal \
\
# https://github.com/docker-library/php/issues/439
@@ -242,4 +235,4 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
\ No newline at end of file
+####
diff --git a/7.2/alpine3.11/fpm/publish-image.sh b/7.2/alpine3.11/fpm/publish-image.sh
index 24020b1164..9e0fc7cfa6 100755
--- a/7.2/alpine3.11/fpm/publish-image.sh
+++ b/7.2/alpine3.11/fpm/publish-image.sh
@@ -1,6 +1,18 @@
#!/bin/bash
-image="polyverse/ps-php7.2-fpm"
+echo "HERE WE GO"
+echo "fdafdsfasdfsadfsdafdsafdsafafdsafdsafdsafdsafsadfdsafsdafdsaf \
+ fdafdsafsdfsadfsafsdafsadfasdf \
+ dfasdfsdafasdfdsafsdafadsfasdf \n fdsafdsfasdfdsa fdsafsafsadfads \nhhhhhh"
+
+# Copyright (c) 2020 Polyverse Corporation
+
+type="$(basename $PWD)"
+build="$(basename $(dirname $PWD))"
+php_ver="$(basename $(dirname $(dirname $PWD)))"
+image="polyverse/ps-php${php_ver}-${build}-${type}"
+
+echo "Image $image being built"
echo "$(date) Obtaining current git sha for tagging the docker image"
headsha=$(git rev-parse --verify HEAD)
@@ -12,4 +24,5 @@ if [[ "$1" == "-p" ]]; then
echo "Pushing as latest tag..."
docker tag $image:$headsha $image:latest
docker push $image:latest
+ docker push $image:$headsha
fi
diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile
index 031a4c63c2..56e9161eea 100644
--- a/7.2/stretch/apache/Dockerfile
+++ b/7.2/stretch/apache/Dockerfile
@@ -1,4 +1,9 @@
-FROM polyverse/php-polyscripting-builder:latest as builder
+FROM polyverse/php-polyscripting-builder:latest as polyscripter
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
FROM debian:stretch-slim
@@ -13,14 +18,13 @@ RUN set -eux; \
# dependencies required for running "phpize"
# (see persistent deps below)
-ENV PHPIZE_DEPS \
+ENV PHPIZE_DEPS bison bash \
autoconf \
dpkg-dev \
file \
g++ \
gcc \
libc-dev \
- vim \
make \
pkg-config \
re2c
@@ -32,8 +36,6 @@ RUN set -eux; \
$PHPIZE_DEPS \
ca-certificates \
curl \
- bison \
- libxml2-dev \
xz-utils \
; \
rm -rf /var/lib/apt/lists/*
@@ -107,7 +109,7 @@ RUN { \
&& a2enconf docker-php
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
-ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi PHP_EXTRA_VERSION="-polyscripted"
+ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
####
# Apply stack smash protection to functions using local buffers and alloca()
@@ -123,7 +125,7 @@ ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F
-ENV PHP_VERSION 7.2.28-polyscripted
+ENV PHP_VERSION 7.2.28
ENV PHP_URL="https://www.php.net/get/php-7.2.28.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.28.tar.xz.asc/from/this/mirror"
ENV PHP_SHA256="afe1863301da572dee2e0bad8014813bcced162f980ddc8ec8e41fd72263eb2d" PHP_MD5=""
@@ -167,9 +169,7 @@ COPY docker-php-source /usr/local/bin/
ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting"
ENV PHP_SRC_PATH "/usr/src/php"
WORKDIR $POLYSCRIPT_PATH
-COPY --from=builder /polyscripting/ ./
-
-
+COPY --from=polyscripter /polyscripting/ ./
RUN set -eux; \
\
@@ -242,7 +242,6 @@ RUN set -eux; \
--with-libedit \
--with-openssl \
--with-zlib \
- PHP_EXTRA_VERSION="-polyscripted" \
\
# bundled pcre does not support JIT on s390x
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
@@ -251,7 +250,7 @@ RUN set -eux; \
\
${PHP_EXTRA_CONFIGURE_ARGS:-} \
; \
- ${POLYSCRIPT_PATH}/polyscript-enable; \
+ ${POLYSCRIPT_PATH}/polyscript-enable; \
find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \
\
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
@@ -270,7 +269,8 @@ RUN set -eux; \
| sort -u \
| xargs -r apt-mark manual \
; \
-# https://github.com/docker-library/php/issues/443
+ \
+# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
# smoke test
@@ -287,7 +287,6 @@ ENTRYPOINT ["docker-php-entrypoint"]
STOPSIGNAL SIGWINCH
COPY apache2-foreground /usr/local/bin/
-
WORKDIR /var/www/html
EXPOSE 80
diff --git a/7.2/stretch/apache/publish-image.sh b/7.2/stretch/apache/publish-image.sh
index 9bf9b9ed96..6e2c53fc5b 100755
--- a/7.2/stretch/apache/publish-image.sh
+++ b/7.2/stretch/apache/publish-image.sh
@@ -1,6 +1,12 @@
-#!/bin/bash
+#!/bin/sh
+# Copyright (c) 2020 Polyverse Corporation
-image="polyverse/ps-php7.2-apache"
+type="$(basename $PWD)"
+build="$(basename $(dirname $PWD))"
+php_ver="$(basename $(dirname $(dirname $PWD)))"
+image="polyverse/ps-php${php_ver}-${build}-${type}"
+
+echo "Image $image being built"
echo "$(date) Obtaining current git sha for tagging the docker image"
headsha=$(git rev-parse --verify HEAD)
@@ -9,9 +15,8 @@ echo "Building image $image:$headsha"
docker build -t $image:$headsha .
if [[ "$1" == "-p" ]]; then
- echo "Pushing as latest tag..."
- docker tag $image:$headsha $image:latest
- docker push $image:latest
+ echo "Pushing as latest tag..."
+ docker tag $image:$headsha $image:latest
+ docker push $image:latest
+ docker push $image:$headsha
fi
-
-
diff --git a/7.4/alpine3.11/fpm/Dockerfile b/7.4/alpine3.11/fpm/Dockerfile
index 56074d029c..5e7f3b12ed 100644
--- a/7.4/alpine3.11/fpm/Dockerfile
+++ b/7.4/alpine3.11/fpm/Dockerfile
@@ -1,3 +1,4 @@
+FROM polyverse/php-polyscripting-builder:3c6b6ea8c7e2cbb7a04cdff71a65186a28d1c66f as polyscripter
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
@@ -8,7 +9,7 @@ FROM alpine:3.11
# dependencies required for running "phpize"
# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed)
-ENV PHPIZE_DEPS \
+ENV PHPIZE_DEPS bison bash \
autoconf \
dpkg-dev dpkg \
file \
@@ -98,6 +99,12 @@ RUN set -eux; \
COPY docker-php-source /usr/local/bin/
+#add polyscripting
+ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting"
+ENV PHP_SRC_PATH "/usr/src/php"
+WORKDIR $POLYSCRIPT_PATH
+COPY --from=polyscripter /polyscripting/ ./
+
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
@@ -159,17 +166,13 @@ RUN set -eux; \
\
${PHP_EXTRA_CONFIGURE_ARGS:-} \
; \
- make -j "$(nproc)"; \
- find -type f -name '*.a' -delete; \
- make install; \
+ ${POLYSCRIPT_PATH}/polyscript-enable; \
find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \
- make clean; \
\
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
cp -v php.ini-* "$PHP_INI_DIR/"; \
\
cd /; \
- docker-php-source delete; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
@@ -240,4 +243,4 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
\ No newline at end of file
+####
diff --git a/7.4/alpine3.11/fpm/publish-image.sh b/7.4/alpine3.11/fpm/publish-image.sh
new file mode 100755
index 0000000000..68fd606fa4
--- /dev/null
+++ b/7.4/alpine3.11/fpm/publish-image.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
+
+type="$(basename $PWD)"
+build="$(basename $(dirname $PWD))"
+php_ver="$(basename $(dirname $(dirname $PWD)))"
+image="polyverse/ps-php${php_ver}-${build}-${type}"
+
+echo "Image $image being built"
+
+echo "$(date) Obtaining current git sha for tagging the docker image"
+headsha=$(git rev-parse --verify HEAD)
+
+echo "Building image $image:$headsha"
+docker build -t $image:$headsha .
+
+if [[ "$1" == "-p" ]]; then
+ echo "Pushing as latest tag..."
+ docker tag $image:$headsha $image:latest
+ docker push $image:latest
+fi
diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile
index 7f84616f1b..2e53faacd7 100644
--- a/7.4/buster/apache/Dockerfile
+++ b/7.4/buster/apache/Dockerfile
@@ -1,4 +1,4 @@
-FROM polyverse/php-polyscripting-builder:latest as builder
+FROM polyverse/php-polyscripting-builder:latest as polyscripter
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
@@ -18,11 +18,10 @@ RUN set -eux; \
# dependencies required for running "phpize"
# (see persistent deps below)
-ENV PHPIZE_DEPS \
+ENV PHPIZE_DEPS bison bash \
autoconf \
dpkg-dev \
file \
- vim \
g++ \
gcc \
libc-dev \
@@ -38,8 +37,6 @@ RUN set -eux; \
ca-certificates \
curl \
xz-utils \
- bison \
- libxml2-dev \
; \
rm -rf /var/lib/apt/lists/*
@@ -112,7 +109,7 @@ RUN { \
&& a2enconf docker-php
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
-ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi PHP_EXTRA_VERSION="-polyscripted"
+ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
####
# Apply stack smash protection to functions using local buffers and alloca()
@@ -128,9 +125,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
ENV GPG_KEYS 42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
-ENV PHP_VERSION 7.4.2-polyscripted
-ENV PHP_URL="https://www.php.net/get/php-7.4.2.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.4.2.tar.xz.asc/from/this/mirror"
-ENV PHP_SHA256="98284deac017da0d426117ecae7599a1f1bf62ae3911e8bc16c4403a8f4bdf13" PHP_MD5=""
+ENV PHP_VERSION 7.4.3
+ENV PHP_URL="https://www.php.net/get/php-7.4.3.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.4.3.tar.xz.asc/from/this/mirror"
+ENV PHP_SHA256="cf1f856d877c268124ded1ede40c9fb6142b125fdaafdc54f855120b8bc6982a" PHP_MD5=""
RUN set -eux; \
\
@@ -172,9 +169,7 @@ COPY docker-php-source /usr/local/bin/
ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting"
ENV PHP_SRC_PATH "/usr/src/php"
WORKDIR $POLYSCRIPT_PATH
-COPY --from=builder /polyscripting/ ./
-
-
+COPY --from=polyscripter /polyscripting/ ./
RUN set -eux; \
\
@@ -240,7 +235,6 @@ RUN set -eux; \
# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
--with-pear \
\
- PHP_EXTRA_VERSION="-polyscripted" \
# bundled pcre does not support JIT on s390x
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
@@ -248,7 +242,7 @@ RUN set -eux; \
\
${PHP_EXTRA_CONFIGURE_ARGS:-} \
; \
- $POLYSCRIPT_PATH/polyscript-enable; \
+ ${POLYSCRIPT_PATH}/polyscript-enable; \
find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \
\
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
@@ -267,25 +261,13 @@ RUN set -eux; \
| sort -u \
| xargs -r apt-mark manual \
; \
+ \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
# smoke test
php --version
-COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
-
-# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
-RUN docker-php-ext-enable sodium
-
-ENTRYPOINT ["docker-php-entrypoint"]
-####
-# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
-STOPSIGNAL SIGWINCH
-
-COPY apache2-foreground /usr/local/bin/
-WORKDIR /var/www/html
-
-EXPOSE 80
-CMD ["apache2-foreground"]
-####
+RUN set -eux; \
+ apt-get update; \
+ apt-get install -y vim;
diff --git a/7.4/buster/apache/publish-image.sh b/7.4/buster/apache/publish-image.sh
index 347bfb9c14..a86af41f8a 100755
--- a/7.4/buster/apache/publish-image.sh
+++ b/7.4/buster/apache/publish-image.sh
@@ -1,18 +1,22 @@
-#!/bin/sh
+#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
-image="polyverse/ps-php7.4-apache"
+type="$(basename $PWD)"
+build="$(basename $(dirname $PWD))"
+php_ver="$(basename $(dirname $(dirname $PWD)))"
+image="polyverse/ps-php${php_ver}-${build}-${type}"
+
+echo "Image $image being built"
echo "$(date) Obtaining current git sha for tagging the docker image"
headsha=$(git rev-parse --verify HEAD)
-
+echo "Building image $image:$headsha"
docker build -t $image:$headsha .
if [[ "$1" == "-p" ]]; then
- docker push $image:$headsha
- echo "Pushing as latest tag..."
- docker tag $image:$headsha $image:latest
- docker push $image:latest
+ echo "Pushing as latest tag..."
+ docker tag $image:$headsha $image:latest
+ docker push $image:latest
+ docker push $image:$headsha
fi
-
-
diff --git a/7.4/buster/fpm/Dockerfile b/7.4/buster/fpm/Dockerfile
index e5426db504..c3117346a5 100644
--- a/7.4/buster/fpm/Dockerfile
+++ b/7.4/buster/fpm/Dockerfile
@@ -1,3 +1,4 @@
+FROM polyverse/php-polyscripting-builder:3c6b6ea8c7e2cbb7a04cdff71a65186a28d1c66f as polyscripter
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
@@ -17,7 +18,7 @@ RUN set -eux; \
# dependencies required for running "phpize"
# (see persistent deps below)
-ENV PHPIZE_DEPS \
+ENV PHPIZE_DEPS bison bash \
autoconf \
dpkg-dev \
file \
@@ -105,6 +106,12 @@ RUN set -eux; \
COPY docker-php-source /usr/local/bin/
+#add polyscripting
+ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting"
+ENV PHP_SRC_PATH "/usr/src/php"
+WORKDIR $POLYSCRIPT_PATH
+COPY --from=polyscripter /polyscripting/ ./
+
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
@@ -176,17 +183,13 @@ RUN set -eux; \
\
${PHP_EXTRA_CONFIGURE_ARGS:-} \
; \
- make -j "$(nproc)"; \
- find -type f -name '*.a' -delete; \
- make install; \
+ ${POLYSCRIPT_PATH}/polyscript-enable; \
find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \
- make clean; \
\
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
cp -v php.ini-* "$PHP_INI_DIR/"; \
\
cd /; \
- docker-php-source delete; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
@@ -199,7 +202,6 @@ RUN set -eux; \
| sort -u \
| xargs -r apt-mark manual \
; \
- apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
diff --git a/7.4/buster/fpm/publish-image.sh b/7.4/buster/fpm/publish-image.sh
new file mode 100755
index 0000000000..68fd606fa4
--- /dev/null
+++ b/7.4/buster/fpm/publish-image.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
+
+type="$(basename $PWD)"
+build="$(basename $(dirname $PWD))"
+php_ver="$(basename $(dirname $(dirname $PWD)))"
+image="polyverse/ps-php${php_ver}-${build}-${type}"
+
+echo "Image $image being built"
+
+echo "$(date) Obtaining current git sha for tagging the docker image"
+headsha=$(git rev-parse --verify HEAD)
+
+echo "Building image $image:$headsha"
+docker build -t $image:$headsha .
+
+if [[ "$1" == "-p" ]]; then
+ echo "Pushing as latest tag..."
+ docker tag $image:$headsha $image:latest
+ docker push $image:latest
+fi
diff --git a/polyscripting/CONTRIBUTING.md b/polyscripting/CONTRIBUTING.md
new file mode 100644
index 0000000000..5a760ca921
--- /dev/null
+++ b/polyscripting/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+ All code under this directory is proprietary and copyrighted by Polyverse Corporation. In order to contribute,
+ you must sign a Contributor License Agreement.
+
+ To get started, sign the Contributor License Agreement.
\ No newline at end of file
diff --git a/polyscripting/Dockerfile b/polyscripting/Dockerfile
index 84dc7fc188..88439132a3 100644
--- a/polyscripting/Dockerfile
+++ b/polyscripting/Dockerfile
@@ -1,7 +1,9 @@
+# Copyright (c) 2020 Polyverse Corporation
FROM golang
COPY src/tokenizer /polyscripting/
COPY scripts /polyscripting/
+COPY /lambda /lambda
COPY ./src/scrambler/* /go/src/github.com/polyverse/scrambler/
diff --git a/polyscripting/LICENSE b/polyscripting/LICENSE
new file mode 100644
index 0000000000..08b1a4668b
--- /dev/null
+++ b/polyscripting/LICENSE
@@ -0,0 +1,7 @@
+All code under this directory is Polyverse copyrighted and
+quite simply, Proprietary. Not offered under any license at
+the moment. We are working on an appropriate license as we speak.
+
+In the meantime, please contact Polyverse at support@polyverse.com.
+
+
diff --git a/polyscripting/build.sh b/polyscripting/build.sh
index 4ffd822835..6f98cf19bd 100755
--- a/polyscripting/build.sh
+++ b/polyscripting/build.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# Copyright (c) 2020 Polyverse Corporation
image="polyverse/php-polyscripting-builder"
diff --git a/polyscripting/lambda/build-scrambled-lambda.sh b/polyscripting/lambda/build-scrambled.sh
similarity index 97%
rename from polyscripting/lambda/build-scrambled-lambda.sh
rename to polyscripting/lambda/build-scrambled.sh
index 9e0322533e..1c74acc573 100755
--- a/polyscripting/lambda/build-scrambled-lambda.sh
+++ b/polyscripting/lambda/build-scrambled.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
copy_dependencies() {
cp -n $PHP_EXEC/php $PHP_EXEC/s_php
diff --git a/polyscripting/run.sh b/polyscripting/run.sh
index f8294fd1ed..d5e846897d 100755
--- a/polyscripting/run.sh
+++ b/polyscripting/run.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# Copyright (c) 2020 Polyverse Corporation
image="polyverse/php-polyscripting-builder"
headsha=$(git rev-parse --verify HEAD)
diff --git a/polyscripting/scripts/build-scrambled.sh b/polyscripting/scripts/build-scrambled.sh
index 305ccbc7ee..69602636ee 100755
--- a/polyscripting/scripts/build-scrambled.sh
+++ b/polyscripting/scripts/build-scrambled.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
if [ ! -v PHP_EXEC ]; then
PHP_EXEC=/usr/local/bin
diff --git a/polyscripting/scripts/polyscript-enable b/polyscripting/scripts/polyscript-enable
index 50f4e7cc13..51faa621c9 100755
--- a/polyscripting/scripts/polyscript-enable
+++ b/polyscripting/scripts/polyscript-enable
@@ -1,4 +1,5 @@
#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
sed -i '/^PHP_EXTRA_VERSION/s/"$/-poly"/' configure configure.ac Makefile
sed -i '/PHP_EXTRA_VERSION/s/""/"-poly"/' main/php_version.h
diff --git a/polyscripting/src/scrambler/dictionaryHandler.go b/polyscripting/src/scrambler/dictionaryHandler.go
index 049a54248c..ef99a1f5a4 100644
--- a/polyscripting/src/scrambler/dictionaryHandler.go
+++ b/polyscripting/src/scrambler/dictionaryHandler.go
@@ -1,3 +1,5 @@
+// Copyright (c) 2020 Polyverse Corporation
+
package main
import (
diff --git a/polyscripting/src/scrambler/randomizeString.go b/polyscripting/src/scrambler/randomizeString.go
index 3e2fa80328..91cb1098c3 100644
--- a/polyscripting/src/scrambler/randomizeString.go
+++ b/polyscripting/src/scrambler/randomizeString.go
@@ -1,3 +1,5 @@
+// Copyright (c) 2020 Polyverse Corporation
+
package main
import (
diff --git a/polyscripting/src/scrambler/scrambler.go b/polyscripting/src/scrambler/scrambler.go
index 7fbd7a371e..29bb987edb 100644
--- a/polyscripting/src/scrambler/scrambler.go
+++ b/polyscripting/src/scrambler/scrambler.go
@@ -1,3 +1,5 @@
+// Copyright (c) 2020 Polyverse Corporation
+
package main
//TODO: CLEAN UP, REFACTOR
diff --git a/polyscripting/src/tokenizer/snip-transform.php b/polyscripting/src/tokenizer/snip-transform.php
index 0291db3297..27d7e8a618 100644
--- a/polyscripting/src/tokenizer/snip-transform.php
+++ b/polyscripting/src/tokenizer/snip-transform.php
@@ -1,5 +1,6 @@
temp.txt
-sed "/${flag}/q" $dockerfile >> temp.txt
+echo "FROM polyverse/php-polyscripting-builder:$headsha as polyscripter" > temp.txt
+sed -e "/${flag}/q" -e 's#ENV PHPIZE_DEPS#ENV PHPIZE_DEPS bison bash#' $dockerfile >> temp.txt
echo "$enable" >> temp.txt
grep -v -e 'make -j "$(nproc)";' \
-e 'make clean;' \
-e 'docker-php-source delete;' \
-e 'find -type f -name' \
-e 'apt-get purge -y --auto-remove' \
- <(sed -e 's#make install;#\${POLYSCRIPT_PATH}/polyscript-enable#' \
+ <(sed -e 's#make install;#\${POLYSCRIPT_PATH}/polyscript-enable;#' \
<(awk "f;/${flag}/{f=1}" $dockerfile)) >> temp.txt
mv temp.txt $dockerfile
diff --git a/polyscripting/tools/publish-all.sh b/polyscripting/tools/publish-all.sh
index b017cc15aa..9d1bca4bd6 100755
--- a/polyscripting/tools/publish-all.sh
+++ b/polyscripting/tools/publish-all.sh
@@ -1,11 +1,12 @@
#!/bin/bash
-
+# Copyright (c) 2020 Polyverse Corporation
+set -ex
cd ..
-./build.sh -p
+#./build.sh -p
cd ..
ROOT=$PWD
-FILES=$(find . -name polyscripting -prune -o -type f -name '*publish-image.sh*' | sed -E 's|/[^/]+$||' |uniq)
+FILES=$(find . -path ./polyscripting -prune -o -type f -name 'publish-image.sh' -print | sed -E 's|/[^/]+$||' |uniq)
echo $FILES
echo "Building and pushing all polyscripted php images tagged with current gitsha."
@@ -14,4 +15,5 @@ for d in $FILES; do
echo "building and publishing $d"
./publish-image.sh -p
cd $ROOT
+ echo $PWD
done
diff --git a/polyscripting/tools/publish-image.sh b/polyscripting/tools/publish-image.sh
index 6dbeff2ed5..a86af41f8a 100755
--- a/polyscripting/tools/publish-image.sh
+++ b/polyscripting/tools/publish-image.sh
@@ -1,4 +1,5 @@
-#!/bin/sh
+#!/bin/bash
+# Copyright (c) 2020 Polyverse Corporation
type="$(basename $PWD)"
build="$(basename $(dirname $PWD))"
@@ -12,11 +13,10 @@ headsha=$(git rev-parse --verify HEAD)
echo "Building image $image:$headsha"
docker build -t $image:$headsha .
-docker push $image:$headsha
-
if [[ "$1" == "-p" ]]; then
echo "Pushing as latest tag..."
docker tag $image:$headsha $image:latest
docker push $image:latest
+ docker push $image:$headsha
fi