From d211df6501bf9a935bfb65bb4350cf02797bdb95 Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Thu, 5 Dec 2024 10:48:18 +0100 Subject: [PATCH 1/3] Reuse the build step for the bitbucket pipeline template --- templates/bitbucket-pipelines.yml | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/templates/bitbucket-pipelines.yml b/templates/bitbucket-pipelines.yml index b22e3ba..9ddf90a 100644 --- a/templates/bitbucket-pipelines.yml +++ b/templates/bitbucket-pipelines.yml @@ -1,35 +1,32 @@ # See https://quay.io/repository/hypernode/deploy?tab=tags for all possible tags. image: quay.io/hypernode/deploy:3-php8.2-node18 +definition: + steps: + - step: &hypernode-build + name: Build + script: + - hypernode-deploy build + artifacts: + - build/** + pipelines: branches: # Deploy to test configuration # If you are only deploying to production remove this configuration - test: - - step: - name: build - script: - - hypernode-deploy build -vvv - artifacts: - - build/** + acceptance: # acceptance/staging branch + - step: *hypernode-build - step: - name: deploy + name: Deploy to staging deployment: test script: - - hypernode-deploy deploy test -vvv - after-script: - - hypernode-deploy cleanup - + - hypernode-deploy deploy test # Deploy to production master: + - step: *hypernode-build - step: - name: build - script: - - hypernode-deploy build - artifacts: - - build/** - - step: - name: deploy + name: Deploy to production deployment: production script: - hypernode-deploy deploy production + From 61398d973c038166a96cfaf6813845897185ba6a Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Thu, 5 Dec 2024 10:53:38 +0100 Subject: [PATCH 2/3] Re-add cleanup to acceptance pipeline --- templates/bitbucket-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/bitbucket-pipelines.yml b/templates/bitbucket-pipelines.yml index 9ddf90a..53cd844 100644 --- a/templates/bitbucket-pipelines.yml +++ b/templates/bitbucket-pipelines.yml @@ -21,6 +21,8 @@ pipelines: deployment: test script: - hypernode-deploy deploy test + after-script: + - hypernode-deploy cleanup # Deploy to production master: - step: *hypernode-build From 05e184929b81feb1ea9ec2dbe7b2a1d88e54c3b3 Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Thu, 5 Dec 2024 10:55:26 +0100 Subject: [PATCH 3/3] Add verbose logging to deployment in hypernode brancher for bitbucket pipelines template --- templates/bitbucket-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/bitbucket-pipelines.yml b/templates/bitbucket-pipelines.yml index 53cd844..58a5a9b 100644 --- a/templates/bitbucket-pipelines.yml +++ b/templates/bitbucket-pipelines.yml @@ -6,7 +6,7 @@ definition: - step: &hypernode-build name: Build script: - - hypernode-deploy build + - hypernode-deploy build -vvv artifacts: - build/** @@ -14,13 +14,13 @@ pipelines: branches: # Deploy to test configuration # If you are only deploying to production remove this configuration - acceptance: # acceptance/staging branch + test: # acceptance/staging branch - step: *hypernode-build - step: name: Deploy to staging deployment: test script: - - hypernode-deploy deploy test + - hypernode-deploy deploy test -vvv after-script: - hypernode-deploy cleanup # Deploy to production @@ -30,5 +30,5 @@ pipelines: name: Deploy to production deployment: production script: - - hypernode-deploy deploy production + - hypernode-deploy deploy production -vvv