Roost Cluster Pipeline Script
This set of instructions can be injected into a Jenkins pipeline or any other CI tool and used for creating Roost Environment on the go (EaaS).
Â
export SCRIPT=jenkins-cluster-deploy.sh
export S3_URL=https://remote-roostprod.s3-us-west-1.amazonaws.com/${SCRIPT}
# Credentials
export AWS_CREDS="/var/lib/jenkins/aws_accessKeys.csv"
export ROOST_TOKEN="*****"
export ROOST_SERVER="roost.io:443"
export CLUSTER_ALIAS="jenkins-pipeline" # OR any variable like ${JOB_NAME}
export IMAGE_TAG=${GIT_COMMIT}
# Project Deploy Settings
export HELM_DIR="$WORKSPACE/helm-vote"
export HELM_ARGS="--set clusterIP=CLUSTER_IP,tag=latest,namespace=${BUILD_TAG},registry=zbio"
# Roost Script will inject CLUSTER_IP
# Step 1: Download Script
curl -qsL ${S3_URL} -o $HOME/${SCRIPT}
# Step 2: Start Cluster and Deploy Helm Chart
sh $HOME/${SCRIPT} -l "start" -c ${CLUSTER_ALIAS} -f "$HELM_DIR" -r ${ROOST_SERVER} -a ${ROOST_TOKEN} -k ${AWS_CREDS}
# echo "=== Done with deploy ==="
# Command for namespace related actions
# NS_ACTION possible values [wakeup,delete,create,sleep]
# NS="abc"
# NS_ACTION="wakeup"
# sh $HOME/${SCRIPT} -a "$ROOST_TOKEN" -k "$AWS_CREDS" -c ${CLUSTER_ALIAS} -d $NS_ACTION -n $NS
# OR
# sh $HOME/${SCRIPT} -c ${CLUSTER_ALIAS} -d $NS_ACTION -n $NS -r ${ROOST_SERVER} -j ${HOME}/Roost/${CLUSTER_ALIAS}/remoteConfig.json
# Other script options to stop/delete the same cluster
# sh $HOME/${SCRIPT} -l "stop" -r ${ROOST_SERVER} -j ${HOME}/Roost/${CLUSTER_ALIAS}/remoteConfig.json
# sh $HOME/${SCRIPT} -l "delete" -r ${ROOST_SERVER} -j ${HOME}/Roost/${CLUSTER_ALIAS}/remoteConfig.json