diff --git a/bin/_registries.lib b/bin/_registries.lib new file mode 100644 index 0000000..9d3923d --- /dev/null +++ b/bin/_registries.lib @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# -*- mode: sh; indent-tabs-mode: nil; sh-basic-offset: 4 -*- +# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=bash + +# create a registries.json +function create_registries_json() { + local CONTROLLER_IMAGE + CONTROLLER_IMAGE=$1 + local ENGINES_REPO + ENGINES_REPO=$2 + local ENGINES_REPO_AUTH_TOKEN + ENGINES_REPO_AUTH_TOKEN=$3 + local ENGINES_REPO_TLS_VERIFY + ENGINES_REPO_TLS_VERIFY=$4 + + if [ -z "${REGISTRIES_CFG}" ]; then + exit_error "ERROR: \%REGISTRIES_CFG must be defined when calling $0" + fi + + # create an empty JSON file that jq will be able to add to + echo "{}" > ${REGISTRIES_CFG} + + # populate the new JSON file with the information from + # /etc/sysconfig/crucible + CONTROLLER_URL=$(echo ${CONTROLLER_IMAGE} | awk -F: '{ print $1 }') + CONTROLLER_TAG=$(echo ${CONTROLLER_IMAGE} | awk -F: '{ print $2 }') + jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-controller" \ + --arg CONTROLLER_URL "${CONTROLLER_URL}" \ + --arg CONTROLLER_TAG "${CONTROLLER_TAG}" \ + '. += { "controller": { "url": $CONTROLLER_URL, "tag": $CONTROLLER_TAG } }' + + jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-public" \ + --arg ENGINES_PUBLIC_URL "${ENGINES_REPO}" \ + '. += { "engines": { "public": { "url": $ENGINES_PUBLIC_URL } } }' + + if [ -n "${ENGINES_REPO_AUTH_TOKEN}" ]; then + jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-public-push-token" \ + --arg ENGINES_PUBLIC_PUSH_TOKEN "${ENGINES_REPO_AUTH_TOKEN}" \ + '.engines.public += { "push-token": $ENGINES_PUBLIC_PUSH_TOKEN }' + fi + + if [ -n "${ENGINES_REPO_TLS_VERIFY}" ]; then + jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-public-tls-verify" \ + --argjson ENGINES_PUBLIC_TLS_VERIFY "${ENGINES_REPO_TLS_VERIFY}" \ + '.engines.public += { "tls-verify": $ENGINES_PUBLIC_TLS_VERIFY }' + fi +} + +# add quay specific information to an existing registries.json +function registries_json_add_quay() { + local ENGINES_QUAY_EXPIRATION_LENGTH + ENGINES_QUAY_EXPIRATION_LENGTH=$1 + local ENGINES_QUAY_EXPIRATION_REFRESH_TOKEN + ENGINES_QUAY_EXPIRATION_REFRESH_TOKEN=$2 + local ENGINES_QUAY_EXPIRATION_REFRESH_API_URL + ENGINES_QUAY_EXPIRATION_REFRESH_API_URL=$3 + + if [ -z "${REGISTRIES_CFG}" ]; then + exit_error "ERROR: \%REGISTRIES_CFG must be defined when calling $0" + fi + + if [ "${ENGINES_QUAY_EXPIRATION_LENGTH}" != "SKIP_QUAY" ]; then + jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-quay-expiration-length" \ + --arg ENGINES_PUBLIC_QUAY_EXPIRATION_LENGTH "${ENGINES_QUAY_EXPIRATION_LENGTH}" \ + '.engines.public += { "quay": { "expiration-length": $ENGINES_PUBLIC_QUAY_EXPIRATION_LENGTH } }' + + if [ -n "${ENGINES_QUAY_EXPIRATION_REFRESH_TOKEN}" -a -n "${ENGINES_QUAY_EXPIRATION_REFRESH_API_URL}" ]; then + jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-quay-expiration-refresh-token" \ + --arg ENGINES_PUBLIC_QUAY_EXPIRATION_REFRESH_TOKEN "${ENGINES_QUAY_EXPIRATION_REFRESH_TOKEN}" \ + --arg ENGINES_PUBLIC_QUAY_EXPIRATION_REFRESH_API_URL "${ENGINES_QUAY_EXPIRATION_REFRESH_API_URL}" \ + '.engines.public.quay += { "refresh-expiration": { "token-file": $ENGINES_PUBLIC_QUAY_EXPIRATION_REFRESH_TOKEN, "api-url": $ENGINES_PUBLIC_QUAY_EXPIRATION_REFRESH_API_URL } }' + fi + fi +} diff --git a/bin/base b/bin/base index 94957c2..8c75e5b 100644 --- a/bin/base +++ b/bin/base @@ -985,33 +985,14 @@ if [ ! -e ${REGISTRIES_CFG} ]; then echo "Creating ${REGISTRIES_CFG}" - # create an empty JSON file that jq will be able to add to - echo "{}" > ${REGISTRIES_CFG} - - # populate the new JSON file with the information from - # /etc/sysconfig/crucible - CONTROLLER_URL=$(echo ${CRUCIBLE_CONTROLLER_IMAGE} | awk -F: '{ print $1 }') - CONTROLLER_TAG=$(echo ${CRUCIBLE_CONTROLLER_IMAGE} | awk -F: '{ print $2 }') - jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-controller" \ - --arg CONTROLLER_URL "${CONTROLLER_URL}" \ - --arg CONTROLLER_TAG "${CONTROLLER_TAG}" \ - '. += { "controller": { "url": $CONTROLLER_URL, "tag": $CONTROLLER_TAG } }' - - jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-public" \ - --arg ENGINES_PUBLIC_URL "${CRUCIBLE_ENGINE_REPO}" \ - '. += { "engines": { "public": { "url": $ENGINES_PUBLIC_URL } } }' - - if [ -n "${CRUCIBLE_ENGINE_REPO_AUTH_TOKEN}" ]; then - jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-public-push-token" \ - --arg ENGINES_PUBLIC_PUSH_TOKEN "${CRUCIBLE_ENGINE_REPO_AUTH_TOKEN}" \ - '.engines.public += { "push-token": $ENGINES_PUBLIC_PUSH_TOKEN }' - fi + source ${CRUCIBLE_HOME}/bin/_registries.lib - if [ -n "${CRUCIBLE_ENGINE_REPO_TLS_VERIFY}" ]; then - jq_update ${REGISTRIES_CFG} "${REGISTRIES_CFG}:create-engines-public-tls-verify" \ - --argjson ENGINES_PUBLIC_TLS_VERIFY "${CRUCIBLE_ENGINE_REPO_TLS_VERIFY}" \ - '.engines.public += { "tls-verify": $ENGINES_PUBLIC_TLS_VERIFY }' - fi + create_registries_json \ + ${CRUCIBLE_CONTROLLER_IMAGE} \ + ${CRUCIBLE_ENGINE_REPO} \ + ${CRUCIBLE_ENGINE_REPO_AUTH_TOKEN} \ + ${CRUCIBLE_ENGINE_REPO_TLS_VERIFY} \ + "SKIP_QUAY" echo "Contents of ${REGISTRIES_CFG}:" cat ${REGISTRIES_CFG} @@ -1059,6 +1040,8 @@ if [ -e ${REGISTRIES_CFG} ]; then validate_json_schema ${REGISTRIES_CFG} ${REGISTRIES_CFG_SCHEMA} RC=$? if [ ${RC} -ne 0 ]; then + echo "${REGISTRIES_CFG}:" + cat ${REGISTRIES_CFG} exit_error "${REGISTRIES_CFG} does not validate against ${REGISTRIES_CFG_SCHEMA}" ${RC} fi fi diff --git a/crucible-install.sh b/crucible-install.sh index 792b076..e72b40d 100755 --- a/crucible-install.sh +++ b/crucible-install.sh @@ -12,6 +12,7 @@ GIT_INSTALL_LOG="/tmp/crucible-git-install.log" CRUCIBLE_CONTROLLER_REGISTRY="quay.io/crucible/controller:latest" DEFAULT_GIT_REPO="https://github.com/perftool-incubator/crucible" DEFAULT_GIT_BRANCH="master" +DEFAULT_QUAY_EXPIRATION_LENGTH="13w" GIT_REPO="" GIT_BRANCH="" GIT_TAG="" @@ -35,6 +36,8 @@ EC_PUSHD_FAIL=15 EC_PULL_FAIL=16 EC_RELEASE_DEFAULT_REPO_ONLY=18 EC_RELEASE_CONFLICTS_WITH_BRANCH=19 +EC_INVALID_QUAY_EXPIRATION_LENGTH=20 +EC_OAUTH_FILE_NOT_FOUND=21 # remove a previous installation log if [ -e ${GIT_INSTALL_LOG} ]; then @@ -153,6 +156,15 @@ function usage { optional: + --quay-engine-expiration-refresh-token > + Quay OAuth authentication token file for refreshing engine image expiration timestamps. + + --quay-engine-expiration-refresh-api-url + Quay API URL that is used to operate on the engine registry. + + --quay-engine-expiration-length + How long should a Quay repo allow the engine images to live before they expire. + --engine-auth-file Authentication file for pushing images to the remote registry. @@ -189,11 +201,12 @@ _USAGE_ # list available tags from the remote repository function list_releases { -# only default repo is supported for the release mechanism + # only default repo is supported for the release mechanism git ls-remote --tags \ - --sort='version:refname' \ - https://github.com/perftool-incubator/crucible.git \ - | awk -F/ '{print$NF}' + --sort='version:refname' \ + https://github.com/perftool-incubator/crucible.git \ + | awk -F/ '{print$NF}' \ + | grep -E '20[0-9]{2}\.[1234]' } # cleanup previous installation @@ -358,7 +371,8 @@ function update_repos_config() { longopts="name:,email:,help,list-releases,verbose" longopts+=",client-server-registry:,client-server-auth-file:,client-server-tls-verify:" -longopts+=",engine-registry:,engine-auth-file:,engine-tls-verify:" +longopts+=",engine-registry:,engine-auth-file:,engine-tls-verify:,quay-engine-expiration-length:" +longopts+=",quay-engine-expiration-refresh-token:,quay-engine-expiration-refresh-api-url:" longopts+=",controller-registry:,git-repo:,git-branch:,release:" opts=$(getopt -q -o "" --longoptions "$longopts" -n "$0" -- "$@"); if [ $? -ne 0 ]; then @@ -368,6 +382,21 @@ fi eval set -- "$opts"; while true; do case "$1" in + --quay-engine-expiration-refresh-token) + shift; + CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN="$1" + shift; + ;; + --quay-engine-expiration-refresh-api-url) + shift; + CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_API_URL="$1" + shift; + ;; + --quay-engine-expiration-length) + shift; + CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH="$1" + shift; + ;; --client-server-tls-verify|--engine-tls-verify) shift; CRUCIBLE_ENGINE_TLS_VERIFY="$1" @@ -441,7 +470,7 @@ done # --release conflicts with --git-repo or --git-branch if [ -n "${GIT_TAG}" ]; then - if [ -n "${GIT_REPO}" ]; then + if [ -n "${GIT_REPO}" -a "${GIT_REPO}" != "${DEFAULT_GIT_REPO}" ]; then exit_error "Only default repo is supported for installing a release." $EC_RELEASE_DEFAULT_REPO_ONLY fi if [ -n "${GIT_BRANCH}" ]; then @@ -470,6 +499,18 @@ for dep in $DEPENDENCIES; do has_dependency $dep done +if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH}" ]; then + if ! echo "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH}" | grep -q "[1-9][0-9]*[wm]"; then + exit_error "Invalid syntax for engine Quay expiration length. Expecting either 'w' (for weeks) or 'm' (for months)" ${EC_INVALID_QUAY_EXPIRATION_LENGTH} + fi +fi + +if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN}" ]; then + if [ ! -f "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN}" ]; then + exit_error "Crucible Quay engine refresh token file not found. See --quay-engine-expiration-refresh-token for details." $EC_OAUTH_FILE_NOT_FOUND + fi +fi + if [ ! -z ${CRUCIBLE_ENGINE_AUTH_FILE+x} ]; then if [ ! -f $CRUCIBLE_ENGINE_AUTH_FILE ]; then exit_error "Crucible authentication file not found. See --engine-auth-file for details." $EC_AUTH_FILE_NOT_FOUND @@ -515,16 +556,65 @@ $INSTALL_PATH/bin/subprojects-install $GIT_TAG >>"$GIT_INSTALL_LOG" 2>&1 || SYSCONFIG_CRUCIBLE_ENGINE_REGISTRY="${CRUCIBLE_ENGINE_REGISTRY}" SYSCONFIG_CRUCIBLE_ENGINE_AUTH="" -SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="\"true\"" -if [ ! -z ${CRUCIBLE_ENGINE_AUTH_FILE+x} ]; then - SYSCONFIG_CRUCIBLE_ENGINE_AUTH="\"${CRUCIBLE_ENGINE_AUTH_FILE}\"" +SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="" +SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="true" +SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH="${DEFAULT_QUAY_EXPIRATION_LENGTH}" +SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN="" +SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_API_URL="" + +if [ -n "${CRUCIBLE_ENGINE_AUTH_FILE}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_AUTH="${CRUCIBLE_ENGINE_AUTH_FILE}" fi -if [ ! -z ${CRUCIBLE_ENGINE_TLS_VERIFY+x} ]; then - SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="\"${CRUCIBLE_ENGINE_TLS_VERIFY}\"" +if [ -n "${CRUCIBLE_ENGINE_TLS_VERIFY}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="${CRUCIBLE_ENGINE_TLS_VERIFY}" +fi +if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH="${CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH}" +fi +if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN="${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN}" +fi +if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_API_URL}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_API_URL="${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_API_URL}" fi -# native crucible install script already created this, only append -cat << _SYSCFG_ >> $SYSCONFIG +REGISTRIES_CFG=${INSTALL_PATH}/config/registries.json +REGISTRIES_CFG_SCHEMA=${INSTALL_PATH}/schema/registries.json + +if [ -e ${INSTALL_PATH}/bin/_registries.lib ]; then + source ${INSTALL_PATH}/bin/_registries.lib + + cat << _SYSCFG_ >> $SYSCONFIG +CRUCIBLE_USE_CONTAINERS=1 +CRUCIBLE_USE_LOGGER=1 +_SYSCFG_ + + create_registries_json \ + ${CRUCIBLE_CONTROLLER_REGISTRY} \ + ${SYSCONFIG_CRUCIBLE_ENGINE_REGISTRY} \ + ${SYSCONFIG_CRUCIBLE_ENGINE_AUTH} \ + ${SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY} + + registries_json_add_quay \ + ${SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH} \ + ${SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN} \ + ${SYSCONFIG_CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_API_URL} + + # when the 'base' file is sourced with this particular parameter + # set it will force the registries.json to be validated + CRUCIBLE_CFG_JSON_VALIDATION="yes" + SESSION_ID="installer" + CRUCIBLE_HOME=${INSTALL_PATH} source ${INSTALL_PATH}/bin/base +else + SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="\"${SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY}\"" + if [ -n "${SYSCONFIG_CRUCIBLE_ENGINE_AUTH_FILE}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_AUTH="\"${SYSCONFIG_CRUCIBLE_ENGINE_AUTH}\"" + fi + if [ -n "${CRUCIBLE_ENGINE_TLS_VERIFY}" ]; then + SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY="\"${SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY}\"" + fi + + cat << _SYSCFG_ >> $SYSCONFIG CRUCIBLE_USE_CONTAINERS=1 CRUCIBLE_USE_LOGGER=1 CRUCIBLE_CONTROLLER_IMAGE=${CRUCIBLE_CONTROLLER_REGISTRY} @@ -532,6 +622,7 @@ CRUCIBLE_ENGINE_REPO=${SYSCONFIG_CRUCIBLE_ENGINE_REGISTRY} CRUCIBLE_ENGINE_REPO_AUTH_TOKEN=${SYSCONFIG_CRUCIBLE_ENGINE_AUTH} CRUCIBLE_ENGINE_REPO_TLS_VERIFY=${SYSCONFIG_CRUCIBLE_ENGINE_TLS_VERIFY} _SYSCFG_ +fi if [ ${VERBOSE} == 1 ]; then echo @@ -543,6 +634,11 @@ if [ ${VERBOSE} == 1 ]; then echo ${INSTALL_PATH}/bin/crucible repo config show fi + if [ -e ${REGISTRIES_CFG} ]; then + echo + echo "Contents of registries config file ${REGISTRIES_CFG}:" + cat ${REGISTRIES_CFG} + fi fi echo diff --git a/tests/test-installer b/tests/test-installer index 2084436..ac05f88 100755 --- a/tests/test-installer +++ b/tests/test-installer @@ -5,26 +5,34 @@ exec 2>&1 set +e -set -x test_number=0 CRUCIBLE_DIR=$(pwd) +GITHUB_RUNNER=1 function start_test() { - set +x - echo - echo "#################################################################################" - echo "Test Number: $(( test_number += 1 ))" - echo "#################################################################################" + local msg + msg="Test Number: $(( test_number += 1 ))" + if [ ${GITHUB_RUNNER} -eq 1 ]; then + echo "::group::${msg}" + else + echo + echo "#################################################################################" + echo "${msg}" + echo "#################################################################################" + fi set -x } function stop_test() { set +x - echo "*********************************************************************************" - echo - set -x + if [ ${GITHUB_RUNNER} -eq 1 ]; then + echo "::endgroup::" + else + echo "*********************************************************************************" + echo + fi } start_test @@ -65,6 +73,19 @@ for arg_mode in client-server engine; do stop_test done +start_test +# oauth file not found +ec=$(grep EC_OAUTH_FILE_NOT_FOUND= crucible-install.sh | cut -d '=' -f2) +sudo ./crucible-install.sh \ + --git-repo ${CRUCIBLE_DIR} \ + --engine-registry myregistry.io/crucible \ + --engine-auth-file /tmp/auth-file.json \ + --quay-engine-expiration-refresh-token /tmp/oauth-file.json \ + --quay-engine-expiration-refresh-api-url myregistry.io/crucible/api/url \ + --verbose +test "$?" = "$ec" || exit 1 +stop_test + for arg_mode in client-server engine; do start_test echo "testing arg_mode=${arg_mode}" @@ -79,6 +100,20 @@ for arg_mode in client-server engine; do stop_test done +start_test +# invalid quay expiration length +touch /tmp/auth-file.json +ec=$(grep EC_INVALID_QUAY_EXPIRATION_LENGTH= crucible-install.sh | cut -d '=' -f2) +# TODO(rfolco): temporary workaround until we make it distro generic +sudo ./crucible-install.sh \ + --git-repo ${CRUCIBLE_DIR} \ + --engine-registry myregistry.io/crucible \ + --engine-auth-file /tmp/auth-file.json \ + --quay-engine-expiration-length 1y \ + --verbose +test "$?" = "${ec}" || exit 1 +stop_test + for arg_mode in client-server engine; do start_test echo "testing arg_mode=${arg_mode}" @@ -137,10 +172,28 @@ for arg_mode in client-server engine; do --${arg_mode}-auth-file /tmp/auth-file.json \ --verbose test "$?" = "0" || exit 1 - ls /opt/crucible-moved* || exit 1 + ls -ld /opt/crucible-moved* || exit 1 stop_test done +start_test +# override existing installation +touch /tmp/auth-file.json +touch /tmp/oauth-file.json +cfgfile=$(grep SYSCONFIG= crucible-install.sh | cut -d '=' -f2 | sed 's/"//g') +# TODO(rfolco): temporary workaround until we make it distro generic +sudo mkdir -p $(dirname $cfgfile) +sudo ./crucible-install.sh \ + --git-repo ${CRUCIBLE_DIR} \ + --engine-registry myregistry.io/crucible \ + --engine-auth-file /tmp/auth-file.json \ + --quay-engine-expiration-refresh-token /tmp/oauth-file.json \ + --quay-engine-expiration-refresh-api-url myregistry.io/crucible/api/url \ + --verbose +test "$?" = "0" || exit 1 +ls -ld /opt/crucible-moved* || exit 1 +stop_test + for arg_mode in client-server engine; do start_test echo "testing arg_mode=${arg_mode}" @@ -153,7 +206,7 @@ for arg_mode in client-server engine; do --${arg_mode}-registry myregistry.io/crucible \ --verbose test "$?" = "0" || exit 1 - ls /opt/crucible-moved* || exit 1 + ls -ld /opt/crucible-moved* || exit 1 stop_test done @@ -163,7 +216,8 @@ start_test tags=$(git ls-remote --tags \ --sort='version:refname' \ https://github.com/perftool-incubator/crucible.git \ - | awk -F/ '{print$NF}') + | awk -F/ '{print$NF}' \ + | grep -E '20[0-9]{2}\.[1234]') stop_test start_test @@ -175,6 +229,27 @@ test "$?" = "0" || exit 1 [[ "$stdout" = *"$tags"* ]] || exit 1 stop_test +for arg_mode in client-server engine; do + for tag in $tags; do + start_test + echo "testing arg_mode=${arg_mode} tag=${tag}" + # install existing release with current installer + touch /tmp/auth-file.json + cfgfile=$(grep SYSCONFIG= crucible-install.sh | cut -d '=' -f2 | sed 's/"//g') + # TODO(rfolco): temporary workaround until we make it distro generic + sudo mkdir -p $(dirname $cfgfile) + sudo ./crucible-install.sh \ + --git-repo "https://github.com/perftool-incubator/crucible" \ + --release $tag \ + --${arg_mode}-registry myregistry.io/crucible \ + --${arg_mode}-auth-file /tmp/auth-file.json \ + --verbose + test "$?" = "0" || exit 1 + ls -ld /opt/crucible-moved* || exit 1 + stop_test + done +done + start_test ## negative test: --release and --git-repo ec=$(grep EC_RELEASE_DEFAULT_REPO_ONLY= crucible-install.sh | cut -d '=' -f2) @@ -202,7 +277,7 @@ sed -i -e "s|\(DEFAULT_GIT_REPO\)=.*|\1=\"${CRUCIBLE_DIR}\"|" crucible-install.s grep "^DEFAULT_GIT_REPO" crucible-install.sh ec=$(grep EC_FAIL_CHECKOUT= crucible-install.sh | cut -d '=' -f2) sudo ./crucible-install.sh \ - --release NonExitentTag \ + --release NonExistentTag \ --client-server-registry myregistry.io/crucible \ --verbose test "$?" = "$ec" || exit 1