From 73e622134cc019136e147585a9b0cafd46b77ae2 Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 20:25:24 +0200 Subject: [PATCH 01/10] include update.sh script in main, comment out two. update.sh will update and install essential tools, also install java. other two scripts weren't working on my end that's why I commented them --- main.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.sh b/main.sh index 2f8a6ed..64ae174 100755 --- a/main.sh +++ b/main.sh @@ -1,9 +1,12 @@ #!/bin/bash +source ./update.sh source ./setup-env-variables.sh -./install-aws-cli.sh -./collect-credentials.sh -./open-cloud-dashboards.sh +source ./install-aws-cli.sh + +# ./collect-credentials.sh +# ./open-cloud-dashboards.sh + source ./install-kubectl.sh source ./install-terraform.sh source ./install-dynamodb-local.sh \ No newline at end of file From 1d7450ddd2c2c309307c03c685d3d6bd2c21c5ee Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 20:26:18 +0200 Subject: [PATCH 02/10] add update.sh, it install java nad update tools. --- update.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..d2957ce --- /dev/null +++ b/update.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +apt-get update +#apt-get upgrade -y +apt-get install -y curl unzip wget jq build-essential file git git-lfs sudo + +# JAVA Installation +wget https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.deb +apt-get install -y ./jdk-19_linux-x64_bin.deb +update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-19/bin/java 1 +update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-19/bin/javac 1 +update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-19/bin/jar 1 +### next three lines not necessary +update-alternatives --config java +update-alternatives --config javac +update-alternatives --config jar + +java -version +echo "java is installed sucessfully.... :) " +echo " " +echo " " \ No newline at end of file From 6275ae9eea3503e3cb6e640523ed2fa488740663 Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 20:29:49 +0200 Subject: [PATCH 03/10] change installation method of aws-vault didn't want to install brew on docker image, so this is easier method. --- setup-env-variables.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup-env-variables.sh b/setup-env-variables.sh index 4e72129..915bb08 100755 --- a/setup-env-variables.sh +++ b/setup-env-variables.sh @@ -3,4 +3,10 @@ export AWS_DEFAULT_REGION=us-east-1 export AWS_VAULT_BACKEND=file export AWS_VAULT_FILE_PASSPHRASE= -brew install aws-vault + +# Download & Install aws-vault +curl -L -o /usr/local/bin/aws-vault https://github.com/99designs/aws-vault/releases/download/v6.6.2/aws-vault-linux-amd64 +chmod 755 /usr/local/bin/aws-vault + +# show aws-vault version +aws-vault --version \ No newline at end of file From 1b02af19ef1e583858a1d5b3674b405d88156547 Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 20:53:19 +0200 Subject: [PATCH 04/10] add terraform version command --- install-terraform.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install-terraform.sh b/install-terraform.sh index 3dfde40..a921f75 100644 --- a/install-terraform.sh +++ b/install-terraform.sh @@ -21,5 +21,7 @@ rm terraform_${TF_VERSION}_linux_amd64.zip cd "${OLD_DIR}" || exit 1 rm -rf "${TMP_DIR}" +# show terraform version +terraform --version echo "Terraform is installed & configured successfully." echo "Now, you can start using terraform." From bf8d4f4e5513a2743cea1b2d4e00ea5e2430a8bb Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 20:55:07 +0200 Subject: [PATCH 05/10] add kubectl version command --- install-kubectl.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install-kubectl.sh b/install-kubectl.sh index a3bdddc..b0b46cd 100644 --- a/install-kubectl.sh +++ b/install-kubectl.sh @@ -28,5 +28,7 @@ fi cd "${OLD_DIR}" || exit 1 rm -rf "${TMP_DIR}" +# show kubectl version +kubectl version --client echo "kubectl is installed & configured successfully." echo "Now, you can start using kubectl." From 1380629b15b3b8723903ff2c694dab266db049e1 Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 21:04:12 +0200 Subject: [PATCH 06/10] add echo "installing Java" line --- update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/update.sh b/update.sh index d2957ce..2d0fc7e 100644 --- a/update.sh +++ b/update.sh @@ -5,6 +5,7 @@ apt-get update apt-get install -y curl unzip wget jq build-essential file git git-lfs sudo # JAVA Installation +echo "Installing Java" wget https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.deb apt-get install -y ./jdk-19_linux-x64_bin.deb update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-19/bin/java 1 From 3ffbbe075b48143397782f069d3e0386d4774bd6 Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 21:05:47 +0200 Subject: [PATCH 07/10] remove brew install java, update dynamodb url. removed brew because it isn't installed in docker image --- install-dynamodb-local.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/install-dynamodb-local.sh b/install-dynamodb-local.sh index eaaa974..5e43a5b 100644 --- a/install-dynamodb-local.sh +++ b/install-dynamodb-local.sh @@ -1,19 +1,10 @@ #!/bin/bash - -echo "Installing Java" -brew install openjdk - -echo "java is installed sucessfully.... :) " -echo " " -echo " " - mkdir ./dynamolocal && cd ./dynamolocal - echo "Downloading the DynamoDB tar file" -wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz +wget https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz tar xzf dynamodb_local_latest.tar.gz rm -f dynamodb_local_latest.tar.gz From b04af6e9f024b45aa083a5d9a2f472cdce8e8dc8 Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 21:06:47 +0200 Subject: [PATCH 08/10] add aws version command --- install-aws-cli.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install-aws-cli.sh b/install-aws-cli.sh index 9f083e3..d748722 100755 --- a/install-aws-cli.sh +++ b/install-aws-cli.sh @@ -14,5 +14,7 @@ rm awscliv2.zip cd "${OLD_DIR}" || exit 1 rm -rf "${TMP_DIR}" +# show aws-cli version +aws --version echo "AWS CLI is installed & configured successfully." echo "Now, you can start using aws." From 409aac0d248cf33679e2b50d3d113d2f52fd813f Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 21:14:34 +0200 Subject: [PATCH 09/10] add Dockerfile that do what main.sh script --- .gitpod.Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitpod.Dockerfile diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..321aff5 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:latest + +WORKDIR /app + +COPY . . + +USER root + +RUN chmod +x main.sh +RUN bash main.sh + +ENTRYPOINT [ "/bin/bash","-c" ] +CMD [ "bash" ] \ No newline at end of file From 4d1aa458cece985ce68f37d85a2ee35baea0884c Mon Sep 17 00:00:00 2001 From: AbdassalamAhmad Date: Wed, 1 Feb 2023 21:15:08 +0200 Subject: [PATCH 10/10] add docker image instead of tasks of gitpod --- .gitpod.yml | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index ae5b73d..2dda909 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,24 +1,26 @@ +image: + file: .gitpod.Dockerfile tasks: - - name: Setup environment variables - command: | - source ./setup-env-variables.sh - gp sync-done env-setup - - name: Install AWS CLI - command: | - gp sync-await env-setup - ./install-aws-cli.sh - gp sync-done aws-cli - - name: Setup default aws-vault & Open Dashboards - command: | - gp sync-await aws-cli - ./collect-credentials.sh - ./open-cloud-dashboards.sh - - name: Install kubectl - command: source ./install-kubectl.sh - - name: Install Terraform - command: source ./install-terraform.sh - - name: Install Dynamodb - command: source ./install-dynamodb-local.sh + # - name: Setup environment variables + # command: | + # source ./setup-env-variables.sh + # gp sync-done env-setup + # - name: Install AWS CLI + # command: | + # gp sync-await env-setup + # ./install-aws-cli.sh + # gp sync-done aws-cli + # - name: Setup default aws-vault & Open Dashboards + # command: | + # gp sync-await aws-cli + # ./collect-credentials.sh + # ./open-cloud-dashboards.sh + # - name: Install kubectl + # command: source ./install-kubectl.sh + # - name: Install Terraform + # command: source ./install-terraform.sh + # - name: Install Dynamodb + # command: source ./install-dynamodb-local.sh - name: Install Visual Studio Code extensions command: source ./install-vsextensions.sh vscode: