Skip to content

Commit

Permalink
feature(easily-identify-precompile-deployments): restore this feature
Browse files Browse the repository at this point in the history
It seems that we lost this improvement when we introduced the "shared" pipeline support. Hence, we are renaming, again, the BOSH deployment that is used by precompile to ensure easy identification.
  • Loading branch information
o-orand committed Aug 9, 2023
1 parent 5f7232d commit 6f043c3
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 144 deletions.
17 changes: 8 additions & 9 deletions concourse/pipelines/template/bosh-precompile-pipeline.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ resources:
<% end %>
<% uniq_releases.sort.each do |release, info| %>
- name: <%= release %>-deployment
- name: precompile-<%= release %>-deployment
icon: cube-send
type: bosh-deployment-v2
source:
target: ((bosh-target))
client: ((bosh-username))
client_secret: "((bosh-password))"
deployment: <%= release %>-deployment
deployment: precompile-<%= release %>-deployment
ca_cert: <%= bosh_cert[root_deployment_name]&.dump %>

- name: <%= release %>
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:
attempts: <%= concourse_retry[:pull] %>
- task: generate-<%= release %>-deployment-manifest
<%
manifest = {'name' => "#{release}-deployment", 'instance_groups' => [], 'update' => { 'canaries' => 1, 'max_in_flight' => 1, 'canary_watch_time' => '1000-90000', 'update_watch_time' => '1000-90000' }, 'releases' => [] }
manifest = {'name' => "precompile-#{release}-deployment", 'instance_groups' => [], 'update' => { 'canaries' => 1, 'max_in_flight' => 1, 'canary_watch_time' => '1000-90000', 'update_watch_time' => '1000-90000' }, 'releases' => [] }
manifest['releases'] << {'name' => release, 'version' => info.fetch('version', 'latest')}

precompile_manifest = manifest
Expand Down Expand Up @@ -468,7 +468,7 @@ jobs:
ruby -ryaml -e 'ruby_manifest=eval(ENV["MANIFEST_CONTENT"]); ruby_manifest["stemcells"] = [ "alias" => "default", "os" => ENV["STEMCELL_OS"], "version" => "latest"];File.open(File.join("generated-files", ENV["MANIFEST_NAME"]), "w") { |file| file.write(ruby_manifest.to_yaml) }'
cat generated-files/${MANIFEST_NAME}
params:
MANIFEST_NAME: "<%= release %>-deployment.yml"
MANIFEST_NAME: "precompile-<%= release %>-deployment.yml"
MANIFEST_CONTENT: '<%= precompile_manifest %>'
- try:
# this step may fail when boshrelease have been already uploaded to director with another sha1. Indeed, everytime we repackage a bosh release a new sha1 is produced
Expand Down Expand Up @@ -499,10 +499,10 @@ jobs:
BOSH_ENVIRONMENT: ((bosh-target))
BOSH_CA_CERT: config-resource/<%= SharedPipelineGenerator::BOSH_CERT_LOCATIONS[root_deployment_name] %>

- put: <%= release %>-deployment
- put: precompile-<%= release %>-deployment
attempts: <%= concourse_retry[:bosh_push] %>
params:
manifest: final-release-manifest/<%= release %>-deployment.yml
manifest: final-release-manifest/precompile-<%= release %>-deployment.yml
cleanup: true

- task: compile-and-export-<%= release %>
Expand Down Expand Up @@ -548,7 +548,7 @@ jobs:
echo "COA - Bosh export-release successful"
fi
params:
BOSH_DEPLOYMENT: <%= release %>-deployment
BOSH_DEPLOYMENT: precompile-<%= release %>-deployment
BOSH_ENVIRONMENT: ((bosh-target))
BOSH_CLIENT: ((bosh-username))
BOSH_CLIENT_SECRET: "((bosh-password))"
Expand Down Expand Up @@ -591,9 +591,8 @@ jobs:
file: compiled-<%= release %>/*.tgz
acl: public-read
<% end %>
- put: <%= release %>-deployment
- put: precompile-<%= release %>-deployment
params:
manifest: final-release-manifest/<%= release %>-deployment.yml.yml
delete:
enabled: true
force: true
Expand Down
Loading

0 comments on commit 6f043c3

Please sign in to comment.