From c53b60dc0301aeda9d33d319a16890c6e364eeff Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Thu, 3 Aug 2023 21:24:16 +0300 Subject: [PATCH 01/16] wip --- codefresh-e2e.yaml | 181 ++++++++++++++++++++++++++++++++++++++++++++ codefresh-helm3.yml | 18 +++++ 2 files changed, 199 insertions(+) create mode 100644 codefresh-e2e.yaml diff --git a/codefresh-e2e.yaml b/codefresh-e2e.yaml new file mode 100644 index 0000000..f134749 --- /dev/null +++ b/codefresh-e2e.yaml @@ -0,0 +1,181 @@ +version: "1.0" +mode: parallel +stages: + - "init" + - "deploy" + - "clean" + +steps: + prepare_namespaces: + stage: init + image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' + title: Create namespaces + fail_fast: false + working_directory: IMAGE_WORK_DIR + commands: + - 'export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g")' + - 'cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR' + - kubectl config use-context ${{KUBE_CONTEXT}} + - kubectl create ns helm-$HELM_VERSION_STR + - kubectl create ns helm-deploy-$HELM_VERSION_STR + - kubectl create ns helm-promo-$HELM_VERSION_STR + name: deleting_release_tomcat + + auth: + stage: deploy + type: helm + arguments: + action: auth + helm_version: ${{HELM_VERSION}} + kube_context: ${{KUBE_CONTEXT}} + commands: + - helm list + when: + steps: + - name: prepare_namespaces + on: + - finished + + deploy: + stage: deploy + type: helm + arguments: + action: install + chart_name: tomcat + release_name: tomcat + helm_version: ${{HELM_VERSION}} + kube_context: ${{KUBE_CONTEXT}} + namespace: helm-${{HELM_VERSION_NORMALIZED}} + skip_cf_stable_helm_repo: true + credentials_in_arguments: true + chart_repo_url: 'https://charts.helm.sh/stable' + custom_values: + - 'pat.arr="{one,two,three}"' + - 'STR_WITH_COMAS="one\,two\,three"' + - test_var=test_key + when: + steps: + - name: prepare_namespaces + on: + - finished + + installing_chart: + stage: deploy + create_file: + path: /codefresh/volume/cf-generated + name: values.yaml + content: | + test: + helm_test: string + image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' + title: Installing chart + environment: + - CHART_NAME=tomcat + - RELEASE_NAME=tomcat + - KUBE_CONTEXT=${{KUBE_CONTEXT}} + - NAMESPACE=helm-deploy-${{HELM_VERSION_NORMALIZED}} + - CHART_VERSION=0.4.3 + - 'CHART_REPO_URL=https://charts.helm.sh/stable' + - VALUE_test_var=test_key + - VALUESFILE_values=/codefresh/volume/cf-generated/values.yaml + name: installing_chart + when: + steps: + - name: prepare_namespaces + on: + - finished + + check_installing_helm: + stage: deploy + image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' + commands: + - env | grep HE + - export TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] ; then return 1; fi + - export TOMCAT_RELEASES=$(kubectl get secret -n helm-deploy-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - if [ -z "$TOMCAT_RELEASES" ] || [ "$TOMCAT_RELEASES" = "null" ] ; then return 1; fi + when: + steps: + - name: installing_chart + on: + - success + + promote_chart: + stage: deploy + create_file: + path: /codefresh/volume/cf-generated + name: values.yaml + content: | + test: + helm_test: string + var: test_key_1 + image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' + title: Promote chart + environment: + - ACTION=promotion + - RELEASE_NAME=tomcat + - KUBE_CONTEXT=${{KUBE_CONTEXT}} + - NAMESPACE=helm-promo-${{HELM_VERSION_NORMALIZED}} + - CHART_NAME=tomcat + - CHART_VERSION=0.4.3 + - >- + CHART_JSON_GZIP=H4sIAAAAAAAAA+Va73LbNhJ/FYySTBLXpOzkrs1pxp3x2W7rXuJobCeZjpmJIBKSWFMAS5CydY6f4b7fp3uMe557gXuF212AJEhRsp10+uXUTiyBix8Wu4v9B17c9CSfi96gdzDjWe4v+TzpbfcinnMYw0cDlqt5yPNAzhT+ejrL81QP+v1pnM+KsR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qIrq1MXmfpS7eR6+3XYplnu0hYvt6uvHEfA3LQgWVhm5iezIZ1iV277O9sNS3iDA7oNZuOxlq7mARffeLJkpVrcp8Jzz6R4EajuDrU2WQYpjtRArGfN5O1+mPJGXaXP5pt6oWnZkUkcsfqFuM7NN6C/fQqLEgbK5/YQcCeojWUIhxn7Zf/Oa3hM02rFlh01BjYFUpuGkkfgKLVRLqSlXgMcZQrSScPMi4VcI3Zswx0ZLSZo/lSSdgqF8uRdf80MGynR2vdmXZRcKCnI3aRpAABn09mX1HkAZ9KC+mcSZLqt83LbA8nmoIup0aB1PpXl1kNMhNaWuuKa0HOpGbCjgX5K1nVUW4kqaYfQmPvvQQDa1RYR+fg6jSGIKe4keimvsLdGGec5Nj0rUzFNrA+uKCOcI6hv0tsqyIgM7y6mwvCj7KGzfqaTJ+s7r2r9Miquo3tmguqx8Qt+qXvfzTIj+nONLwqhDqKWn/V9hSciRrNl6tkB/ji28j/8DeGFAdAwyAAA= + - VALUESFILE_values=/codefresh/volume/cf-generated/values.yaml + name: promote_chart + when: + steps: + - name: check_installing_helm + on: + - success + + check_promote_helm: + stage: deploy + image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' + commands: + - export TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] ; then return 1; fi + - export TOMCAT_RELEASES=$(kubectl get secret -n helm-promo-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - if [ -z "$TOMCAT_RELEASES" ] || [ "$TOMCAT_RELEASES" = "null" ] ; then return 1; fi + when: + steps: + - name: promote_chart + on: + - success + + deleting_release_tomcat: + stage: clean + image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' + title: Deleting release tomcat + fail_fast: false + working_directory: IMAGE_WORK_DIR + commands: + - | + kubectl config use-context ${{KUBE_CONTEXT}} + echo 'Running: helm delete tomcat' + TOMCAT_INSTALLED=$(kubectl get pods -n helm-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] + helm delete tomcat --timeout 300s --namespace helm-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + fi + TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] + helm delete tomcat --timeout 300s --namespace helm-deploy-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-deploy-${{HELM_VERSION_NORMALIZED}} + fi + TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] + helm delete tomcat --timeout 300s --namespace helm-promo-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-promo-${{HELM_VERSION_NORMALIZED}} + fi + name: deleting_release_tomcat + when: + steps: + - name: auth + on: + - finished + - name: deploy + on: + - finished + - name: check_promote_helm + on: + - finished diff --git a/codefresh-helm3.yml b/codefresh-helm3.yml index 6c25b60..6a4bbf2 100644 --- a/codefresh-helm3.yml +++ b/codefresh-helm3.yml @@ -61,6 +61,24 @@ steps: all: recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false' + run_e2e: + type: codefresh-run + stage: run_e2e + arguments: + FOLLOW_LOGS: false + PIPELINE_ID: Helm/e2e + DETACH: false + # TRIGGER_ID: trigger + # BRANCH: ${{CF_BRANCH}} + RESET_VOLUME: true + # VARIABLE_FILE: ${{CF_VOLUME_PATH}}/env_vars_to_run_pipe.yml + VARIABLE: + - HELM_VERSION=${{HELM_VERSION}}-${{CF_SHORT_REVISION}} + when: + condition: + all: + recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false' + push: type: push tag: ${{HELM_VERSION}} From a2871ed64ecf27eeb957fab077390e02db76c08f Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Thu, 3 Aug 2023 21:32:31 +0300 Subject: [PATCH 02/16] wip --- codefresh-helm3.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codefresh-helm3.yml b/codefresh-helm3.yml index 6a4bbf2..9aa0f3c 100644 --- a/codefresh-helm3.yml +++ b/codefresh-helm3.yml @@ -74,6 +74,7 @@ steps: # VARIABLE_FILE: ${{CF_VOLUME_PATH}}/env_vars_to_run_pipe.yml VARIABLE: - HELM_VERSION=${{HELM_VERSION}}-${{CF_SHORT_REVISION}} + - CF_BRANCH=${{CF_BRANCH}} when: condition: all: From 5afc8fa75c2bf0317058c96aaf6a28b1e78632a9 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Thu, 3 Aug 2023 21:44:16 +0300 Subject: [PATCH 03/16] wip --- codefresh-e2e.yaml => codefresh-e2e.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename codefresh-e2e.yaml => codefresh-e2e.yml (100%) diff --git a/codefresh-e2e.yaml b/codefresh-e2e.yml similarity index 100% rename from codefresh-e2e.yaml rename to codefresh-e2e.yml From 6b05d024ef851bcc198785b1fa3455bc5f89a931 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 09:14:59 +0300 Subject: [PATCH 04/16] wip --- codefresh-helm3.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/codefresh-helm3.yml b/codefresh-helm3.yml index 9aa0f3c..bf92a50 100644 --- a/codefresh-helm3.yml +++ b/codefresh-helm3.yml @@ -1,7 +1,12 @@ version: '1.0' +stages: + - "init" + - "build" + - "push" steps: define_the_versions_list: + stage: 'init' image: alpine commands: - |- @@ -14,6 +19,7 @@ steps: notRecursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == true' run-cli-loop: + stage: 'init' image: codefresh/cli commands: - for VAR in $(cat helmVersionsList); do codefresh wait $(codefresh run ${{CF_PIPELINE_NAME}} -d --branch ${{CF_BRANCH}} --variable HELM_VERSION=${VAR} --trigger ${{CF_PIPELINE_TRIGGER_ID}} --context github && sleep 10) & done @@ -24,6 +30,7 @@ steps: notRecursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == true' debug: + stage: 'build' type: freestyle image: alpine commands: @@ -35,6 +42,7 @@ steps: recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false' clone: + stage: 'build' type: git-clone arguments: repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}' @@ -46,6 +54,7 @@ steps: recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false' build_image: + stage: 'build' type: build registry: pysarenko working_directory: '${{clone}}' @@ -62,8 +71,8 @@ steps: recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false' run_e2e: + stage: 'build' type: codefresh-run - stage: run_e2e arguments: FOLLOW_LOGS: false PIPELINE_ID: Helm/e2e @@ -81,6 +90,7 @@ steps: recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false' push: + stage: 'push' type: push tag: ${{HELM_VERSION}} candidate: ${{build_image}} From 81f279eee6d9a12ac8c3d478d480585aa116f9be Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 10:10:12 +0300 Subject: [PATCH 05/16] wip --- codefresh-e2e.yml | 113 ++++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 50 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index f134749..1d0198b 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -13,51 +13,64 @@ steps: fail_fast: false working_directory: IMAGE_WORK_DIR commands: - - 'export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g")' - - 'cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR' - - kubectl config use-context ${{KUBE_CONTEXT}} - - kubectl create ns helm-$HELM_VERSION_STR - - kubectl create ns helm-deploy-$HELM_VERSION_STR - - kubectl create ns helm-promo-$HELM_VERSION_STR - name: deleting_release_tomcat + - | + export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g") + cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR + kubectl config use-context ${{KUBE_CONTEXT}} + NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) + if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] + kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + fi + NS_EXIST=$(kubectl get ns helm-deploy-$HELM_VERSION_STR --ignore-not-found | grep helm) + if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] + kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + fi + NS_EXIST=$(kubectl get ns helm-promo-$HELM_VERSION_STR --ignore-not-found | grep helm) + if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] + kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + fi + kubectl create ns helm-$HELM_VERSION_STR + kubectl create ns helm-deploy-$HELM_VERSION_STR + kubectl create ns helm-promo-$HELM_VERSION_STR + name: deleting_release_tomcat - auth: - stage: deploy - type: helm - arguments: - action: auth - helm_version: ${{HELM_VERSION}} - kube_context: ${{KUBE_CONTEXT}} - commands: - - helm list - when: - steps: - - name: prepare_namespaces - on: - - finished +# auth: +# stage: deploy +# type: helm +# arguments: +# action: auth +# helm_version: ${{HELM_VERSION}} +# kube_context: ${{KUBE_CONTEXT}} +# commands: +# - helm list +# when: +# steps: +# - name: prepare_namespaces +# on: +# - finished - deploy: - stage: deploy - type: helm - arguments: - action: install - chart_name: tomcat - release_name: tomcat - helm_version: ${{HELM_VERSION}} - kube_context: ${{KUBE_CONTEXT}} - namespace: helm-${{HELM_VERSION_NORMALIZED}} - skip_cf_stable_helm_repo: true - credentials_in_arguments: true - chart_repo_url: 'https://charts.helm.sh/stable' - custom_values: - - 'pat.arr="{one,two,three}"' - - 'STR_WITH_COMAS="one\,two\,three"' - - test_var=test_key - when: - steps: - - name: prepare_namespaces - on: - - finished +# deploy: +# stage: deploy +# type: helm +# arguments: +# action: install +# chart_name: tomcat +# release_name: tomcat +# helm_version: ${{HELM_VERSION}} +# kube_context: ${{KUBE_CONTEXT}} +# namespace: helm-${{HELM_VERSION_NORMALIZED}} +# skip_cf_stable_helm_repo: true +# credentials_in_arguments: true +# chart_repo_url: 'https://charts.helm.sh/stable' +# custom_values: +# - 'pat.arr="{one,two,three}"' +# - 'STR_WITH_COMAS="one\,two\,three"' +# - test_var=test_key +# when: +# steps: +# - name: prepare_namespaces +# on: +# - finished installing_chart: stage: deploy @@ -90,9 +103,9 @@ steps: image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' commands: - env | grep HE - - export TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - export TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] ; then return 1; fi - - export TOMCAT_RELEASES=$(kubectl get secret -n helm-deploy-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - export TOMCAT_RELEASES=$(kubectl get secret -n helm-deploy-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_RELEASES" ] || [ "$TOMCAT_RELEASES" = "null" ] ; then return 1; fi when: steps: @@ -132,9 +145,9 @@ steps: stage: deploy image: '${{STEP_IMAGE}}:${{HELM_VERSION}}' commands: - - export TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - export TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] ; then return 1; fi - - export TOMCAT_RELEASES=$(kubectl get secret -n helm-promo-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + - export TOMCAT_RELEASES=$(kubectl get secret -n helm-promo-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_RELEASES" ] || [ "$TOMCAT_RELEASES" = "null" ] ; then return 1; fi when: steps: @@ -152,17 +165,17 @@ steps: - | kubectl config use-context ${{KUBE_CONTEXT}} echo 'Running: helm delete tomcat' - TOMCAT_INSTALLED=$(kubectl get pods -n helm-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + TOMCAT_INSTALLED=$(kubectl get pods -n helm-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] helm delete tomcat --timeout 300s --namespace helm-${{HELM_VERSION_NORMALIZED}} kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} fi - TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] helm delete tomcat --timeout 300s --namespace helm-deploy-${{HELM_VERSION_NORMALIZED}} kubectl delete ns helm-deploy-${{HELM_VERSION_NORMALIZED}} fi - TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} | grep tomcat) + TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] helm delete tomcat --timeout 300s --namespace helm-promo-${{HELM_VERSION_NORMALIZED}} kubectl delete ns helm-promo-${{HELM_VERSION_NORMALIZED}} From e3260d87dd5df9f355da2400ae855c5adc1a121f Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 10:31:47 +0300 Subject: [PATCH 06/16] wip --- codefresh-e2e.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index 1d0198b..acc9dfa 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -183,12 +183,13 @@ steps: name: deleting_release_tomcat when: steps: - - name: auth - on: - - finished - - name: deploy - on: - - finished - name: check_promote_helm on: - finished +# - name: auth +# on: +# - finished +# - name: deploy +# on: +# - finished + From 4941add33b22f4cd23affffd2808db4ca86fddfd Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 10:36:47 +0300 Subject: [PATCH 07/16] wip --- codefresh-e2e.yml | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index acc9dfa..81b4308 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -32,7 +32,6 @@ steps: kubectl create ns helm-$HELM_VERSION_STR kubectl create ns helm-deploy-$HELM_VERSION_STR kubectl create ns helm-promo-$HELM_VERSION_STR - name: deleting_release_tomcat # auth: # stage: deploy @@ -162,25 +161,24 @@ steps: fail_fast: false working_directory: IMAGE_WORK_DIR commands: - - | - kubectl config use-context ${{KUBE_CONTEXT}} - echo 'Running: helm delete tomcat' - TOMCAT_INSTALLED=$(kubectl get pods -n helm-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] - helm delete tomcat --timeout 300s --namespace helm-${{HELM_VERSION_NORMALIZED}} - kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} - fi - TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] - helm delete tomcat --timeout 300s --namespace helm-deploy-${{HELM_VERSION_NORMALIZED}} - kubectl delete ns helm-deploy-${{HELM_VERSION_NORMALIZED}} - fi - TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) - if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] - helm delete tomcat --timeout 300s --namespace helm-promo-${{HELM_VERSION_NORMALIZED}} - kubectl delete ns helm-promo-${{HELM_VERSION_NORMALIZED}} - fi - name: deleting_release_tomcat + - | + kubectl config use-context ${{KUBE_CONTEXT}} + echo 'Running: helm delete tomcat' + TOMCAT_INSTALLED=$(kubectl get pods -n helm-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) + if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] + helm delete tomcat --timeout 300s --namespace helm-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + fi + TOMCAT_INSTALLED=$(kubectl get pods -n helm-deploy-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) + if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] + helm delete tomcat --timeout 300s --namespace helm-deploy-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-deploy-${{HELM_VERSION_NORMALIZED}} + fi + TOMCAT_INSTALLED=$(kubectl get pods -n helm-promo-${{HELM_VERSION_NORMALIZED}} --ignore-not-found | grep tomcat) + if [ -z "$TOMCAT_INSTALLED" ] || [ "$TOMCAT_INSTALLED" = "null" ] + helm delete tomcat --timeout 300s --namespace helm-promo-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-promo-${{HELM_VERSION_NORMALIZED}} + fi when: steps: - name: check_promote_helm From 29c96fa73f54e26f6acf4b3659a028d14f2d0a40 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 10:43:45 +0300 Subject: [PATCH 08/16] wip --- codefresh-e2e.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index 81b4308..f444b73 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -19,15 +19,15 @@ steps: kubectl config use-context ${{KUBE_CONTEXT}} NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] - kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-$HELM_VERSION_STR fi NS_EXIST=$(kubectl get ns helm-deploy-$HELM_VERSION_STR --ignore-not-found | grep helm) if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] - kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-deploy-$HELM_VERSION_STR fi NS_EXIST=$(kubectl get ns helm-promo-$HELM_VERSION_STR --ignore-not-found | grep helm) if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] - kubectl delete ns helm-${{HELM_VERSION_NORMALIZED}} + kubectl delete ns helm-promo-$HELM_VERSION_STR fi kubectl create ns helm-$HELM_VERSION_STR kubectl create ns helm-deploy-$HELM_VERSION_STR From 16b1e11a28c6d64af6b2c605cb686fabc8f5c2d5 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 10:56:16 +0300 Subject: [PATCH 09/16] wip --- codefresh-e2e.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index f444b73..c54187c 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -18,17 +18,26 @@ steps: cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) - if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] + if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] + echo "delete helm..." kubectl delete ns helm-$HELM_VERSION_STR + echo "deleted helm" fi + echo "helm-deploy" NS_EXIST=$(kubectl get ns helm-deploy-$HELM_VERSION_STR --ignore-not-found | grep helm) if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] - kubectl delete ns helm-deploy-$HELM_VERSION_STR + echo "delete helm-deploy..." + kubectl delete ns helm-deploy-$HELM_VERSION_STR + echo "deleted helm-deploy" fi + echo "helm-promo" NS_EXIST=$(kubectl get ns helm-promo-$HELM_VERSION_STR --ignore-not-found | grep helm) if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] - kubectl delete ns helm-promo-$HELM_VERSION_STR + echo "delete helm-promo..." + kubectl delete ns helm-promo-$HELM_VERSION_STR + echo "deleted helm-promo" fi + echo "create helm" kubectl create ns helm-$HELM_VERSION_STR kubectl create ns helm-deploy-$HELM_VERSION_STR kubectl create ns helm-promo-$HELM_VERSION_STR From ff61f7a3b64fcd249bcc567ad07359c5c962d175 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 10:57:39 +0300 Subject: [PATCH 10/16] wip --- codefresh-e2e.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index c54187c..e4bda04 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -17,7 +17,9 @@ steps: export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g") cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} + echo "helm" NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) + echo "$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] echo "delete helm..." kubectl delete ns helm-$HELM_VERSION_STR @@ -25,6 +27,7 @@ steps: fi echo "helm-deploy" NS_EXIST=$(kubectl get ns helm-deploy-$HELM_VERSION_STR --ignore-not-found | grep helm) + echo "$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] echo "delete helm-deploy..." kubectl delete ns helm-deploy-$HELM_VERSION_STR @@ -32,6 +35,7 @@ steps: fi echo "helm-promo" NS_EXIST=$(kubectl get ns helm-promo-$HELM_VERSION_STR --ignore-not-found | grep helm) + echo "$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] echo "delete helm-promo..." kubectl delete ns helm-promo-$HELM_VERSION_STR From 11a874b71139a5bbf4542c2aad9b5b8121ec4986 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 11:07:38 +0300 Subject: [PATCH 11/16] wip --- codefresh-e2e.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index e4bda04..6e31943 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -18,8 +18,10 @@ steps: cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} echo "helm" + kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found + kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) - echo "$NS_EXIST" + echo "fuck-$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] echo "delete helm..." kubectl delete ns helm-$HELM_VERSION_STR From 98a529f2b5ff5a5f64fdae8525d53e01c93255c0 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 11:26:22 +0300 Subject: [PATCH 12/16] wip --- codefresh-e2e.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index 6e31943..6dd1ffd 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -17,7 +17,7 @@ steps: export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g") cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} - echo "helm" + echo "helm-$HELM_VERSION_STR" kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) @@ -27,7 +27,7 @@ steps: kubectl delete ns helm-$HELM_VERSION_STR echo "deleted helm" fi - echo "helm-deploy" + echo "helm-deploy-$HELM_VERSION_STR" NS_EXIST=$(kubectl get ns helm-deploy-$HELM_VERSION_STR --ignore-not-found | grep helm) echo "$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] @@ -35,7 +35,7 @@ steps: kubectl delete ns helm-deploy-$HELM_VERSION_STR echo "deleted helm-deploy" fi - echo "helm-promo" + echo "helm-promo-$HELM_VERSION_STR" NS_EXIST=$(kubectl get ns helm-promo-$HELM_VERSION_STR --ignore-not-found | grep helm) echo "$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] From da849b657a3cd81ecadd6188e02110c01bacbe30 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 11:37:58 +0300 Subject: [PATCH 13/16] wip --- codefresh-e2e.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index 6dd1ffd..db2f15f 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -18,9 +18,8 @@ steps: cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} echo "helm-$HELM_VERSION_STR" - kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found - kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm - NS_EXIST=$(kubectl get ns helm-$HELM_VERSION_STR --ignore-not-found | grep helm) + kubectl get ns + NS_EXIST=$(kubectl get ns | grep helm-$HELM_VERSION_STR) echo "fuck-$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] echo "delete helm..." From 53f56a40e7b42bb86a31d5e637ea22584139ffa0 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 11:42:14 +0300 Subject: [PATCH 14/16] wip --- codefresh-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index db2f15f..35cd130 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -19,7 +19,7 @@ steps: kubectl config use-context ${{KUBE_CONTEXT}} echo "helm-$HELM_VERSION_STR" kubectl get ns - NS_EXIST=$(kubectl get ns | grep helm-$HELM_VERSION_STR) + NS_EXIST=$(kubectl get ns | grep "helm-$HELM_VERSION_STR") echo "fuck-$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] echo "delete helm..." From a8f487960062f3a17d459279aa587221ceaf540a Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 11:48:24 +0300 Subject: [PATCH 15/16] wip --- codefresh-e2e.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index 35cd130..5ed7cc1 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -17,8 +17,7 @@ steps: export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g") cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} - echo "helm-$HELM_VERSION_STR" - kubectl get ns + kubectl get ns | grep "helm-" NS_EXIST=$(kubectl get ns | grep "helm-$HELM_VERSION_STR") echo "fuck-$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] From cfbe3ecbfbb842d6053c5b3e393ecc933c6af9a3 Mon Sep 17 00:00:00 2001 From: Bohdan Pysarenko Date: Fri, 4 Aug 2023 12:35:55 +0300 Subject: [PATCH 16/16] wip --- codefresh-e2e.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codefresh-e2e.yml b/codefresh-e2e.yml index 5ed7cc1..a02dcc5 100644 --- a/codefresh-e2e.yml +++ b/codefresh-e2e.yml @@ -15,9 +15,8 @@ steps: commands: - | export HELM_VERSION_STR=$(echo "${{HELM_VERSION}}" | sed "s/\./-/g") - cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR kubectl config use-context ${{KUBE_CONTEXT}} - kubectl get ns | grep "helm-" + kubectl get ns | grep "helm-$HELM_VERSION_STR" NS_EXIST=$(kubectl get ns | grep "helm-$HELM_VERSION_STR") echo "fuck-$NS_EXIST" if [ -z "$NS_EXIST" ] || [ "$NS_EXIST" = "null" ] @@ -45,6 +44,7 @@ steps: kubectl create ns helm-$HELM_VERSION_STR kubectl create ns helm-deploy-$HELM_VERSION_STR kubectl create ns helm-promo-$HELM_VERSION_STR + cf_export HELM_VERSION_NORMALIZED=$HELM_VERSION_STR # auth: # stage: deploy