Skip to content

Commit

Permalink
Merge pull request #158 from docksal/develop
Browse files Browse the repository at this point in the history
Release 2.10.3
  • Loading branch information
lmakarov authored Nov 22, 2019
2 parents a8a4f57 + 2869526 commit 54d6b69
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ script:

after_success:
- docker image ls
- ${TRAVIS_BUILD_DIR}/scripts/docker-push.sh
- make release

after_failure:
- cd ${TRAVIS_BUILD_DIR}/${VERSION} && make logs
Expand Down
19 changes: 11 additions & 8 deletions 7.1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@
-include env_make

VERSION ?= 7.1
TAG_APPENDIX ?= -php$(VERSION)
BUILD_TAG = build-$(TAG_APPENDIX)
REPO = docksal/cli
TAG = build-$(VERSION)
NAME = docksal-cli-$(VERSION)
CWD = $(shell pwd)

# Improve write performance for /home/docker by turning it into a volume
VOLUMES += -v /home/docker

.EXPORT_ALL_VARIABLES:

.PHONY: build test push shell run start stop logs clean release

build:
docker build --cache-from=$(REPO):edge-php$(VERSION) -t $(REPO):$(TAG) .
docker build --cache-from=$(REPO):edge$(TAG_APPENDIX) -t $(REPO):$(BUILD_TAG) .

test:
IMAGE=$(REPO):$(TAG) NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats
IMAGE=$(REPO):$(BUILD_TAG) NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats

push:
docker push $(REPO):$(TAG)
docker push $(REPO):$(BUILD_TAG)

run: clean
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG)

start: clean
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG)

# Non-interactive and non-tty docker exec (uses LF instead of CRLF line endings)
exec:
Expand All @@ -50,7 +53,7 @@ logs-follow:
clean:
docker rm -vf $(NAME) >/dev/null 2>&1 || true

release: build
make push -e TAG=$(TAG)
release:
@../scripts/docker-push.sh

default: build
2 changes: 1 addition & 1 deletion 7.1/config/php/zz-php.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; PHP global (CLI and FPM) settings
; To override settings for FPM use zz-php-fpm.conf
[php]
memory_limit = 1024M
memory_limit = -1
max_execution_time = 600
date.timezone = UTC
display_errors = On
Expand Down
19 changes: 11 additions & 8 deletions 7.2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@
-include env_make

VERSION ?= 7.2
TAG_APPENDIX ?= -php$(VERSION)
BUILD_TAG = build-$(TAG_APPENDIX)
REPO = docksal/cli
TAG = build-$(VERSION)
NAME = docksal-cli-$(VERSION)
CWD = $(shell pwd)

# Improve write performance for /home/docker by turning it into a volume
VOLUMES += -v /home/docker

.EXPORT_ALL_VARIABLES:

.PHONY: build test push shell run start stop logs clean release

build:
docker build --cache-from=$(REPO):edge-php$(VERSION) -t $(REPO):$(TAG) .
docker build --cache-from=$(REPO):edge$(TAG_APPENDIX) -t $(REPO):$(BUILD_TAG) .

test:
IMAGE=$(REPO):$(TAG) NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats
IMAGE=$(REPO):$(BUILD_TAG) NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats

push:
docker push $(REPO):$(TAG)
docker push $(REPO):$(BUILD_TAG)

run: clean
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG)

start: clean
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG)

# Non-interactive and non-tty docker exec (uses LF instead of CRLF line endings)
exec:
Expand All @@ -50,7 +53,7 @@ logs-follow:
clean:
docker rm -vf $(NAME) >/dev/null 2>&1 || true

release: build
make push -e TAG=$(TAG)
release:
@../scripts/docker-push.sh

default: build
2 changes: 1 addition & 1 deletion 7.2/config/php/zz-php.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; PHP global (CLI and FPM) settings
; To override settings for FPM use zz-php-fpm.conf
[php]
memory_limit = 1024M
memory_limit = -1
max_execution_time = 600
date.timezone = UTC
display_errors = On
Expand Down
19 changes: 11 additions & 8 deletions 7.3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@
-include env_make

VERSION ?= 7.3
TAG_APPENDIX ?= -php$(VERSION)
BUILD_TAG = build-$(TAG_APPENDIX)
REPO = docksal/cli
TAG = build-$(VERSION)
NAME = docksal-cli-$(VERSION)
CWD = $(shell pwd)

# Improve write performance for /home/docker by turning it into a volume
VOLUMES += -v /home/docker

.EXPORT_ALL_VARIABLES:

.PHONY: build test push shell run start stop logs clean release

build:
docker build --cache-from=$(REPO):edge-php$(VERSION) -t $(REPO):$(TAG) .
docker build --cache-from=$(REPO):edge$(TAG_APPENDIX) -t $(REPO):$(BUILD_TAG) .

test:
IMAGE=$(REPO):$(TAG) NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats
IMAGE=$(REPO):$(BUILD_TAG) NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats

