aboutsummaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-08-04 11:02:00 +0000
committerGitHub <noreply@github.com>2022-08-04 11:02:00 +0000
commitccbb8e7444423306691f8ec441ed09387718d6e5 (patch)
treebbded6783f8f25a638802fbecc3317319fe220a5 /hack
parent1638218d1bc1c5dee315bc5e2d8e5da2202e5def (diff)
parent1e4a141d881696948db52de5801d8ea64079ac0c (diff)
downloadpodman-ccbb8e7444423306691f8ec441ed09387718d6e5.tar.gz
podman-ccbb8e7444423306691f8ec441ed09387718d6e5.tar.bz2
podman-ccbb8e7444423306691f8ec441ed09387718d6e5.zip
Merge pull request #15145 from cevich/ec2_get_ci_vm
[CI:DOCS] Cirrus: Support EC2 instances in hack/get_ci_vm.sh
Diffstat (limited to 'hack')
-rwxr-xr-xhack/get_ci_vm.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/hack/get_ci_vm.sh b/hack/get_ci_vm.sh
index 6632a0178..bdd947bba 100755
--- a/hack/get_ci_vm.sh
+++ b/hack/get_ci_vm.sh
@@ -15,7 +15,7 @@ SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}")
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")
-# Help detect if we were called by get_ci_vm container
+# Help detect what get_ci_vm container called this script
GET_CI_VM="${GET_CI_VM:-0}"
in_get_ci_vm() {
if ((GET_CI_VM==0)); then
@@ -27,8 +27,10 @@ in_get_ci_vm() {
# get_ci_vm APIv1 container entrypoint calls into this script
# to obtain required repo. specific configuration options.
if [[ "$1" == "--config" ]]; then
- in_get_ci_vm "$1"
- cat <<EOF
+ in_get_ci_vm "$1" # handles GET_CI_VM==0 case
+ case "$GET_CI_VM" in
+ 1)
+ cat <<EOF
DESTDIR="/var/tmp/go/src/github.com/containers/podman"
UPSTREAM_REPO="https://github.com/containers/podman.git"
CI_ENVFILE="/etc/ci_environment"
@@ -40,8 +42,18 @@ GCLOUD_CPUS="2"
GCLOUD_MEMORY="4Gb"
GCLOUD_DISK="200"
EOF
+ ;;
+ 2)
+ # get_ci_vm APIv2 configuration details
+ echo "AWS_PROFILE=containers"
+ ;;
+ *)
+ echo "Error: Your get_ci_vm container image is too old."
+ ;;
+ esac
elif [[ "$1" == "--setup" ]]; then
in_get_ci_vm "$1"
+ unset GET_CI_VM
# get_ci_vm container entrypoint calls us with this option on the
# Cirrus-CI environment instance, to perform repo.-specific setup.
cd $REPO_DIRPATH
@@ -54,8 +66,9 @@ elif [[ "$1" == "--setup" ]]; then
echo "+ Running environment setup" > /dev/stderr
./contrib/cirrus/setup_environment.sh
else
- # Create and access VM for specified Cirrus-CI task
+ # Pass this repo and CLI args into container for VM creation/management
mkdir -p $HOME/.config/gcloud/ssh
+ mkdir -p $HOME/.aws
podman run -it --rm \
--tz=local \
-e NAME="$USER" \
@@ -65,5 +78,6 @@ else
-v $REPO_DIRPATH:/src:O \
-v $HOME/.config/gcloud:/root/.config/gcloud:z \
-v $HOME/.config/gcloud/ssh:/root/.ssh:z \
+ -v $HOME/.aws:/root/.aws:z \
quay.io/libpod/get_ci_vm:latest "$@"
fi