Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tasks/update-stemcell-ops/task
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ function update_stemcell_opsfile() {
local stemcell_version
stemcell_version=$(cat stemcell/version)

local stemcell_ops_path="${STEMCELL_OPS_PATH:-/stemcells/-}"

local stemcell_alias
stemcell_alias="$(bosh int "ops-files/${ORIGINAL_OPS_FILE_PATH}" --path=/path=~1stemcells~1-/value/alias)"
stemcell_alias="$(bosh int "ops-files/${ORIGINAL_OPS_FILE_PATH}" --path=/path=${stemcell_ops_path//\//~1}/value/alias)"

update_stemcell_ops_file=$(mktemp)
(
cat << EOF
---
- type: replace
path: /path=~1stemcells~1-
path: /path=${stemcell_ops_path//\//~1}
value:
type: replace
path: /stemcells/-
path: ${stemcell_ops_path}
value:
alias: "${stemcell_alias}"
os: "${STEMCELL_STACK}"
Expand All @@ -31,8 +33,10 @@ EOF
}

function generate_commit_message() {
local stemcell_ops_path="${STEMCELL_OPS_PATH:-/stemcells/-}"

local current_stemcell_version
current_stemcell_version="$(bosh interpolate "ops-files/${ORIGINAL_OPS_FILE_PATH}" --path=/path=~1stemcells~1-/value/version)"
current_stemcell_version="$(bosh interpolate "ops-files/${ORIGINAL_OPS_FILE_PATH}" --path=/path=${stemcell_ops_path//\//~1}/value/version)"

local stemcell_version
stemcell_version=$(cat stemcell/version)
Expand Down