diff --git a/README.md b/README.md index 3f5a4b2..a540501 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/JesterOrNot/Gitpod-AWS) -Gitpod running on AWS! This likley will be a temporary repo untill its hopefully merged into Gitpod Self Hosted! But who knows? +Gitpod running on AWS! This likley will be a temporary repo untill its hopefully +merged into Gitpod Self Hosted! But who knows? To install it run the following @@ -22,4 +23,7 @@ You can find the defaults in src/variables.tf [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/JesterOrNot/Gitpod-AWS) -You will need to setup the following enviornment variables though to get the AWS setup to work [configure the following enviornment in Gitpod](https://www.gitpod.io/docs/environment-variables/) `AWS_SECRET_ACCESS_KEY` and `AWS_ACCESS_KEY_ID` +You will need to setup the following enviornment variables though to get the AWS +setup to work +[configure the following enviornment in Gitpod](https://www.gitpod.io/docs/environment-variables/) +`AWS_SECRET_ACCESS_KEY` and `AWS_ACCESS_KEY_ID` diff --git a/scripts/install-gitpod.sh b/scripts/install-gitpod.sh index e59a947..373142e 100755 --- a/scripts/install-gitpod.sh +++ b/scripts/install-gitpod.sh @@ -6,18 +6,18 @@ cd src || exit terraform init did_fail="failed" # Take varriardic arguments from $1 on, the or statement will be used for error handling incase the install fails -echo 'yes' | terraform apply "${@: 1}" || did_fail="" -if [ -z $did_fail ]; then - printf "\x1b[31mSomething went wrong during the installation of Gitpod Self Hosted for AWS. This should not happen. Destroying any dangling infrastructure. Please file an issue at https://github.com/gitpod-io/self-hosted\x1b[m" - echo 'yes' | terraform destroy - exit +echo 'yes' | terraform apply "${@:1}" || did_fail="" +if [ -z "$did_fail" ]; then + printf "\x1b[31mSomething went wrong during the installation of Gitpod Self Hosted for AWS. This should not happen. Destroying any dangling infrastructure. Please file an issue at https://github.com/gitpod-io/self-hosted\x1b[m" + echo 'yes' | terraform destroy + exit fi # Configure local machine for the kubernetes cluseter aws eks --region "$(cat <(terraform output region))" update-kubeconfig --name "$(cat <(terraform output cluster_name))" kubectl apply -f <(terraform output config_map_aws_auth) # Clone self-hosted if it doesn't exist if ! [ -d self-hosted ]; then - git clone "https://github.com/gitpod-io/self-hosted.git" + git clone "https://github.com/gitpod-io/self-hosted.git" fi cd self-hosted || exit # Necassary Kubernetes stuffs @@ -25,7 +25,7 @@ kubectl create -f utils/helm-2-tiller-sa-crb.yaml helm repo add charts.gitpod.io "https://charts.gitpod.io" helm dep update # The point of this script is automation as I couldn't get it done in a provisioner and since we require a static IP its the first argument -cat << EOF > values.yaml +cat <values.yaml gitpod: hostname: $1 components: @@ -34,9 +34,9 @@ gitpod: EOF # If self-hosted already exists there is a chance that there is extra configuration for self-hosted which the following honors if [ -f "configuration.txt" ]; then - helm upgrade --install $(for i in $(cat configuration.txt); do echo -e "-f $i"; done) gitpod . + helm upgrade --install "$(for i in "$(cat configuration.txt)"; do echo -e "-f $i"; done)" gitpod . else - helm install gitpod . + helm install gitpod . fi cd .. || exit rm -rf self-hosted