From 54635d0220f01e5b121236a393a4dffad49cf3e3 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Mon, 10 Jun 2024 13:44:42 +0000 Subject: [PATCH 1/3] chore(ci): inject credhub and bosh authen --- ci/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 77092642..8fe79d0b 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -449,6 +449,7 @@ jobs: params: PREREQS_PATHS_RAW: "./prereqs/*.yml" COA_LOG_PATH: "../../../../coa-logs" + <<: *integration_tests_setup_pre_requisites_task_config_params on_failure: task: dump-coa-log-file image: cf-ops-automation-docker-image-develop From 40c7dcd056ed44c7902a51a0423f18d8177320ec Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Mon, 10 Jun 2024 13:46:25 +0000 Subject: [PATCH 2/3] chore(ci): allow silent failure on pipeline destroy during tests --- lib/coa/utils/concourse/fly.rb | 8 ++++---- lib/coa/utils/concourse/pipeline.rb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/coa/utils/concourse/fly.rb b/lib/coa/utils/concourse/fly.rb index 41dee369..4d99f0a9 100644 --- a/lib/coa/utils/concourse/fly.rb +++ b/lib/coa/utils/concourse/fly.rb @@ -10,8 +10,8 @@ def initialize(target:, creds:, team: 'main') self.class.login(target: target, creds: creds, team: team) end - def destroy_pipeline(pipeline) - run "destroy-pipeline --pipeline #{pipeline} --non-interactive" + def destroy_pipeline(pipeline, options = {}) + run "destroy-pipeline --pipeline #{pipeline} --non-interactive", options end def unpause_pipeline(pipeline) @@ -69,9 +69,9 @@ def secure_ca_cert_option(ca_cert) private - def run(command) + def run(command, options = {}) Coa::Utils::CommandRunner. - new("fly --target #{@target} #{command}"). + new("fly --target #{@target} #{command}", options). execute end end diff --git a/lib/coa/utils/concourse/pipeline.rb b/lib/coa/utils/concourse/pipeline.rb index ca52d791..eb220cb6 100644 --- a/lib/coa/utils/concourse/pipeline.rb +++ b/lib/coa/utils/concourse/pipeline.rb @@ -35,8 +35,8 @@ def set(options) fly.set_pipeline(name, options) end - def destroy - fly.destroy_pipeline(name) + def destroy(options) + fly.destroy_pipeline(name, options) end def trigger_and_watch_jobs @@ -60,7 +60,7 @@ def unpause_and_watch(pipeline_list, concourse) def destroy(pipeline_list, concourse) pipeline_list.each do |name, attributes| pipeline = new_from_hash(name: name, attributes: attributes, concourse: concourse) - pipeline.destroy + pipeline.destroy(fail_silently: true) end end From 5347c7a59e2fafb672765e958de204fb5d0fac2d Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Mon, 10 Jun 2024 14:00:19 +0000 Subject: [PATCH 3/3] chore(ci): comment git repo reset As we disabled global_resources at concourse level, we do not need this for now. --- ci/pipeline.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 8fe79d0b..43619087 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -440,6 +440,24 @@ jobs: echo "removing 'url.https://.insteadof' properties" git config --unset url.https://.insteadof cd .. +# git_server_ip=$(bosh vms -d git-server --json|jq -r .Tables[].Rows[].ips) +# mkdir empty-repo +# cd empty-repo +# git config --global user.email "coa-ci-bot@no-reply.orange.com" +# git config --global user.name "COA CI upload pipelines" +# touch reset-repo.marker +# git init . +# git add reset-repo.marker +# git commit -m"Integration Tests: reset git repo status by upload-pipelines" +# remotes=$(bosh interpolate --path /git_server_manifest/instance_groups/name=git-server/jobs/name=git-server/properties/repositories ../cf-ops-automation/ci/bootstrap_coa_env/git-server-manifest-prereqs.yml|cut -d' ' -f2) +# echo "Detected remotes repositories: " +# echo $remotes +# for r in $remotes;do +# echo "Resetting $r" +# git remote add "$r" git://$git_server_ip/$r +# git push -f "$r" master +# done +# cd .. ruby ./cf-ops-automation/scripts/run_integration_tests.rb status=$? if [ -f ./coa-logs/stdout.log ];then