From b81182de44d26b6ec4695c09881eb617b2ee9309 Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Mon, 19 Feb 2024 16:07:38 +0100 Subject: [PATCH 1/2] CH-122 fix stage template --- deployment-configuration/codefresh-template-stage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment-configuration/codefresh-template-stage.yaml b/deployment-configuration/codefresh-template-stage.yaml index ae6725b2..a585a269 100644 --- a/deployment-configuration/codefresh-template-stage.yaml +++ b/deployment-configuration/codefresh-template-stage.yaml @@ -30,7 +30,7 @@ steps: working_directory: . commands: - bash cloud-harness/install.sh - - harness-deployment . cloud-harness -t $INCLUDE -n ${{NAMESPACE}} -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -e $ENV -N + - harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV $PARAMS prepare_deployment_view: commands: - 'helm template ./deployment/helm --debug -n ${{NAMESPACE}}' From 9dbcd2e1b22a731d73dd9490e9170ff271f30bf6 Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Wed, 20 Mar 2024 11:00:43 +0100 Subject: [PATCH 2/2] CH-122 stage template test fixes --- .../codefresh-template-stage.yaml | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/deployment-configuration/codefresh-template-stage.yaml b/deployment-configuration/codefresh-template-stage.yaml index a585a269..7a1ff574 100644 --- a/deployment-configuration/codefresh-template-stage.yaml +++ b/deployment-configuration/codefresh-template-stage.yaml @@ -1,7 +1,9 @@ version: '1.0' stages: - prepare + - build - deploy + - qa - publish steps: main_clone: @@ -30,7 +32,7 @@ steps: working_directory: . commands: - bash cloud-harness/install.sh - - harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV $PARAMS + - harness-deployment $PATHS -t ${{DEPLOYMENT_TAG}} -d ${{DOMAIN}} -r ${{REGISTRY}} -rs ${{REGISTRY_SECRET}} -n ${{NAMESPACE}} -e $ENV $PARAMS prepare_deployment_view: commands: - 'helm template ./deployment/helm --debug -n ${{NAMESPACE}}' @@ -55,29 +57,48 @@ steps: cmd_ps: --wait --timeout 600s --create-namespace custom_value_files: - ./deployment/helm/values.yaml + build_test_images: + title: Build test images + type: parallel + stage: qa + steps: [] + when: + condition: + all: + whenVarExists: 'includes("${{SKIP_TESTS}}", "{{SKIP_TESTS}}") == true' wait_deployment: stage: qa title: Wait deployment to be ready image: codefresh/kubectl commands: - kubectl config use-context ${{CLUSTER_NAME}} - - kubectl config set-context --current --namespace=test-${{CF_REPO_NAME}}-${{CF_SHORT_REVISION}} + - kubectl config set-context --current --namespace=${{NAMESPACE}} tests_api: stage: qa title: Api tests working_directory: /home/test - image: "${{api-jest}}" + image: "${{test-api}}" + fail_fast: false commands: - echo $APP_NAME scale: {} + when: + condition: + all: + whenVarExists: 'includes("${{SKIP_TESTS}}", "{{SKIP_TESTS}}") == true' tests_e2e: stage: qa title: End to end tests working_directory: /home/test - image: "${{jest-puppeteer}}" + image: "${{test-e2e}}" + fail_fast: false commands: - yarn test scale: {} + when: + condition: + all: + whenVarExists: 'includes("${{SKIP_TESTS}}", "{{SKIP_TESTS}}") == true' manual_tests: type: pending-approval stage: publish