Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #62 from cevich/f34_and_get_ci_vm
Browse files Browse the repository at this point in the history
Update to F34beta + Implement new get_ci_vm.sh
  • Loading branch information
openshift-merge-robot authored Apr 15, 2021
2 parents 0d666cf + c8424c8 commit 3d464ba
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 227 deletions.
15 changes: 5 additions & 10 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
env:
DEST_BRANCH: "master"
GOPATH: "/var/tmp/go"
CIRRUS_WORKING_DIR: "${GOPATH}/src/github.com/containers/oci-seccomp-bpf-hook"
CIRRUS_WORKING_DIR: "${GOPATH}/src/github.com/containers/dnsname"
GOSRC: "$CIRRUS_WORKING_DIR"
SCRIPT_BASE: "./contrib/cirrus"
CIRRUS_SHELL: "/bin/bash"
IMAGE_PROJECT: "libpod-218412"
HOME: "/root" # not set by default
GOCACHE: "${HOME}/.cache/go-build"

# Make names more readable in github/cirrus-ci
FEDORA_NAME: "fedora-33"
FEDORA_NAME: "fedora-34beta"
UBUNTU_NAME: "ubuntu-2010"

# VM Images are maintained in the automation_images repo.
_BUILT_IMAGE_SUFFIX: "c6233039174893568"
_BUILT_IMAGE_SUFFIX: "c5032481331085312"
FEDORA_CACHE_IMAGE_NAME: "fedora-${_BUILT_IMAGE_SUFFIX}"
UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${_BUILT_IMAGE_SUFFIX}"

Expand Down Expand Up @@ -64,10 +63,8 @@ meta_task:

validate_task:

env:
PATH: "$PATH:/var/tmp/go/bin"

validate_script:
- export PATH="$PATH:$GOPATH/bin"
- make validate
- make vendor
- ./hack/tree_status.sh
Expand All @@ -88,9 +85,7 @@ test_task:
gce_instance:
image_name: ${UBUNTU_CACHE_IMAGE_NAME}

env:
PATH: "$PATH:/var/tmp/go/bin"

test_script:
- export PATH="$PATH:$GOPATH/bin"
- make
- make test
217 changes: 0 additions & 217 deletions ci/get_vm.sh

This file was deleted.

62 changes: 62 additions & 0 deletions hack/get_ci_vm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash

#
# For help and usage information, simply execute the script w/o any arguments.
#
# This script is intended to be run by Red Hat dnsname developers who need
# to debug problems specifically related to Cirrus-CI automated testing.
# It requires that you have been granted prior access to create VMs in
# google-cloud. For non-Red Hat contributors, VMs are available as-needed,
# with supervision upon request.

set -e

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
GET_CI_VM="${GET_CI_VM:-0}"
in_get_ci_vm() {
if ((GET_CI_VM==0)); then
echo "Error: $1 is not intended for use in this context"
exit 2
fi
}

# 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
DESTDIR="/var/tmp/go/src/github.com/containers/dnsname"
UPSTREAM_REPO="https://github.com/containers/dnsname.git"
CI_ENVFILE="/etc/ci_environment"
GCLOUD_PROJECT="dnsname-8675309"
GCLOUD_IMGPROJECT="libpod-218412"
GCLOUD_CFG="dnsname"
GCLOUD_ZONE="${GCLOUD_ZONE:-us-central1-c}"
GCLOUD_CPUS="2"
GCLOUD_MEMORY="4Gb"
GCLOUD_DISK="200"
EOF
elif [[ "$1" == "--setup" ]]; then
in_get_ci_vm "$1"
# get_ci_vm container entrypoint calls us with this option on the
# Cirrus-CI environment instance, to perform repo.-specific setup.
echo "+ Setting up environment" > /dev/stderr
echo 'PATH=$PATH:$GOPATH/bin' > /etc/ci_environment
else
# Create and access VM for specified Cirrus-CI task
mkdir -p $HOME/.config/gcloud/ssh
podman run -it --rm \
--tz=local \
-e NAME="$USER" \
-e SRCDIR=/src \
-e GCLOUD_ZONE="$GCLOUD_ZONE" \
-e DEBUG="${DEBUG:-0}" \
-v $REPO_DIRPATH:/src:O \
-v $HOME/.config/gcloud:/root/.config/gcloud:z \
-v $HOME/.config/gcloud/ssh:/root/.ssh:z \
quay.io/libpod/get_ci_vm:latest "$@"
fi

0 comments on commit 3d464ba

Please sign in to comment.