diff --git a/README.md b/README.md index d34ac360..bebb4071 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Docker + Winter CMS -[![Docker Hub Pulls](https://img.shields.io/docker/pulls/hiltonbanes/wintercms.svg)](https://hub.docker.com/r/hiltonbanes/wintercms/) [![Winter CMS Build v1.0.474](https://img.shields.io/badge/Winter%20CMS%20Build-v1.0.474-red.svg)](https://github.com/wintercms/winter) +[![Docker Hub Pulls](https://img.shields.io/docker/pulls/hiltonbanes/wintercms.svg)](https://hub.docker.com/r/hiltonbanes/wintercms/) [![Winter CMS Build v1.1.6](https://img.shields.io/badge/Winter%20CMS%20Build-v1.1.6-red.svg)](https://github.com/wintercms/winter) The docker images defined in this repository serve as a starting point for [Winter CMS](https://wintercms.com) projects. @@ -20,12 +20,12 @@ Based on [official docker PHP images](https://hub.docker.com/_/php), images incl ## Supported Tags -- `build.v1.0.474-php7.4-apache`, `php7.4-apache`: [php7.4/apache/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.4/apache/Dockerfile) -- `build.v1.0.474-php7.4-fpm`, `php7.4-fpm`: [php7.4/fpm/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.4/fpm/Dockerfile) -- `build.v1.0.474-php7.3-apache`, `php7.3-apache`: [php7.3/apache/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.3/apache/Dockerfile) -- `build.v1.0.474-php7.3-fpm`, `php7.3-fpm`: [php7.3/fpm/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.3/fpm/Dockerfile) -- `build.v1.0.474-php7.2-apache`, `php7.2-apache`, `build.v1.0.474`, `latest`: [php7.2/apache/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.2/apache/Dockerfile) -- `build.v1.0.474-php7.2-fpm`, `php7.2-fpm`: [php7.2/fpm/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.2/fpm/Dockerfile) +- `build.v1.1.6-php7.4-apache`, `php7.4-apache`: [php7.4/apache/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.4/apache/Dockerfile) +- `build.v1.1.6-php7.4-fpm`, `php7.4-fpm`: [php7.4/fpm/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.4/fpm/Dockerfile) +- `build.v1.1.6-php7.3-apache`, `php7.3-apache`: [php7.3/apache/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.3/apache/Dockerfile) +- `build.v1.1.6-php7.3-fpm`, `php7.3-fpm`: [php7.3/fpm/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.3/fpm/Dockerfile) +- `build.v1.1.6-php7.2-apache`, `php7.2-apache`, `build.v1.1.6`, `latest`: [php7.2/apache/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.2/apache/Dockerfile) +- `build.v1.1.6-php7.2-fpm`, `php7.2-fpm`: [php7.2/fpm/Dockerfile](https://github.com/mik-p/docker-wintercms/blob/master/php7.2/fpm/Dockerfile) ### Develop Tags diff --git a/php7.2/apache/Dockerfile b/php7.2/apache/Dockerfile index 76b8e531..785b9de6 100644 --- a/php7.2/apache/Dockerfile +++ b/php7.2/apache/Dockerfile @@ -32,9 +32,9 @@ RUN a2enmod rewrite COPY config/docker /usr/src/wintercms-config-docker -ENV WINTERCMS_TAG v1.0.474 -ENV WINTERCMS_CHECKSUM 5196ccd82d81c79667869056a2b7e27dc34a38a1 -ENV WINTERCMS_CORE_BUILD v1.0.474 +ENV WINTERCMS_TAG v1.1.6 +ENV WINTERCMS_CHECKSUM ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 +ENV WINTERCMS_CORE_BUILD v1.1.6 RUN git clone https://github.com/wintercms/winter.git -b $WINTERCMS_TAG --depth 1 . && \ echo "Update composer.json: Set explicit build references for winter module dependencies" && \ diff --git a/php7.2/fpm/Dockerfile b/php7.2/fpm/Dockerfile index 26581b67..305c82d4 100644 --- a/php7.2/fpm/Dockerfile +++ b/php7.2/fpm/Dockerfile @@ -32,9 +32,9 @@ RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/l COPY config/docker /usr/src/wintercms-config-docker -ENV WINTERCMS_TAG v1.0.474 -ENV WINTERCMS_CHECKSUM 5196ccd82d81c79667869056a2b7e27dc34a38a1 -ENV WINTERCMS_CORE_BUILD v1.0.474 +ENV WINTERCMS_TAG v1.1.6 +ENV WINTERCMS_CHECKSUM ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 +ENV WINTERCMS_CORE_BUILD v1.1.6 RUN git clone https://github.com/wintercms/winter.git -b $WINTERCMS_TAG --depth 1 . && \ echo "Update composer.json: Set explicit build references for winter module dependencies" && \ diff --git a/php7.3/apache/Dockerfile b/php7.3/apache/Dockerfile index 27aead68..5c280f6b 100644 --- a/php7.3/apache/Dockerfile +++ b/php7.3/apache/Dockerfile @@ -32,9 +32,9 @@ RUN a2enmod rewrite COPY config/docker /usr/src/wintercms-config-docker -ENV WINTERCMS_TAG v1.0.474 -ENV WINTERCMS_CHECKSUM 5196ccd82d81c79667869056a2b7e27dc34a38a1 -ENV WINTERCMS_CORE_BUILD v1.0.474 +ENV WINTERCMS_TAG v1.1.6 +ENV WINTERCMS_CHECKSUM ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 +ENV WINTERCMS_CORE_BUILD v1.1.6 RUN git clone https://github.com/wintercms/winter.git -b $WINTERCMS_TAG --depth 1 . && \ echo "Update composer.json: Set explicit build references for winter module dependencies" && \ diff --git a/php7.3/fpm/Dockerfile b/php7.3/fpm/Dockerfile index ee27e381..0d1a46b1 100644 --- a/php7.3/fpm/Dockerfile +++ b/php7.3/fpm/Dockerfile @@ -32,9 +32,9 @@ RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/l COPY config/docker /usr/src/wintercms-config-docker -ENV WINTERCMS_TAG v1.0.474 -ENV WINTERCMS_CHECKSUM 5196ccd82d81c79667869056a2b7e27dc34a38a1 -ENV WINTERCMS_CORE_BUILD v1.0.474 +ENV WINTERCMS_TAG v1.1.6 +ENV WINTERCMS_CHECKSUM ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 +ENV WINTERCMS_CORE_BUILD v1.1.6 RUN git clone https://github.com/wintercms/winter.git -b $WINTERCMS_TAG --depth 1 . && \ echo "Update composer.json: Set explicit build references for winter module dependencies" && \ diff --git a/php7.4/apache/Dockerfile b/php7.4/apache/Dockerfile index 65db0362..f6f82628 100644 --- a/php7.4/apache/Dockerfile +++ b/php7.4/apache/Dockerfile @@ -32,9 +32,9 @@ RUN a2enmod rewrite COPY config/docker /usr/src/wintercms-config-docker -ENV WINTERCMS_TAG v1.0.474 -ENV WINTERCMS_CHECKSUM 5196ccd82d81c79667869056a2b7e27dc34a38a1 -ENV WINTERCMS_CORE_BUILD v1.0.474 +ENV WINTERCMS_TAG v1.1.6 +ENV WINTERCMS_CHECKSUM ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 +ENV WINTERCMS_CORE_BUILD v1.1.6 RUN git clone https://github.com/wintercms/winter.git -b $WINTERCMS_TAG --depth 1 . && \ echo "Update composer.json: Set explicit build references for winter module dependencies" && \ diff --git a/php7.4/fpm/Dockerfile b/php7.4/fpm/Dockerfile index de707cc2..5ca90d60 100644 --- a/php7.4/fpm/Dockerfile +++ b/php7.4/fpm/Dockerfile @@ -32,9 +32,9 @@ RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/l COPY config/docker /usr/src/wintercms-config-docker -ENV WINTERCMS_TAG v1.0.474 -ENV WINTERCMS_CHECKSUM 5196ccd82d81c79667869056a2b7e27dc34a38a1 -ENV WINTERCMS_CORE_BUILD v1.0.474 +ENV WINTERCMS_TAG v1.1.6 +ENV WINTERCMS_CHECKSUM ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 +ENV WINTERCMS_CORE_BUILD v1.1.6 RUN git clone https://github.com/wintercms/winter.git -b $WINTERCMS_TAG --depth 1 . && \ echo "Update composer.json: Set explicit build references for winter module dependencies" && \ diff --git a/test/composer_update.bash b/test/composer_update.bash index 68f1207d..cd6338be 100755 --- a/test/composer_update.bash +++ b/test/composer_update.bash @@ -10,9 +10,11 @@ fi TEST_CONTAINER_NAME=test-wn-composer-update TEST_CONTAINER_TYPE=$SOURCE_ROOT/php7.4/apache +TEST_CONTAINER_DOCKERFILE=Dockerfile +# TEST_CONTAINER_DOCKERFILE=Dockerfile.develop echo "build test" -docker build -t $TEST_CONTAINER_NAME $TEST_CONTAINER_TYPE || exit 1 +docker build -t $TEST_CONTAINER_NAME $TEST_CONTAINER_TYPE -f $TEST_CONTAINER_TYPE/$TEST_CONTAINER_DOCKERFILE || exit 1 echo "run test container" docker run \ diff --git a/update.sh b/update.sh index 61399691..50a0259e 100755 --- a/update.sh +++ b/update.sh @@ -12,14 +12,20 @@ if ! hash sha1sum 2>&-; then { if ! hash openssl 2>&-; then echo "Error: openssl ### Functions function check_winter { + # CORE_HASH="$WINTERCMS_CORE_HASH"; # curl -X POST -fsS --connect-timeout 15 --url https://api.github.com/repos/wintercms/winter/releases/latest \ # -F "build=$CORE_BUILD" -F "core=$CORE_HASH" -F "plugins=a:0:{}" -F "server=$WINTERCMS_SERVER_HASH" -F "edge=$EDGE" \ # | jq '. | { build: .core.build, hash: .core.hash, update: .update, updates: .core.updates }' || exit 1 - # curl -fsS --connect-timeout 15 https://api.github.com/repos/wintercms/winter/releases/latest | jq -r '. | { name: .name, tag: .tag_name, hash: $CORE_HASH}' || exit 1; - curl -fsS --connect-timeout 15 https://api.github.com/repos/wintercms/winter/releases/latest | jq -r '. | { name: .name, tag: .tag_name}' || exit 1; + if [ ! -z "$1" ]; then + # get a tag instead + curl -fsS --connect-timeout 15 https://api.github.com/repos/wintercms/winter/tags | jq --argjson tag_index $1 -r '.[$tag_index] | { name: .name, tag: .name }' || exit 1; + else + # curl -fsS --connect-timeout 15 https://api.github.com/repos/wintercms/winter/releases/latest | jq -r '. | { name: .name, tag: .tag_name, hash: $CORE_HASH}' || exit 1; + curl -fsS --connect-timeout 15 https://api.github.com/repos/wintercms/winter/releases/latest | jq -r '. | { name: .name, tag: .tag_name}' || exit 1; + fi } function update_checksum { @@ -233,6 +239,7 @@ while true; do --push) PUSH=1; shift ;; --rewrite) REWRITE_ONLY=1; shift ;; -h) HELP_MSG=1; shift ;; + -t) TAG_SELECT=1; shift ; GITHUB_LATEST_TAG_INDEX=$1; shift ;; *) break esac @@ -247,7 +254,9 @@ echo "usage: ./update.sh [options]" echo "" echo "options:" echo "-h this message" +echo "-t tag [index]: select a git tag by index instead of latest stable" echo "" +echo "commands:" echo "--force force the process" echo "--push push the changes to source repository" echo "--rewrite only rewrite the local files" @@ -257,13 +266,16 @@ echo "" echo "starting update:" +[ "$TAG_SELECT" ] && echo " - latest tag shifted by index: $GITHUB_LATEST_TAG_INDEX" + [ "$PUSH" ] && echo ' - Commit changes' # Load cached version if not forced [ "$FORCE" ] && echo ' - Force update' || source version [ "$REWRITE_ONLY" ] && echo ' - Rewriting Dockerfiles and README' echo " - Querying Winter CMS repo for latest..." -LATEST_STABLE_RELEASE=$(check_winter) +LATEST_STABLE_RELEASE=$(check_winter $GITHUB_LATEST_TAG_INDEX) +echo $LATEST_STABLE_RELEASE if [ $(echo "$LATEST_STABLE_RELEASE" | jq -r '.name') == $WINTERCMS_BUILD ]; then STABLE_UPDATE=0 diff --git a/version b/version index 235fde2a..f348b0f9 100644 --- a/version +++ b/version @@ -1,4 +1,4 @@ -WINTERCMS_BUILD=v1.0.474 -WINTERCMS_CHECKSUM=5196ccd82d81c79667869056a2b7e27dc34a38a1 +WINTERCMS_BUILD=v1.1.6 +WINTERCMS_CHECKSUM=ae7903d9f5ac0b67c12d804db6adc0f2f9c494a8 WINTERCMS_DEVELOP_COMMIT=4847f8bc92b17c689f3ff163f4672ba7155362e4 WINTERCMS_DEVELOP_CHECKSUM=9f86e32a8f81d828039a7a4e7ede029be5be9dc2