From b65c1d873e7bf6f8f309be12251110a19013b0a9 Mon Sep 17 00:00:00 2001 From: PrincessOfCats <9060865+ILoveYaToo@users.noreply.github.com> Date: Sun, 27 Dec 2020 01:17:44 -0500 Subject: [PATCH 1/3] Use Single job starter workflow --- .semaphore/semaphore.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .semaphore/semaphore.yml diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml new file mode 100644 index 0000000..a9e572b --- /dev/null +++ b/.semaphore/semaphore.yml @@ -0,0 +1,13 @@ +version: v1.0 +name: Initial Pipeline +agent: + machine: + type: e1-standard-2 + os_image: ubuntu1804 +blocks: + - name: 'Block #1' + task: + jobs: + - name: 'Job #1' + commands: + - checkout From 954808375248866485b5c99833282585fb646bfa Mon Sep 17 00:00:00 2001 From: PrincessOfCats Date: Sun, 27 Dec 2020 06:25:00 +0000 Subject: [PATCH 2/3] Update Semaphore configuration --- .semaphore/pipeline_2.yml | 15 +++++++++++++++ .semaphore/semaphore.yml | 21 ++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .semaphore/pipeline_2.yml diff --git a/.semaphore/pipeline_2.yml b/.semaphore/pipeline_2.yml new file mode 100644 index 0000000..02bb410 --- /dev/null +++ b/.semaphore/pipeline_2.yml @@ -0,0 +1,15 @@ +version: v1.0 +name: Pipeline 2 +agent: + machine: + type: e1-standard-2 + os_image: ubuntu1804 +blocks: + - name: Test (Alpine) + task: + jobs: + - name: 'Job #1' + commands: + - cd alpine + - docker-compose up -d + - 'for i in {1..20}; do [ $(docker inspect postal | jq ''.[].State.Health.Status'') == "healthy" ] && break || sleep 15; done' diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a9e572b..ce92cf3 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -5,9 +5,28 @@ agent: type: e1-standard-2 os_image: ubuntu1804 blocks: - - name: 'Block #1' + - name: Build (Alpine) task: jobs: - name: 'Job #1' commands: - checkout + - cd alpine + - 'docker build --network=host -t catdeployed/postal:alpine .' + skip: + when: branch != master + - name: Build (Ubuntu) + skip: + when: branch != master + task: + jobs: + - name: 'Job #1' + commands: + - checkout + - cd alpine + - 'docker build --network=host -t catdeployed/postal:alpine .' +promotions: + - name: Default Promotion + pipeline_file: pipeline_2.yml + auto_promote: + when: branch = 'master' AND result = 'passed' From 659cd64b817ce6b0bf65eb5c837e6789f424a875 Mon Sep 17 00:00:00 2001 From: PrincessOfCats Date: Sun, 27 Dec 2020 06:26:03 +0000 Subject: [PATCH 3/3] Update Semaphore configuration --- .semaphore/semaphore.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index ce92cf3..a894814 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -14,10 +14,10 @@ blocks: - cd alpine - 'docker build --network=host -t catdeployed/postal:alpine .' skip: - when: branch != master + when: branch != 'master' - name: Build (Ubuntu) skip: - when: branch != master + when: branch != 'master' task: jobs: - name: 'Job #1'