Skip to content

Instantly share code, notes, and snippets.

@weshayutin
Created January 13, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weshayutin/c77a2aa33c0d7a4c9b93481dc2f789f4 to your computer and use it in GitHub Desktop.
Save weshayutin/c77a2aa33c0d7a4c9b93481dc2f789f4 to your computer and use it in GitHub Desktop.
sample script for promoting component/$name/consistent/delorean.repo to tripleo-ci-testing
#
set -e
source promoter_venv/bin/activate
source dlrnapi_secret
# Setup virtualenv for dlrnapi
: ${DLRNAPI_USERNAME:="ciuser"}
#: ${PROMOTE_TO:="${promotion_symlink}"}
: ${PROMOTE_TO:="tripleo-ci-testing"}
: ${DLRNAPI_URL:="https://trunk.rdoproject.org/api-centos8-master-uc"}
echo $DLRNAPI_USERNAME
echo $PROMOTE_TO
echo $DLRNAPI_URL
export delorean_components_url="https://trunk.rdoproject.org/centos8-master/component"
export source_name="consistent"
export delorean_components="baremetal cinder clients cloudops common compute glance manila network octavia security swift tempest tripleo ui"
echo ${delorean_components}
for component in $delorean_components; do
curl -sLo commit.yaml $delorean_components_url/${component}/${source_name}/commit.yaml
COMMIT_HASH=$(shyaml get-value commits.0.commit_hash < ./commit.yaml)
DISTRO_HASH=$(shyaml get-value commits.0.distro_hash < ./commit.yaml)
echo $component
echo $COMMIT_HASH
echo $DISTRO_HASH
# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
--username $DLRNAPI_USERNAME \
repo-promote \
--commit-hash $COMMIT_HASH \
--distro-hash $DISTRO_HASH \
--promote-name $PROMOTE_TO
done
on promoter server
promote-repo-dlrnapi.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment