Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
dry-run-acceptance-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- uses: actions/setup-go@v6
with:
go-version-file: acceptance-tests/go.mod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
unit_specs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with: { lfs: true }
- uses: ruby/setup-ruby@v1
- name: test-bosh-stemcell
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Create a `stemcell-builder-integration-${subnet_int}` subnetworks need by BATs t
Each stemcell line should get its own subnet corresponding to its `subnet_int` equal to
the two digit release year. For example release year 2010 would have `subnet_int="10"`.

Example per [ci/pipelines/vars.yml](ci/pipelines/vars.yml):
Example per [ci/pipeline-vars.yml](ci/pipeline-vars.yml):

```yaml
---
Expand Down
58 changes: 16 additions & 42 deletions ci/configure.sh
Original file line number Diff line number Diff line change
@@ -1,61 +1,35 @@
#!/usr/bin/env bash
set -eu -o pipefail

STEMCELL_LINE="ubuntu-noble"

REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

if [[ -n "${DEBUG:-}" ]]; then
set -x
fi

fly="${FLY_CLI:-fly}"
REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

STEMCELL_LINE="ubuntu-noble"

pipelines_dir="${REPO_ROOT}/ci"
pipeline_name="${STEMCELL_LINE}"
pipeline_template="pipeline-template.yml"
pipeline_vars="pipeline-vars.yml"

concourse_target="${CONCOURSE_TARGET:-stemcell}"
fly="${FLY_CLI:-fly}"

until "${fly}" -t "${concourse_target}" status; do
"${fly}" -t "${concourse_target}" login
sleep 1
done

pipelines_dir="${REPO_ROOT}/ci/pipelines"
vars_file_name="vars.yml"

mapfile -t available_pipelines < \
<( find "${pipelines_dir}" -maxdepth 1 -type f -name '*.yml' | grep -v "${vars_file_name}" | sort )

if (( ${#available_pipelines[@]} == 0 )); then
echo "No pipelines found under '${pipelines_dir}'" >&2
exit 1
fi

i=1
echo "Choose a pipeline to configure:"
for pipeline in "${available_pipelines[@]}"; do
pipeline_choice_label=$(echo "${pipeline#"${pipelines_dir}/"}" | cut -d/ -f 1)
printf "%4s. %s\n" "${i}" "${pipeline_choice_label}"
i=$((i + 1))
done
read -rp "pipeline: " pipeline_index
echo "Rendering..."
rendered_template="$(ytt -f "${pipelines_dir}/${pipeline_template}" -f "${pipelines_dir}/${pipeline_vars}")"
echo ""

if ! [[ "${pipeline_index}" =~ ^[0-9]+$ ]] || (( pipeline_index < 1 || pipeline_index > ${#available_pipelines[@]} )); then
echo "Invalid selection: '${pipeline_index}'" >&2
exit 1
fi

pipeline_file=${available_pipelines[(pipeline_index-1)]}
if [ ! -f "${pipeline_file}" ]; then
echo "No pipeline found: '${pipeline_file}'" >&2
exit 1
fi

pipeline_name=$(basename "${pipeline_file%".yml"}")

echo "Configuring '${pipeline_name}' using '${pipeline_file#"${pipelines_dir}/"}'..."
echo "Validating..."
fly validate-pipeline --strict --config <(echo "${rendered_template}")
echo ""

rendered_template="$(ytt -f "${pipeline_file}" -f "${pipelines_dir}/${vars_file_name}")"

"${fly}" -t "${concourse_target}" set-pipeline \
-p "${STEMCELL_LINE}-${pipeline_name}" \
echo "Configuring..."
"${fly}" -t "${concourse_target}" set-pipeline -p "${pipeline_name}" \
-c <(echo "${rendered_template}")
Loading
Loading