57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
#variables:
|
|
before_script:
|
|
- docker info
|
|
|
|
stages:
|
|
- docker-build
|
|
- tests
|
|
- cleanup
|
|
|
|
build-docker-alpine:
|
|
stage: docker-build
|
|
script:
|
|
- cd alpine
|
|
- docker build --network=host -t catdeployed/postal:alpine .
|
|
- docker save -o postal-alpine-container.tar catdeployed/postal:alpine
|
|
artifacts:
|
|
paths:
|
|
- alpine/postal-alpine-container.tar
|
|
|
|
build-docker-ubuntu:
|
|
stage: docker-build
|
|
script:
|
|
- cd ubuntu
|
|
- docker build --network=host -t catdeployed/postal:ubuntu .
|
|
- docker save -o postal-ubuntu-container.tar catdeployed/postal:ubuntu
|
|
artifacts:
|
|
paths:
|
|
- ubuntu/postal-ubuntu-container.tar
|
|
|
|
test-docker-ubuntu:
|
|
stage: tests
|
|
script:
|
|
- cd ubuntu
|
|
- docker load -i postal-ubuntu-container.tar
|
|
- docker-compose up -d
|
|
- sleep 600
|
|
- docker inspect postal | jq '.[].State.Health'
|
|
after_script:
|
|
- cd ubuntu
|
|
- docker-compose rm -sfv
|
|
|
|
test-docker-alpine:
|
|
stage: tests
|
|
script:
|
|
- cd alpine
|
|
- docker load -i postal-alpine-container.tar
|
|
- docker-compose up -d
|
|
- docker-compose run postal initialize
|
|
after_script:
|
|
- cd alpine
|
|
- docker-compose rm -sfv
|
|
|
|
after_script:
|
|
- docker container prune -f
|
|
- docker image prune -f
|
|
- docker system prune -af --volumes
|