-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from UKHomeOffice/transfer-to-new-drone
Transfer pipelines to new drone
- Loading branch information
Showing
4 changed files
with
60 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
pipeline: | ||
build_docker_image: | ||
image: docker:1.12 | ||
test: | ||
image: docker:17.09.0-ce | ||
environment: | ||
- DOCKER_HOST=tcp://127.0.0.1:2375 | ||
- DOCKER_HOST=tcp://172.17.0.1:2375 | ||
commands: | ||
- docker build -t image . | ||
- apk update && apk add bash curl | ||
- docker build -t nginx-test-img -f Dockerfile-test . | ||
- docker run --name nginx-test -e NGINX_CONFIG_FILE=/nginx.conf -d nginx-test-img | ||
- sleep 3 | ||
- curl -sf http://$$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx-test):10080 | ||
- ./test-clean-up.sh | ||
|
||
test: | ||
image: docker:1.12 | ||
build_docker_image: | ||
image: docker:17.09.0-ce | ||
environment: | ||
- DOCKER_HOST=tcp://127.0.0.1:2375 | ||
- DOCKER_HOST=tcp://172.17.0.1:2375 | ||
commands: | ||
- docker run --name nginx-test -e NGINX_CONFIG_FILE=/nginx.conf --net=host -v ${PWD}/tests/nginx.conf:/nginx.conf -d image | ||
- sleep 3 | ||
- curl -s -f http://127.0.0.1:10080 | ||
- docker build -t nginx:$${DRONE_COMMIT_SHA} . | ||
when: | ||
event: [push, tag] | ||
branch: master | ||
|
||
latest_image_to_quay: | ||
image: docker:1.12 | ||
image: docker:17.09.0-ce | ||
secrets: | ||
- docker_password | ||
environment: | ||
- DOCKER_HOST=tcp://127.0.0.1:2375 | ||
- DOCKER_HOST=tcp://172.17.0.1:2375 | ||
commands: | ||
- docker login -u="ukhomeofficedigital+drone_nginx" -p=${DOCKER_PASSWORD} quay.io | ||
- docker tag image quay.io/ukhomeofficedigital/nginx:latest | ||
- docker tag image quay.io/ukhomeofficedigital/nginx:${DRONE_COMMIT_SHA} | ||
- docker login -u="ukhomeofficedigital+drone_nginx" -p=$${DOCKER_PASSWORD} quay.io | ||
- docker tag nginx:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/nginx:latest | ||
- docker tag nginx:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/nginx:$${DRONE_COMMIT_SHA} | ||
- docker push quay.io/ukhomeofficedigital/nginx:latest | ||
- docker push quay.io/ukhomeofficedigital/nginx:${DRONE_COMMIT_SHA} | ||
- docker push quay.io/ukhomeofficedigital/nginx:$${DRONE_COMMIT_SHA} | ||
when: | ||
event: push | ||
branch: master | ||
|
||
tag_image_to_quay: | ||
image: docker:1.12 | ||
image: docker:17.09.0-ce | ||
secrets: | ||
- docker_password | ||
environment: | ||
- DOCKER_HOST=tcp://127.0.0.1:2375 | ||
- DOCKER_HOST=tcp://172.17.0.1:2375 | ||
commands: | ||
- docker login -u="ukhomeofficedigital+drone_nginx" -p=${DOCKER_PASSWORD} quay.io | ||
- docker tag image quay.io/ukhomeofficedigital/nginx:${DRONE_TAG} | ||
- docker push quay.io/ukhomeofficedigital/nginx:${DRONE_TAG} | ||
- docker login -u="ukhomeofficedigital+drone_nginx" -p=$${DOCKER_PASSWORD} quay.io | ||
- docker tag nginx:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/nginx:$${DRONE_TAG} | ||
- docker push quay.io/ukhomeofficedigital/nginx:$${DRONE_TAG} | ||
when: | ||
event: tag | ||
|
||
services: | ||
dind: | ||
image: docker:1.12-dind | ||
privileged: true | ||
command: | ||
- "-s" | ||
- "overlay" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM alpine:3.5 | ||
|
||
RUN apk upgrade --no-cache && \ | ||
apk add --no-cache nginx bash nginx-mod-http-lua && \ | ||
install -d -g nginx -o nginx /run/nginx && \ | ||
chown -R nginx:nginx /etc/nginx /var/log/nginx | ||
|
||
COPY bin/run.sh /run.sh | ||
COPY conf.d /etc/nginx/conf.d | ||
COPY tests/nginx.conf /nginx.conf | ||
|
||
USER nginx | ||
ENTRYPOINT ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
if docker ps -a --filter "name=nginx-test" | grep nginx-test &>/dev/null; then | ||
echo "Removing nginx-test container..." | ||
docker stop nginx-test &>/dev/null && docker rm nginx-test &>/dev/null | ||
else | ||
echo "No nginx-test container found." | ||
fi | ||
|
||
if docker images nginx-test-img | grep nginx-test-img &>/dev/null; then | ||
echo "Removing nginx-test-img image..." | ||
docker rmi nginx-test-img &>/dev/null | ||
else | ||
echo "No nginx-test-img image found." | ||
fi |