Skip to content

Commit

Permalink
CI: switch bosh-ci/bosh resource optionality
Browse files Browse the repository at this point in the history
BRATs specs only need one of these copies of the resource, prefer
`bosh-ci` since scripts only read test assets, not production code.

Update variable names in scripts for clarity.
  • Loading branch information
aramprice committed Dec 10, 2024
1 parent 57cd837 commit 3296b5c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions ci/shared/brats/test-acceptance.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -eu -o pipefail

bosh_repo_dir="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)")"
bosh_repo_parent_dir="$(realpath "${bosh_repo_dir}/..")"
bosh_ci_dir="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)")"
bosh_ci_parent_dir="$(realpath "${bosh_ci_dir}/..")"

OVERRIDDEN_BOSH_DEPLOYMENT="${bosh_repo_parent_dir}/bosh-deployment"
OVERRIDDEN_BOSH_DEPLOYMENT="${bosh_ci_parent_dir}/bosh-deployment"

if [[ -e "${OVERRIDDEN_BOSH_DEPLOYMENT}/bosh.yml" ]];then
BOSH_DEPLOYMENT_PATH=${OVERRIDDEN_BOSH_DEPLOYMENT}
Expand All @@ -14,7 +14,7 @@ fi
export BOSH_DEPLOYMENT_PATH

if [ ! -f /tmp/local-bosh/director/env ]; then
source "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/start-bosh.sh"
source "${bosh_ci_dir}/ci/dockerfiles/docker-cpi/start-bosh.sh"
fi
source /tmp/local-bosh/director/env

Expand All @@ -25,11 +25,11 @@ export BOSH_DIRECTOR_IP="10.245.0.3"

BOSH_BINARY_PATH=$(which bosh)
export BOSH_BINARY_PATH
export BOSH_RELEASE="${bosh_repo_dir}/src/spec/assets/dummy-release.tgz"
export BOSH_DIRECTOR_RELEASE_PATH="${bosh_repo_parent_dir}/bosh-release"
DNS_RELEASE_PATH="$(find "${bosh_repo_parent_dir}/bosh-dns-release" -maxdepth 1 -path '*.tgz')"
export BOSH_RELEASE="${bosh_ci_dir}/src/spec/assets/dummy-release.tgz"
export BOSH_DIRECTOR_RELEASE_PATH="${bosh_ci_parent_dir}/bosh-release"
DNS_RELEASE_PATH="$(find "${bosh_ci_parent_dir}/bosh-dns-release" -maxdepth 1 -path '*.tgz')"
export DNS_RELEASE_PATH
CANDIDATE_STEMCELL_TARBALL_PATH="$(find "${bosh_repo_parent_dir}/stemcell" -maxdepth 1 -path '*.tgz')"
CANDIDATE_STEMCELL_TARBALL_PATH="$(find "${bosh_ci_parent_dir}/stemcell" -maxdepth 1 -path '*.tgz')"
export CANDIDATE_STEMCELL_TARBALL_PATH
export BOSH_DNS_ADDON_OPS_FILE_PATH="${BOSH_DEPLOYMENT_PATH}/misc/dns-addon.yml"

Expand All @@ -42,7 +42,7 @@ export DOCKER_HOST

bosh -n update-cloud-config \
"${BOSH_DEPLOYMENT_PATH}/docker/cloud-config.yml" \
-o "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-o "${bosh_ci_dir}/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-v network=director_network

bosh -n upload-stemcell "${CANDIDATE_STEMCELL_TARBALL_PATH}"
Expand Down Expand Up @@ -73,7 +73,7 @@ if [ -d database-metadata ]; then
export GCP_POSTGRES_EXTERNAL_DB_CLIENT_PRIVATE_KEY
fi

brats_env_file="${bosh_repo_parent_dir}/brats-env.sh"
brats_env_file="${bosh_ci_parent_dir}/brats-env.sh"
{
echo "export OUTER_BOSH_ENV_PATH=\"${OUTER_BOSH_ENV_PATH}\""
echo "export DOCKER_CERTS=\"${DOCKER_CERTS}\""
Expand Down Expand Up @@ -112,7 +112,7 @@ brats_env_file="${bosh_repo_parent_dir}/brats-env.sh"
echo "# The required BRATS environment can be loaded by running the following:"
echo "# 'source ${brats_env_file}'"

pushd "${bosh_repo_dir}/src/brats/acceptance"
pushd "${bosh_ci_dir}/src/brats/acceptance"
go run github.com/onsi/ginkgo/v2/ginkgo \
-r -v --race --timeout=24h \
--randomize-suites --randomize-all \
Expand Down
2 changes: 1 addition & 1 deletion ci/shared/brats/test-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ image_resource:

inputs:
- name: bosh-ci
optional: true
- name: bosh
optional: true
- name: bosh-dns-release
- name: stemcell
- name: bosh-release
Expand Down
18 changes: 9 additions & 9 deletions ci/shared/brats/test-performance.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
set -eu -o pipefail

bosh_repo_dir="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)")"
bosh_repo_parent_dir="$(realpath "${bosh_repo_dir}/..")"
bosh_ci_dir="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)")"
bosh_ci_parent_dir="$(realpath "${bosh_ci_dir}/..")"

