X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=jjb%2Fshell%2Fkni_deploy_aws.sh;fp=jjb%2Fshell%2Fkni_deploy_aws.sh;h=ce8eec537316e9d61ad62ed69cb4547d4b3cddd7;hb=65a78e213ec8508ab57205ccc6283c0492a410bb;hp=0000000000000000000000000000000000000000;hpb=3fa2500d131a4537a1755e340ceccd4d6ba1a0e7;p=ci-management.git diff --git a/jjb/shell/kni_deploy_aws.sh b/jjb/shell/kni_deploy_aws.sh new file mode 100755 index 0000000..ce8eec5 --- /dev/null +++ b/jjb/shell/kni_deploy_aws.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# +# Copyright (c) 2019 Red Hat +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +export PATH=$PATH:/usr/local/go/bin +KNI_PATH='go/src/gerrit.akraino.org/kni/' + +set -e -u -x -o pipefail + +echo '---> Starting kni installer generation' + +mkdir -p $HOME/${KNI_PATH}/installer +export GOPATH=$HOME/go + +# move clone to gopath +cp -R ${WORKSPACE}/* $HOME/${KNI_PATH}/installer/ + +# first build kni installer +pushd $HOME/${KNI_PATH}/installer +make build 2>&1 | tee ${WORKSPACE}/build.log + +# then start aws deploy +export CREDENTIALS=file://$(pwd)/akraino-secrets +export BASE_REPO="git::https://gerrit.akraino.org/r/kni/templates" +export BASE_PATH="aws/3-node" +export SITE_REPO="git::https://gerrit.akraino.org/r/kni/templates" +export SETTINGS_PATH="aws/sample_settings.yaml" +make deploy 2>&1 | tee ${WORKSPACE}/aws_deploy.log +STATUS=$? + +# output tfstate +echo "metadata.json for removing cluster" +cat $(pwd)/build/metadata.json + +if [ $STATUS -ne 0 ]; then + echo "Error deploying in AWS" + exit 1 +fi + +echo "Cluster successfully deployed! Starting cleanup" +make clean +STATUS=$? + +popd + +exit $STATUS