diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 77092642..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 @@ -449,6 +467,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 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