-
-
Save miabbott/a7f1663000e7646ddbb581de8e579a64 to your computer and use it in GitHub Desktop.
Setup an Atomic CLI test environment
This file contains hidden or 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
| #/bin/bash | |
| # Allows user to setup a fresh atomic CLI environment on an atomic | |
| # or cloud system. | |
| # Usage: | |
| # Pull projectatomic/atomic master and install it | |
| # $ sh setup_atomic_cli.sh | |
| # Pull a user's branch | |
| # $ BRANCH=<branch> GIT_USER=<user> sh setup_atomic_cli.sh | |
| fail () { | |
| echo "Failed ...." | |
| } | |
| BRANCH=${BRANCH:-master} | |
| GIT_USER=${GIT_USER:-} | |
| which docker | |
| HAS_DOCKER=($?) | |
| trap fail EXIT | |
| if [ ${HAS_DOCKER} == 1 ]; then | |
| if [ -z ${GIT_USER} ]; then | |
| URL="https://codeload.github.com/projectatomic/atomic/legacy.tar.gz/${BRANCH}" | |
| else | |
| URL="https://codeload.github.com/$GIT_USER/atomic/legacy.tar.gz/${BRANCH}" | |
| fi | |
| curl ${URL} | tar xz | |
| if [ -z ${GIT_USER} ]; then | |
| cd projectatomic-atomic* | |
| else | |
| cd $GIT_USER-atomic-* | |
| fi | |
| else | |
| sudo docker pull docker.io/projectatomic/atomic-tester | |
| DOCKER_RUN="docker run --rm \ | |
| --privileged \ | |
| -v $PWD:/code \ | |
| -v /:/host \ | |
| --workdir /code \ | |
| projectatomic/atomic-tester" | |
| if [ -z ${GIT_USER} ]; then | |
| URL="https://github.com/projectatomic/atomic" | |
| else | |
| URL="https://github.com/$GIT_USER/atomic" | |
| fi | |
| sudo $DOCKER_RUN git clone -b ${BRANCH} ${URL} | |
| cd atomic | |
| fi | |
| sudo NO_TEST=1 sh .redhat-ci.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment