postal/.semaphore/tests.yml

36 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2020-12-27 07:25:00 +01:00
version: v1.0
name: Docker Image Testing
2020-12-27 07:25:00 +01:00
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
2020-12-27 07:57:55 +01:00
- name: Test
2020-12-27 07:25:00 +01:00
task:
jobs:
2020-12-27 07:57:55 +01:00
- name: 'Alpine Test'
2020-12-27 07:25:00 +01:00
commands:
2020-12-27 07:42:01 +01:00
- checkout
2020-12-27 07:25:00 +01:00
- cd alpine
2020-12-27 08:28:26 +01:00
- artifact pull workflow postal-alpine-container.tar
2020-12-27 08:18:20 +01:00
- docker load -i postal-alpine-container.tar
2020-12-27 07:25:00 +01:00
- docker-compose up -d
2020-12-27 09:16:27 +01:00
- for i in {1..20}; do if [[ $(docker inspect postal | jq -r '.[].State.Health.Status') == "healthy" ]]; then break; elif [[ $i -eq 20 ]]; then exit 1; else sleep 15; fi; done;
2020-12-27 07:57:55 +01:00
- name: 'Ubuntu Test'
2020-12-27 07:30:34 +01:00
commands:
2020-12-27 07:42:01 +01:00
- checkout
2020-12-27 07:30:34 +01:00
- cd ubuntu
2020-12-27 08:28:26 +01:00
- artifact pull workflow postal-ubuntu-container.tar
2020-12-27 08:18:20 +01:00
- docker load -i postal-ubuntu-container.tar
2020-12-27 07:30:34 +01:00
- docker-compose up -d
2020-12-27 09:16:27 +01:00
- for i in {1..20}; do if [[ $(docker inspect postal | jq -r '.[].State.Health.Status') == "healthy" ]]; then break; elif [[ $i -eq 20 ]]; then exit 1; else sleep 15; fi; done;
2021-01-22 10:42:15 +01:00
promotions:
2021-03-18 06:01:57 +01:00
- name: Upload to Production
pipeline_file: upload-production.yml
2021-01-22 10:42:15 +01:00
auto_promote:
2021-03-18 06:01:57 +01:00
when: result = 'passed' and branch = 'master'
- name: Dummy Upload
pipeline_file: upload-dummy.yml
auto_promote:
when: result = 'passed' and branch != 'master'