export BOSH_DEPLOYMENT_PATH="/usr/local/bosh-deployment"

source "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/start-bosh.sh"
source "${bosh_ci_dir}/ci/dockerfiles/docker-cpi/start-bosh.sh"
source /tmp/local-bosh/director/env

bosh int /tmp/local-bosh/director/creds.yml --path /jumpbox_ssh/private_key > /tmp/jumpbox_ssh_key.pem
Expand All @@ -16,11 +16,11 @@ export BOSH_DIRECTOR_IP="10.245.0.3"

BOSH_BINARY_PATH=$(which bosh)
export BOSH_BINARY_PATH
BOSH_DIRECTOR_TARBALL_PATH="$(find "${bosh_repo_parent_dir}/bosh-release" -maxdepth 1 -path '*.tgz')"
BOSH_DIRECTOR_TARBALL_PATH="$(find "${bosh_ci_parent_dir}/bosh-release" -maxdepth 1 -path '*.tgz')"
export BOSH_DIRECTOR_TARBALL_PATH
export BOSH_DIRECTOR_RELEASE_PATH="${bosh_repo_parent_dir}/bosh"
export CF_DEPLOYMENT_RELEASE_PATH="${bosh_repo_parent_dir}/cf-deployment"
CANDIDATE_STEMCELL_TARBALL_PATH="$(find "${bosh_repo_parent_dir}/stemcell" -maxdepth 1 -path '*.tgz')"
export BOSH_DIRECTOR_RELEASE_PATH="${bosh_ci_parent_dir}/bosh"
export CF_DEPLOYMENT_RELEASE_PATH="${bosh_ci_parent_dir}/cf-deployment"
CANDIDATE_STEMCELL_TARBALL_PATH="$(find "${bosh_ci_parent_dir}/stemcell" -maxdepth 1 -path '*.tgz')"
export CANDIDATE_STEMCELL_TARBALL_PATH
export STEMCELL_OS=ubuntu-jammy

Expand All @@ -31,7 +31,7 @@ export DOCKER_HOST

bosh -n update-cloud-config \
"${BOSH_DEPLOYMENT_PATH}/docker/cloud-config.yml" \
-o "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-o "${bosh_ci_dir}/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-v network=director_network

bosh -n upload-stemcell "${CANDIDATE_STEMCELL_TARBALL_PATH}"
Expand All @@ -41,7 +41,7 @@ bosh upload-release "$(bosh int ${BOSH_DEPLOYMENT_PATH}/docker/cpi.yml --path /n
bosh upload-release "$(bosh int ${BOSH_DEPLOYMENT_PATH}/jumpbox-user.yml --path /release=os-conf/value/url)" \
--sha1 "$(bosh int ${BOSH_DEPLOYMENT_PATH}/jumpbox-user.yml --path /release=os-conf/value/sha1)"

pushd "${bosh_repo_dir}/src/brats/performance"
pushd "${bosh_ci_dir}/src/brats/performance"
go run github.com/onsi/ginkgo/v2/ginkgo \
-r -v --race --timeout=24h \
--randomize-suites --randomize-all \
Expand Down
2 changes: 1 addition & 1 deletion ci/shared/brats/test-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ image_resource:

inputs:
- name: bosh-ci
optional: true
- name: bosh
optional: true
- name: stemcell
- name: bosh-release
- name: cf-deployment
Expand Down
4 changes: 2 additions & 2 deletions ci/shared/brats/test-utils.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -eu -o pipefail

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

pushd "${bosh_repo_dir}/src/brats/utils"
pushd "${bosh_ci_dir}/src/brats/utils"
go run github.com/onsi/ginkgo/v2/ginkgo \
-r -v --race --timeout=24h \
--randomize-suites --randomize-all \
Expand Down
2 changes: 1 addition & 1 deletion ci/shared/brats/test-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ image_resource:

inputs:
- name: bosh-ci
optional: true
- name: bosh
optional: true

params:
FOCUS_SPEC:
Expand Down

0 comments on commit 3296b5c

Please sign in to comment.