-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update cirrus-ci_artifacts to use download API
In the future, task artifacts may not all come from the same cloud. Instead of downloading directly from a GCS bucket, use the Cirrus-CI REST API to download artifacts. Also update the tests and documentation. Signed-off-by: Chris Evich <[email protected]>
- Loading branch information
Showing
8 changed files
with
351 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
# Installs cirrus-ci_artifacts and a python virtual environment | ||
# to execute with. NOT intended to be used directly | ||
# by humans, should only be used indirectly by running | ||
# ../bin/install_automation.sh <ver> cirrus-ci_artifacts | ||
|
||
source "$AUTOMATION_LIB_PATH/anchors.sh" | ||
source "$AUTOMATION_LIB_PATH/console_output.sh" | ||
|
||
INSTALL_PREFIX=$(realpath $AUTOMATION_LIB_PATH/../) | ||
# Assume the directory this script is in, represents what is being installed | ||
INSTALL_NAME=$(basename $(dirname ${BASH_SOURCE[0]})) | ||
AUTOMATION_VERSION=$(automation_version) | ||
[[ -n "$AUTOMATION_VERSION" ]] || \ | ||
die "Could not determine version of common automation libs, was 'install_automation.sh' successful?" | ||
|
||
[[ -n "$(type -P virtualenv)" ]] || \ | ||
die "$INSTALL_NAME requires python3-virtualenv" | ||
|
||
echo "Installing $INSTALL_NAME version $(automation_version) into $INSTALL_PREFIX" | ||
|
||
unset INST_PERM_ARG | ||
if [[ $UID -eq 0 ]]; then | ||
INST_PERM_ARG="-o root -g root" | ||
fi | ||
|
||
cd $(dirname $(realpath "${BASH_SOURCE[0]}")) | ||
virtualenv --quiet --clear --download --activators bash \ | ||
$AUTOMATION_LIB_PATH/ccia.venv | ||
( | ||
source $AUTOMATION_LIB_PATH/ccia.venv/bin/activate | ||
pip3 install --quiet --requirement ./requirements.txt | ||
deactivate | ||
) | ||
install -v $INST_PERM_ARG -m '0644' -D -t "$INSTALL_PREFIX/lib/ccia.venv/bin" \ | ||
./cirrus-ci_artifacts.py | ||
install -v $INST_PERM_ARG -D -t "$INSTALL_PREFIX/bin" ./cirrus-ci_artifacts | ||
|
||
# Needed for installer testing | ||
echo "Successfully installed $INSTALL_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# This script wrapps cirrus-ci_artifacts.sh inside a python | ||
# virtual environment setup at install time. It should not | ||
# be executed prior to installation. | ||
|
||
set -e | ||
|
||
# This is a convenience for callers that don't separately source this first | ||
# in their automation setup. | ||
if [[ -z "$AUTOMATION_LIB_PATH" ]] && [[ -r /etc/automation_environment ]]; then | ||
source /etc/automation_environment | ||
fi | ||
|
||
if [[ -z "$AUTOMATION_LIB_PATH" ]]; then | ||
( | ||
echo "ERROR: Expecting \$AUTOMATION_LIB_PATH to be defined with the" | ||
echo " installation directory of automation tooling." | ||
) > /dev/stderr | ||
exit 1 | ||
fi | ||
|
||
source $AUTOMATION_LIB_PATH/ccia.venv/bin/activate | ||
python3 $AUTOMATION_LIB_PATH/ccia.venv/bin/cirrus-ci_artifacts.py "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.