push:
docker push $(REPO):$(TAG)
docker push $(REPO):$(BUILD_TAG)

run: clean
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG)

start: clean
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG)

# Non-interactive and non-tty docker exec (uses LF instead of CRLF line endings)
exec:
Expand All @@ -50,7 +53,7 @@ logs-follow:
clean:
docker rm -vf $(NAME) >/dev/null 2>&1 || true

release: build
make push -e TAG=$(TAG)
release:
@../scripts/docker-push.sh

default: build
2 changes: 1 addition & 1 deletion 7.3/config/php/zz-php.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; PHP global (CLI and FPM) settings
; To override settings for FPM use zz-php-fpm.conf
[php]
memory_limit = 1024M
memory_limit = -1
max_execution_time = 600
date.timezone = UTC
display_errors = On
Expand Down
38 changes: 15 additions & 23 deletions scripts/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,21 @@ tag_and_push ()
echo "Pushing ${target} image ..."
docker tag ${source} ${target}
docker push ${target}

# Cloud9 flavor
echo "Pushing ${target}-ide image ..."
docker tag ${source}-ide ${target}-ide
docker push ${target}-ide
}

# ---------------------------- #

# Possible docker image tags
IMAGE_TAG_EDGE="edge-php${VERSION}"
IMAGE_TAG_STABLE="php${VERSION}"

# Read the split parts
# Extract version parts from release tag
IFS='.' read -a ver_arr <<< "$TRAVIS_TAG"
VERSION_MAJOR=${ver_arr[0]#v*} # 2.7.0 => "2"
VERSION_MINOR=${ver_arr[1]} # "2.7.0" => "7"

# Major version, e.g. 2-php7.2
IMAGE_TAG_RELEASE_MAJOR="${ver_arr[0]#v*}-php${VERSION}"

# Major-minor version, e.g. 2.5-php7.2
IMAGE_TAG_RELEASE_MAJOR_MINOR="${ver_arr[0]#v*}.${ver_arr[1]}-php${VERSION}"
# Possible docker image tags
# "image:tag" pattern: <image-repo>:<software-version>[-<image-stability-tag>][-<flavor>]
IMAGE_TAG_EDGE="edge${TAG_APPENDIX}" # e.g., edge[APPENDIX]
IMAGE_TAG_STABLE="stable${TAG_APPENDIX}" # e.g., stable[APPENDIX]
IMAGE_TAG_RELEASE_MAJOR="${VERSION_MAJOR}${TAG_APPENDIX}" # e.g., 2[APPENDIX]
IMAGE_TAG_RELEASE_MAJOR_MINOR="${VERSION_MAJOR}.${VERSION_MINOR}${TAG_APPENDIX}" # e.g., 2.7[APPENDIX]
IMAGE_TAG_LATEST="latest"

# Skip pull request builds
Expand All @@ -70,14 +64,14 @@ docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}"

# Push images
if is_edge; then
tag_and_push ${REPO}:build-${VERSION} ${REPO}:${IMAGE_TAG_EDGE} # Example tag: edge-php7.3
tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_EDGE}
elif is_stable; then
tag_and_push ${REPO}:build-${VERSION} ${REPO}:${IMAGE_TAG_STABLE} # Example tag: php7.3
tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_STABLE}
elif is_release; then
# Have stable, major, minor tags match
tag_and_push ${REPO}:build-${VERSION} ${REPO}:${IMAGE_TAG_STABLE} # Example tag: php7.3
tag_and_push ${REPO}:build-${VERSION} ${REPO}:${IMAGE_TAG_RELEASE_MAJOR} # Example tag: 2-php7.3
tag_and_push ${REPO}:build-${VERSION} ${REPO}:${IMAGE_TAG_RELEASE_MAJOR_MINOR} # Example tag: 2.7-php7.3
tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_STABLE}
tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_RELEASE_MAJOR}
tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_RELEASE_MAJOR_MINOR}
else
# Exit if not on develop, master or release tag
exit
Expand All @@ -86,7 +80,5 @@ fi
# Special case for the "latest" tag
# Push (base image only) on stable and release builds
if is_latest && (is_stable || is_release); then
echo "Pushing ${REPO}:${IMAGE_TAG_LATEST} image ..."
docker tag ${REPO}:build-${VERSION} ${REPO}:${IMAGE_TAG_LATEST}
docker push ${REPO}:${IMAGE_TAG_LATEST}
tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_LATEST}
fi
4 changes: 3 additions & 1 deletion tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ _healthcheck_wait ()
unset output

output=$(echo "$phpInfo" | grep "memory_limit")
echo "$output" | grep "1024M => 1024M"
# grep expression cannot start with "-", so prepending the expression with "memory_limit" here.
# Another option is to do "grep -- '-...'".
echo "$output" | grep "memory_limit => -1 => -1"
unset output

output=$(echo "$phpInfo" | grep "sendmail_path")
Expand Down

0 comments on commit 54d6b69

Please sign in to comment.