Skip to content

Commit

Permalink
second pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoremepunto committed May 26, 2023
1 parent 0facefd commit edf0e4f
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ check_unit_test_script() {
fi
}

# TODO: create custom jenkins agent image that has a lot of this stuff pre-installed
export LANG=en_US.utf-8
export LC_ALL=en_US.utf-8
export APP_ROOT=$(pwd)
export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace
export CICD_ROOT=${WORKSPACE}/.cicd-tools
Expand All @@ -56,17 +59,11 @@ export BONFIRE_NS_REQUESTER="${JOB_NAME}-${BUILD_NUMBER}"
# which branch to fetch cicd scripts from in cicd-tools repo
export CICD_REPO_BRANCH="${CICD_REPO_BRANCH:-main}"
export CICD_REPO_ORG="${CICD_REPO_ORG:-RedHatInsights}"

# Set up docker cfg
export DOCKER_CONFIG="$WORKSPACE/.docker"
rm -fr $DOCKER_CONFIG
mkdir $DOCKER_CONFIG

# Set up kube cfg
export KUBECONFIG_DIR="$WORKSPACE/.kube"
export KUBECONFIG="$KUBECONFIG_DIR/config"
rm -fr $KUBECONFIG_DIR
mkdir $KUBECONFIG_DIR
export GIT_COMMIT=$(git rev-parse HEAD)
export ARTIFACTS_DIR="$WORKSPACE/artifacts"

# if this is a PR, use a different tag, since PR tags expire
if [ ! -z "$ghprbPullId" ]; then
Expand All @@ -77,17 +74,18 @@ if [ ! -z "$gitlabMergeRequestIid" ]; then
export IMAGE_TAG="pr-${gitlabMergeRequestIid}-${IMAGE_TAG}"
fi

export GIT_COMMIT=$(git rev-parse HEAD)
export ARTIFACTS_DIR="$WORKSPACE/artifacts"
# TODO: decide removal
check_unit_test_script

rm -fr $ARTIFACTS_DIR && mkdir -p $ARTIFACTS_DIR
# Set up docker cfg
rm -fr $DOCKER_CONFIG
mkdir $DOCKER_CONFIG

# TODO: create custom jenkins agent image that has a lot of this stuff pre-installed
export LANG=en_US.utf-8
export LC_ALL=en_US.utf-8
# Set up kube cfg
rm -fr $KUBECONFIG_DIR
mkdir $KUBECONFIG_DIR

# TODO: decide removal
check_unit_test_script
rm -fr $ARTIFACTS_DIR && mkdir -p $ARTIFACTS_DIR

# clone repo to download cicd scripts
rm -fr "$CICD_ROOT"
Expand Down

0 comments on commit edf0e4f

Please sign in to comment.