From 20f9e5e8792942d106a6e51b40e1e2b559a7915b Mon Sep 17 00:00:00 2001 From: Alexey Gutkin Date: Mon, 30 Oct 2023 13:09:56 +0100 Subject: [PATCH 1/2] migration-to-gitops-repo --- .circleci/config.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 834b9f8..c25b145 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,16 +106,12 @@ jobs: - *load_version - *install_deps - run: git config --global user.email "sonario@rookout.com" && git config --global user.name "sonariorobot" - - run: git clone -b staging git@github.com:Rookout/gitops-demo.git - - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq -i -v '.tutorialPython.image.tag = strenv(PUBLISH_VERSION)' gitops-demo/argocd/apps/values.yaml - - run: cd gitops-demo && git add argocd/apps/values.yaml - - run: cd gitops-demo && git commit -m "update tutorial-python $NEW_VERSION" - - run: cd gitops-demo && git push https://sonariorobot:$GITHUB_TOKEN@github.com/Rookout/gitops-demo.git staging - - run: cd gitops-demo && git checkout production && git pull - - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq -i -v '.tutorialPython.image.tag = strenv(PUBLISH_VERSION)' gitops-demo/argocd/apps/values.yaml - - run: cd gitops-demo && git add argocd/apps/values.yaml - - run: cd gitops-demo && git commit -m "update tutorial-python $NEW_VERSION" - - run: cd gitops-demo && git push https://sonariorobot:$GITHUB_TOKEN@github.com/Rookout/gitops-demo.git production + - run: git clone git@github.com:Rookout/gitops.git + - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq eval -i -v '.apps[] |= select(.chart.name == "tutorial-python").helmValues.image.tag = strenv(PUBLISH_VERSION)' apps/demo/staging/apps.yaml + - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq eval -i -v '.apps[] |= select(.chart.name == "tutorial-python").helmValues.image.tag = strenv(PUBLISH_VERSION)' apps/demo/production/apps.yaml + - run: cd gitops && git add apps/demo/staging/apps.yaml apps/demo/production/apps.yaml + - run: cd gitops && git commit -m "update tutorial-python $NEW_VERSION" + - run: cd gitops && git push https://sonariorobot:$GITHUB_TOKEN@github.com/Rookout/gitops.git test_demo_servers_up: docker: From ca6c9b48fc3f038e61665f9601780bfa2b668aa6 Mon Sep 17 00:00:00 2001 From: Alexey Gutkin Date: Tue, 31 Oct 2023 12:56:19 +0100 Subject: [PATCH 2/2] fix-path --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c25b145..866bdab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,8 +107,8 @@ jobs: - *install_deps - run: git config --global user.email "sonario@rookout.com" && git config --global user.name "sonariorobot" - run: git clone git@github.com:Rookout/gitops.git - - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq eval -i -v '.apps[] |= select(.chart.name == "tutorial-python").helmValues.image.tag = strenv(PUBLISH_VERSION)' apps/demo/staging/apps.yaml - - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq eval -i -v '.apps[] |= select(.chart.name == "tutorial-python").helmValues.image.tag = strenv(PUBLISH_VERSION)' apps/demo/production/apps.yaml + - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq eval -i -v '.apps[] |= select(.chart.name == "tutorial-python").helmValues.image.tag = strenv(PUBLISH_VERSION)' gitops/apps/demo/staging/apps.yaml + - run: PUBLISH_VERSION=$(echo $NEW_VERSION | sed 's/inner-999/1/g') yq eval -i -v '.apps[] |= select(.chart.name == "tutorial-python").helmValues.image.tag = strenv(PUBLISH_VERSION)' gitops/apps/demo/production/apps.yaml - run: cd gitops && git add apps/demo/staging/apps.yaml apps/demo/production/apps.yaml - run: cd gitops && git commit -m "update tutorial-python $NEW_VERSION" - run: cd gitops && git push https://sonariorobot:$GITHUB_TOKEN@github.com/Rookout/gitops.git