From 974de0c02a2dc3627eb83e8b233533223a2dd36d Mon Sep 17 00:00:00 2001 From: james Hart Date: Thu, 3 Oct 2024 09:52:44 +0100 Subject: [PATCH 1/7] first commit - helm_lint and node_build --- .github/workflows/pipeline.yml | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 00000000..78e5d2c7 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,76 @@ +name: Pipeline + +on: + push: + branches: + - main + + workflow_dispatch: + inputs: + environment: + description: Environment + type: choice + required: true + options: + - dev + - prod + - staging + default: 'dev' + version: # Only used when run manually - build.yml will include it + description: Image version + type: string + required: true + +jobs: + build_node: + name: Build node + uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build.yml@HEAT-337-helm-lint + secrets: inherit + # unit_test: + # name: Unit test + # uses: ministryofjustice/hmpps-github-actions/workflows/node_unit_test.yml@HEAT-337-helm-lint + # with: + # push: true + # secrets: inherit + # needs: ['build_node'] + # integration_test: + # name: Integration test + # uses: ministryofjustice/hmpps-github-actions/workflows/node_integration_test.yml@HEAT-337-helm-lint + # with: + # push: true + # secrets: inherit + # needs: ['build_node'] + helm_lint: + name: helm_lint + uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@HEAT-337-helm-lint + secrets: inherit + with: + environment: ${{ inputs.environment }} + + # These bits to be done... + # build: + # name: Build + # uses: ./.github/workflows/build.yml + # with: + # push: true + # secrets: inherit + + # deploy_to_dev: + # name: Deploy to dev + # uses: ./.github/workflows/deploy.yml + # needs: build + # with: + # environment: development + # version: ${{ needs.build.outputs.version }} + # secrets: inherit + + # deploy_to_prod: + # name: Deploy to prod + # uses: ./.github/workflows/deploy.yml + # needs: + # - build + # - deploy_to_dev # wait for the deploy_to_dev job to complete + # with: + # environment: production + # version: ${{ needs.build.outputs.version }} + # secrets: inherit \ No newline at end of file From 03449bee15f2bc95a4ff9d443b61a338727e745f Mon Sep 17 00:00:00 2001 From: james Hart Date: Thu, 3 Oct 2024 10:09:50 +0100 Subject: [PATCH 2/7] working helm_lint --- .github/workflows/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 78e5d2c7..d702f7d3 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -41,11 +41,11 @@ jobs: # secrets: inherit # needs: ['build_node'] helm_lint: - name: helm_lint + name: helm lint uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@HEAT-337-helm-lint secrets: inherit with: - environment: ${{ inputs.environment }} + environment: ${{ inputs.environment || 'dev' }} # These bits to be done... # build: From a6f36818a8350591badb86b5fc0070f1c91b5bbd Mon Sep 17 00:00:00 2001 From: james Hart Date: Fri, 4 Oct 2024 11:00:20 +0100 Subject: [PATCH 3/7] try node workflow on the template --- .github/workflows/pipeline.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index d702f7d3..1118257f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -3,8 +3,8 @@ name: Pipeline on: push: branches: - - main - + # - main + - '*' workflow_dispatch: inputs: environment: @@ -22,31 +22,18 @@ on: required: true jobs: - build_node: + build_test_node: name: Build node - uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build.yml@HEAT-337-helm-lint + uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build_test.yml@HEAT-353-typescript-node-workflow secrets: inherit - # unit_test: - # name: Unit test - # uses: ministryofjustice/hmpps-github-actions/workflows/node_unit_test.yml@HEAT-337-helm-lint - # with: - # push: true - # secrets: inherit - # needs: ['build_node'] - # integration_test: - # name: Integration test - # uses: ministryofjustice/hmpps-github-actions/workflows/node_integration_test.yml@HEAT-337-helm-lint - # with: - # push: true - # secrets: inherit - # needs: ['build_node'] helm_lint: name: helm lint - uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@HEAT-337-helm-lint + uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@main secrets: inherit with: environment: ${{ inputs.environment || 'dev' }} + # These bits to be done... # build: # name: Build From fbbf138e86f7e5b31d4e9cecb96c60f8345f8693 Mon Sep 17 00:00:00 2001 From: james Hart Date: Fri, 4 Oct 2024 13:09:58 +0100 Subject: [PATCH 4/7] bump to check latest version --- .github/workflows/pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 1118257f..5e9977f6 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -33,7 +33,6 @@ jobs: with: environment: ${{ inputs.environment || 'dev' }} - # These bits to be done... # build: # name: Build From 3b5d6cc2e87f990b7222fc1b4fb4fab4eceeb3f4 Mon Sep 17 00:00:00 2001 From: james Hart Date: Mon, 7 Oct 2024 12:17:11 +0100 Subject: [PATCH 5/7] Separate node build and tests --- .github/workflows/pipeline.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5e9977f6..46488c6e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -22,9 +22,22 @@ on: required: true jobs: - build_test_node: - name: Build node - uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build_test.yml@HEAT-353-typescript-node-workflow + # main node build workflow + node_build: + name: node build + uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build.yml@HEAT-353-typescript-node-workflow + secrets: inherit + # generic node unit tests - feel free to override with local tests if required + node_unit_tests: + name: node unit tests + uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_unit_tests.yml@HEAT-353-typescript-node-workflow + needs: [node_build] + secrets: inherit + # generic node integration tests using wiremock - feel free to override with local tests if required + node_integration_tests: + name: node integration tests + uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_integration_tests.yml@HEAT-353-typescript-node-workflow + needs: [node_build] secrets: inherit helm_lint: name: helm lint From 8741a5ead03d55caca8a584fea17adaa86d4c3f0 Mon Sep 17 00:00:00 2001 From: Andrew Lee <1517745+andrewrlee@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:27:32 +0100 Subject: [PATCH 6/7] lint error --- server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.ts b/server.ts index f0d89e65..7ad11214 100755 --- a/server.ts +++ b/server.ts @@ -3,7 +3,7 @@ import 'applicationinsights' import app from './server/index' import logger from './logger' - +; app.listen(app.get('port'), () => { logger.info(`Server listening on port ${app.get('port')}`) }) From a995c15dc29ecd6f075ace3d8723583ffee8b646 Mon Sep 17 00:00:00 2001 From: james Hart Date: Mon, 7 Oct 2024 15:48:09 +0100 Subject: [PATCH 7/7] match all the all the branches --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 46488c6e..0c9299c4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -4,7 +4,7 @@ on: push: branches: # - main - - '*' + - '**' workflow_dispatch: inputs: environment: