From 171e3a479c9fb56c4fec9afd668c62cf85b2481b Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 19 Mar 2020 17:35:55 +0300 Subject: [PATCH 01/32] add mvn --- images/linux/scripts/installers/mvn.sh | 14 ++++++++++++++ images/linux/ubuntu1604.json | 1 + images/linux/ubuntu1804.json | 1 + 3 files changed, 16 insertions(+) create mode 100644 images/linux/scripts/installers/mvn.sh diff --git a/images/linux/scripts/installers/mvn.sh b/images/linux/scripts/installers/mvn.sh new file mode 100644 index 000000000000..483384c42486 --- /dev/null +++ b/images/linux/scripts/installers/mvn.sh @@ -0,0 +1,14 @@ +source $HELPER_SCRIPTS/document.sh + +export NVM_DIR="$HOME/.nvm" +mkdir $NVM_DIR +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash +echo "source $NVM_DIR/nvm.sh --install" >> "$HOME/.bash_profile" +source $HOME/.bash_profile + +if ! command -v $mvn; then + echo "$mvn was not installed" + exit 1 +fi + +DocumentInstalledItem "nvm ($(nvm --version))" \ No newline at end of file diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index e604b0581cb7..c60e51501210 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -168,6 +168,7 @@ "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nodejs.sh", + "{{template_dir}}/scripts/installers/mvn.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/phantomjs.sh", "{{template_dir}}/scripts/installers/1604/php.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 6396229d75cd..28dab9d79fd4 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -171,6 +171,7 @@ "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nodejs.sh", + "{{template_dir}}/scripts/installers/mvn.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/phantomjs.sh", "{{template_dir}}/scripts/installers/1804/php.sh", From 9181e53fecd5e9f3e0f023340be46e1518cdcc62 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 19 Mar 2020 21:40:14 +0300 Subject: [PATCH 02/32] fix naming --- images/linux/scripts/installers/{mvn.sh => nvm.sh} | 4 ++-- images/linux/ubuntu1604.json | 2 +- images/linux/ubuntu1804.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename images/linux/scripts/installers/{mvn.sh => nvm.sh} (83%) diff --git a/images/linux/scripts/installers/mvn.sh b/images/linux/scripts/installers/nvm.sh similarity index 83% rename from images/linux/scripts/installers/mvn.sh rename to images/linux/scripts/installers/nvm.sh index 483384c42486..296f9f3c688c 100644 --- a/images/linux/scripts/installers/mvn.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -6,8 +6,8 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash echo "source $NVM_DIR/nvm.sh --install" >> "$HOME/.bash_profile" source $HOME/.bash_profile -if ! command -v $mvn; then - echo "$mvn was not installed" +if ! command -v nvm; then + echo "nvm was not installed" exit 1 fi diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index c60e51501210..59034acc68e0 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -168,7 +168,7 @@ "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nodejs.sh", - "{{template_dir}}/scripts/installers/mvn.sh", + "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/phantomjs.sh", "{{template_dir}}/scripts/installers/1604/php.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 28dab9d79fd4..ead5f3b18048 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -171,7 +171,7 @@ "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nodejs.sh", - "{{template_dir}}/scripts/installers/mvn.sh", + "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/phantomjs.sh", "{{template_dir}}/scripts/installers/1804/php.sh", From ad6f3160ede7cbeef97ab1a72db3ab4398e64a73 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Fri, 20 Mar 2020 10:02:00 +0300 Subject: [PATCH 03/32] install nvm before node --- images/linux/ubuntu1604.json | 2 +- images/linux/ubuntu1804.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 59034acc68e0..983cbb420804 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -167,8 +167,8 @@ "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", - "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/nvm.sh", + "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/phantomjs.sh", "{{template_dir}}/scripts/installers/1604/php.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index ead5f3b18048..da170aef384e 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -170,8 +170,8 @@ "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", - "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/nvm.sh", + "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/phantomjs.sh", "{{template_dir}}/scripts/installers/1804/php.sh", From 99143796fd04bd84b461752fabed544ef447e9f1 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Fri, 20 Mar 2020 10:10:11 +0300 Subject: [PATCH 04/32] minimize ubuntu1804 for tests --- images/linux/ubuntu1804.json | 38 ------------------------------------ 1 file changed, 38 deletions(-) diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index da170aef384e..625508546fef 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -146,46 +146,8 @@ "{{template_dir}}/scripts/installers/1804/basic.sh", "{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/build-essential.sh", - "{{template_dir}}/scripts/installers/clang.sh", - "{{template_dir}}/scripts/installers/cmake.sh", - "{{template_dir}}/scripts/installers/docker-compose.sh", - "{{template_dir}}/scripts/installers/docker-moby.sh", - "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", - "{{template_dir}}/scripts/installers/erlang.sh", - "{{template_dir}}/scripts/installers/firefox.sh", - "{{template_dir}}/scripts/installers/gcc.sh", - "{{template_dir}}/scripts/installers/gfortran.sh", - "{{template_dir}}/scripts/installers/git.sh", - "{{template_dir}}/scripts/installers/google-chrome.sh", - "{{template_dir}}/scripts/installers/google-cloud-sdk.sh", - "{{template_dir}}/scripts/installers/haskell.sh", - "{{template_dir}}/scripts/installers/heroku.sh", - "{{template_dir}}/scripts/installers/hhvm.sh", - "{{template_dir}}/scripts/installers/image-magick.sh", - "{{template_dir}}/scripts/installers/java-tools.sh", - "{{template_dir}}/scripts/installers/kind.sh", - "{{template_dir}}/scripts/installers/1804/kubernetes-tools.sh", - "{{template_dir}}/scripts/installers/leiningen.sh", - "{{template_dir}}/scripts/installers/1804/mercurial.sh", - "{{template_dir}}/scripts/installers/miniconda.sh", - "{{template_dir}}/scripts/installers/mono.sh", - "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", - "{{template_dir}}/scripts/installers/bazel.sh", - "{{template_dir}}/scripts/installers/phantomjs.sh", - "{{template_dir}}/scripts/installers/1804/php.sh", - "{{template_dir}}/scripts/installers/pollinate.sh", - "{{template_dir}}/scripts/installers/postgresql.sh", - "{{template_dir}}/scripts/installers/powershellcore.sh", - "{{template_dir}}/scripts/installers/ruby.sh", - "{{template_dir}}/scripts/installers/rust.sh", - "{{template_dir}}/scripts/installers/julia.sh", - "{{template_dir}}/scripts/installers/sbt.sh", - "{{template_dir}}/scripts/installers/selenium.sh", - "{{template_dir}}/scripts/installers/sphinx.sh", - "{{template_dir}}/scripts/installers/subversion.sh", - "{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/packer.sh", "{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/zeit-now.sh", From 8c4ad0f17be5c248c69f558bccf344a1d5ca9ff9 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Fri, 20 Mar 2020 12:01:57 +0300 Subject: [PATCH 05/32] add changes and test on minimized image --- images/linux/scripts/installers/nvm.sh | 17 ++++++++++++----- images/linux/ubuntu1804.json | 17 +---------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 296f9f3c688c..3a36d5e07998 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -1,11 +1,18 @@ source $HELPER_SCRIPTS/document.sh -export NVM_DIR="$HOME/.nvm" -mkdir $NVM_DIR +#groupadd nvm +#usermod -aG nvm root +#chown :nvm ./nvm +export NVM_DIR="/opt/.nvm" +mkdir -m 777 $NVM_DIR +#chmod g+ws $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash -echo "source $NVM_DIR/nvm.sh --install" >> "$HOME/.bash_profile" -source $HOME/.bash_profile - +ls $NVM_DIR +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "/etc/profile" +#echo "source $NVM_DIR/nvm.sh --install" >> /etc/profile +#sudo source /etc/profile +#exec bash if ! command -v nvm; then echo "nvm was not installed" exit 1 diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 625508546fef..e1f71eb5ce4c 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -184,10 +184,7 @@ "scripts":[ "{{template_dir}}/scripts/installers/1804/android.sh", "{{template_dir}}/scripts/installers/azpowershell.sh", - "{{template_dir}}/scripts/helpers/containercache.sh", - "{{template_dir}}/scripts/installers/hosted-tool-cache.sh", - "{{template_dir}}/scripts/installers/python.sh", - "{{template_dir}}/scripts/installers/test-toolcache.sh" + "{{template_dir}}/scripts/helpers/containercache.sh" ], "environment_vars": [ "METADATA_FILE={{user `metadata_file`}}", @@ -197,18 +194,6 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, - { - "type": "shell", - "scripts":[ - "{{template_dir}}/scripts/installers/boost.sh" - ], - "environment_vars": [ - "METADATA_FILE={{user `metadata_file`}}", - "HELPER_SCRIPTS={{user `helper_script_folder`}}", - "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" - ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, { "type": "file", "source": "{{user `metadata_file`}}", From cf61b9170d84d4f3eddb5959a28d94fcc3ec03fc Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Fri, 20 Mar 2020 12:32:53 +0300 Subject: [PATCH 06/32] comment documentation --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 3a36d5e07998..74a831ab636b 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -18,4 +18,4 @@ if ! command -v nvm; then exit 1 fi -DocumentInstalledItem "nvm ($(nvm --version))" \ No newline at end of file +#DocumentInstalledItem "nvm ($(nvm --version))" \ No newline at end of file From 22c7727bde3acda2e358fb2b7408695e85090463 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Fri, 20 Mar 2020 12:58:35 +0300 Subject: [PATCH 07/32] add check nvm version --- images/linux/scripts/installers/nvm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 74a831ab636b..bb4e9f48ea3f 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -17,5 +17,6 @@ if ! command -v nvm; then echo "nvm was not installed" exit 1 fi - +echo "nvm versio is" +nvm --version #DocumentInstalledItem "nvm ($(nvm --version))" \ No newline at end of file From 44e85eb15a399d52607fecb6375548270ae3b5c0 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Fri, 20 Mar 2020 13:36:32 +0300 Subject: [PATCH 08/32] get script to run on full ubuntu image --- images/linux/scripts/installers/nvm.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index bb4e9f48ea3f..09c114cab47e 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -1,22 +1,22 @@ +#!/bin/bash +################################################################################ +## File: nvm.sh +## Desc: Installs Nvm +################################################################################ + +# Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh -#groupadd nvm -#usermod -aG nvm root -#chown :nvm ./nvm export NVM_DIR="/opt/.nvm" mkdir -m 777 $NVM_DIR -#chmod g+ws $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash ls $NVM_DIR -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "/etc/profile" -#echo "source $NVM_DIR/nvm.sh --install" >> /etc/profile -#sudo source /etc/profile -#exec bash + if ! command -v nvm; then echo "nvm was not installed" exit 1 fi -echo "nvm versio is" -nvm --version -#DocumentInstalledItem "nvm ($(nvm --version))" \ No newline at end of file + +DocumentInstalledItem "nvm ($(nvm --version))" \ No newline at end of file From 8da68c0edaff2b36212fe1321f3e2f69b2e16740 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 23 Mar 2020 09:58:38 +0300 Subject: [PATCH 09/32] add NVM_DIR var --- images/linux/scripts/installers/nvm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 09c114cab47e..e86ab9b0d059 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -12,7 +12,8 @@ mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash ls $NVM_DIR [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -[ -s "$NVM_DIR/bash_completion" ] && \. "/etc/profile" +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" +echo $NVM_DIR | tee -a /etc/environment if ! command -v nvm; then echo "nvm was not installed" From 1999c7a06a2ca695dd5c4662ade264d1e4b317fb Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 23 Mar 2020 17:47:14 +0300 Subject: [PATCH 10/32] add ubuntu1804 --- images/linux/ubuntu1804.json | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index e1f71eb5ce4c..775855b4bdf4 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -146,8 +146,46 @@ "{{template_dir}}/scripts/installers/1804/basic.sh", "{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/build-essential.sh", + "{{template_dir}}/scripts/installers/clang.sh", + "{{template_dir}}/scripts/installers/cmake.sh", + "{{template_dir}}/scripts/installers/docker-compose.sh", + "{{template_dir}}/scripts/installers/docker-moby.sh", + "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", + "{{template_dir}}/scripts/installers/erlang.sh", + "{{template_dir}}/scripts/installers/firefox.sh", + "{{template_dir}}/scripts/installers/gcc.sh", + "{{template_dir}}/scripts/installers/gfortran.sh", + "{{template_dir}}/scripts/installers/git.sh", + "{{template_dir}}/scripts/installers/google-chrome.sh", + "{{template_dir}}/scripts/installers/google-cloud-sdk.sh", + "{{template_dir}}/scripts/installers/haskell.sh", + "{{template_dir}}/scripts/installers/heroku.sh", + "{{template_dir}}/scripts/installers/hhvm.sh", + "{{template_dir}}/scripts/installers/image-magick.sh", + "{{template_dir}}/scripts/installers/java-tools.sh", + "{{template_dir}}/scripts/installers/kind.sh", + "{{template_dir}}/scripts/installers/1804/kubernetes-tools.sh", + "{{template_dir}}/scripts/installers/leiningen.sh", + "{{template_dir}}/scripts/installers/1804/mercurial.sh", + "{{template_dir}}/scripts/installers/miniconda.sh", + "{{template_dir}}/scripts/installers/mono.sh", + "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", + "{{template_dir}}/scripts/installers/bazel.sh", + "{{template_dir}}/scripts/installers/phantomjs.sh", + "{{template_dir}}/scripts/installers/1804/php.sh", + "{{template_dir}}/scripts/installers/pollinate.sh", + "{{template_dir}}/scripts/installers/postgresql.sh", + "{{template_dir}}/scripts/installers/powershellcore.sh", + "{{template_dir}}/scripts/installers/ruby.sh", + "{{template_dir}}/scripts/installers/rust.sh", + "{{template_dir}}/scripts/installers/julia.sh", + "{{template_dir}}/scripts/installers/sbt.sh", + "{{template_dir}}/scripts/installers/selenium.sh", + "{{template_dir}}/scripts/installers/sphinx.sh", + "{{template_dir}}/scripts/installers/subversion.sh", + "{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/packer.sh", "{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/zeit-now.sh", @@ -184,6 +222,10 @@ "scripts":[ "{{template_dir}}/scripts/installers/1804/android.sh", "{{template_dir}}/scripts/installers/azpowershell.sh", + "{{template_dir}}/scripts/helpers/containercache.sh", + "{{template_dir}}/scripts/installers/hosted-tool-cache.sh", + "{{template_dir}}/scripts/installers/python.sh", + "{{template_dir}}/scripts/installers/test-toolcache.sh", "{{template_dir}}/scripts/helpers/containercache.sh" ], "environment_vars": [ @@ -194,6 +236,18 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/boost.sh" + ], + "environment_vars": [ + "METADATA_FILE={{user `metadata_file`}}", + "HELPER_SCRIPTS={{user `helper_script_folder`}}", + "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "file", "source": "{{user `metadata_file`}}", From 3e4e53f4b564a8dd96b5b1b7d8fd7fa193635c07 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 23 Mar 2020 17:48:43 +0300 Subject: [PATCH 11/32] remove extra containercache --- images/linux/ubuntu1804.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 775855b4bdf4..da170aef384e 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -225,8 +225,7 @@ "{{template_dir}}/scripts/helpers/containercache.sh", "{{template_dir}}/scripts/installers/hosted-tool-cache.sh", "{{template_dir}}/scripts/installers/python.sh", - "{{template_dir}}/scripts/installers/test-toolcache.sh", - "{{template_dir}}/scripts/helpers/containercache.sh" + "{{template_dir}}/scripts/installers/test-toolcache.sh" ], "environment_vars": [ "METADATA_FILE={{user `metadata_file`}}", From 1cf97ca80552ab8315cf03093963f018ce3ab85e Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 24 Mar 2020 13:15:59 +0300 Subject: [PATCH 12/32] update script and minimize image --- images/linux/scripts/installers/nvm.sh | 1 + images/linux/ubuntu1604.json | 74 -------------------------- 2 files changed, 1 insertion(+), 74 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index e86ab9b0d059..73857feb6e9f 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -13,6 +13,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash ls $NVM_DIR [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" +chmod -R 777 $NVM_DIR echo $NVM_DIR | tee -a /etc/environment if ! command -v nvm; then diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 983cbb420804..5fd215d4996d 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -141,32 +141,6 @@ "{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-devops-cli.sh", "{{template_dir}}/scripts/installers/1604/basic.sh", - "{{template_dir}}/scripts/installers/aws.sh", - "{{template_dir}}/scripts/installers/build-essential.sh", - "{{template_dir}}/scripts/installers/clang.sh", - "{{template_dir}}/scripts/installers/cmake.sh", - "{{template_dir}}/scripts/installers/docker-compose.sh", - "{{template_dir}}/scripts/installers/docker-moby.sh", - "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", - "{{template_dir}}/scripts/installers/erlang.sh", - "{{template_dir}}/scripts/installers/firefox.sh", - "{{template_dir}}/scripts/installers/gcc.sh", - "{{template_dir}}/scripts/installers/gfortran.sh", - "{{template_dir}}/scripts/installers/git.sh", - "{{template_dir}}/scripts/installers/google-chrome.sh", - "{{template_dir}}/scripts/installers/google-cloud-sdk.sh", - "{{template_dir}}/scripts/installers/haskell.sh", - "{{template_dir}}/scripts/installers/heroku.sh", - "{{template_dir}}/scripts/installers/hhvm.sh", - "{{template_dir}}/scripts/installers/image-magick.sh", - "{{template_dir}}/scripts/installers/java-tools.sh", - "{{template_dir}}/scripts/installers/kind.sh", - "{{template_dir}}/scripts/installers/1604/kubernetes-tools.sh", - "{{template_dir}}/scripts/installers/leiningen.sh", - "{{template_dir}}/scripts/installers/1604/mercurial.sh", - "{{template_dir}}/scripts/installers/miniconda.sh", - "{{template_dir}}/scripts/installers/mono.sh", - "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", @@ -197,54 +171,6 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, - { - "type": "shell", - "scripts": [ - "{{template_dir}}/scripts/installers/go.sh" - ], - "environment_vars": [ - "METADATA_FILE={{user `metadata_file`}}", - "HELPER_SCRIPTS={{user `helper_script_folder`}}", - "GO_VERSIONS={{user `go_versions`}}", - "GO_DEFAULT={{user `go_default`}}" - ], - "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}" - }, - { - "type": "file", - "source": "{{template_dir}}/toolcache-1604.json", - "destination": "{{user `installer_script_folder`}}/toolcache.json" - }, - { - "type": "shell", - "scripts":[ - "{{template_dir}}/scripts/installers/1604/android.sh", - "{{template_dir}}/scripts/installers/azpowershell.sh", - "{{template_dir}}/scripts/helpers/containercache.sh", - "{{template_dir}}/scripts/installers/hosted-tool-cache.sh", - "{{template_dir}}/scripts/installers/python.sh", - "{{template_dir}}/scripts/installers/test-toolcache.sh" - ], - "environment_vars": [ - "METADATA_FILE={{user `metadata_file`}}", - "HELPER_SCRIPTS={{user `helper_script_folder`}}", - "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", - "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" - ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, - { - "type": "shell", - "scripts":[ - "{{template_dir}}/scripts/installers/boost.sh" - ], - "environment_vars": [ - "METADATA_FILE={{user `metadata_file`}}", - "HELPER_SCRIPTS={{user `helper_script_folder`}}", - "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" - ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, { "type": "file", "source": "{{user `metadata_file`}}", From 7f4058c0182f248724518c8b7f7b10e3d3255ba9 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 24 Mar 2020 14:08:28 +0300 Subject: [PATCH 13/32] added sudo --- images/linux/scripts/installers/1604/php.sh | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/images/linux/scripts/installers/1604/php.sh b/images/linux/scripts/installers/1604/php.sh index 147cedd6b4aa..3e4b549f931e 100644 --- a/images/linux/scripts/installers/1604/php.sh +++ b/images/linux/scripts/installers/1604/php.sh @@ -15,7 +15,7 @@ apt-add-repository ppa:ondrej/php -y # Install php5.6 apt-get update -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php5.6 \ php5.6-bcmath \ php5.6-bz2 \ @@ -53,10 +53,10 @@ apt-fast install -y --no-install-recommends \ php5.6-xmlrpc \ php5.6-xsl \ php5.6-zip -apt-get remove --purge -yq php5.6-dev +sudo apt-get remove --purge -yq php5.6-dev # Install php7.0 -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php7.0 \ php7.0-bcmath \ php7.0-bz2 \ @@ -94,10 +94,10 @@ apt-fast install -y --no-install-recommends \ php7.0-xmlrpc \ php7.0-xsl \ php7.0-zip -apt-get remove --purge -yq php7.0-dev +sudo apt-get remove --purge -yq php7.0-dev # Install php7.1 -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php7.1 \ php7.1-bcmath \ php7.1-bz2 \ @@ -135,10 +135,10 @@ apt-fast install -y --no-install-recommends \ php7.1-xmlrpc \ php7.1-xsl \ php7.1-zip -apt-get remove --purge -yq php7.1-dev +sudo apt-get remove --purge -yq php7.1-dev # Install php7.2 -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php7.2 \ php7.2-bcmath \ php7.2-bz2 \ @@ -177,7 +177,7 @@ apt-fast install -y --no-install-recommends \ php7.2-zip # Install php7.3 -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php7.3 \ php7.3-bcmath \ php7.3-bz2 \ @@ -216,7 +216,7 @@ apt-fast install -y --no-install-recommends \ php7.3-zip # Install php7.4 -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php7.4 \ php7.4-bcmath \ php7.4-bz2 \ @@ -253,7 +253,7 @@ apt-fast install -y --no-install-recommends \ php7.4-xsl \ php7.4-zip -apt-fast install -y --no-install-recommends \ +sudo apt-fast install -y --no-install-recommends \ php-amqp \ php-apcu \ php-igbinary \ @@ -265,9 +265,9 @@ apt-fast install -y --no-install-recommends \ php-yaml \ php-zmq -apt-get remove --purge -yq php7.2-dev +sudo apt-get remove --purge -yq php7.2-dev -apt-fast install -y --no-install-recommends snmp +sudo apt-fast install -y --no-install-recommends snmp # Install composer php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" From d315633d475a6d093d16545fd1e77c3c24ef870c Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 24 Mar 2020 14:31:07 +0300 Subject: [PATCH 14/32] fix script --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 73857feb6e9f..0aeda4607caa 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -14,7 +14,7 @@ ls $NVM_DIR [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" chmod -R 777 $NVM_DIR -echo $NVM_DIR | tee -a /etc/environment +echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment if ! command -v nvm; then echo "nvm was not installed" From 7114c42594e9245163a52b2c4628ceeef44806cd Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 24 Mar 2020 23:32:54 +0300 Subject: [PATCH 15/32] add new line to etc --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 0aeda4607caa..44bf4362b7c8 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -15,7 +15,7 @@ ls $NVM_DIR [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment - +echo "[[ -s $NVM_DIR/nvm.sh ]] && . $NVM_DIR/nvm.sh" | tee -a /etc/environment if ! command -v nvm; then echo "nvm was not installed" exit 1 From 7d4f58304eae1c98d1a17e9643df4a00dedcff3b Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 25 Mar 2020 09:17:41 +0300 Subject: [PATCH 16/32] fix script --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 44bf4362b7c8..6ae7dda7058f 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -15,7 +15,7 @@ ls $NVM_DIR [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment -echo "[[ -s $NVM_DIR/nvm.sh ]] && . $NVM_DIR/nvm.sh" | tee -a /etc/environment +echo "[ -s $NVM_DIR/nvm.sh ] && . $NVM_DIR/nvm.sh" | tee -a /etc/environment if ! command -v nvm; then echo "nvm was not installed" exit 1 From 942304b40260ab49e66246a2d08e3de57b15db0e Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 25 Mar 2020 09:52:32 +0300 Subject: [PATCH 17/32] fix nvm.sh --- images/linux/scripts/installers/nvm.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 6ae7dda7058f..746f3582cae0 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -15,7 +15,10 @@ ls $NVM_DIR [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment -echo "[ -s $NVM_DIR/nvm.sh ] && . $NVM_DIR/nvm.sh" | tee -a /etc/environment +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh +echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completio' >> /etc/profile.d/nvm.sh +source /etc/profile.d/nvm.sh + if ! command -v nvm; then echo "nvm was not installed" exit 1 From 9ede0982dcbe77c4f9da8738e3f4d840a3884ab4 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 25 Mar 2020 10:54:45 +0300 Subject: [PATCH 18/32] remove unused code --- images/linux/scripts/installers/nvm.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 746f3582cae0..0325f4ab66cd 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -10,9 +10,6 @@ source $HELPER_SCRIPTS/document.sh export NVM_DIR="/opt/.nvm" mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash -ls $NVM_DIR -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh From 01e0c95560c1a7461f7a177542b8126fe12c6f94 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 25 Mar 2020 13:04:39 +0300 Subject: [PATCH 19/32] return code --- images/linux/scripts/installers/1604/php.sh | 24 +++---- images/linux/ubuntu1604.json | 74 +++++++++++++++++++++ 2 files changed, 86 insertions(+), 12 deletions(-) diff --git a/images/linux/scripts/installers/1604/php.sh b/images/linux/scripts/installers/1604/php.sh index 3e4b549f931e..147cedd6b4aa 100644 --- a/images/linux/scripts/installers/1604/php.sh +++ b/images/linux/scripts/installers/1604/php.sh @@ -15,7 +15,7 @@ apt-add-repository ppa:ondrej/php -y # Install php5.6 apt-get update -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php5.6 \ php5.6-bcmath \ php5.6-bz2 \ @@ -53,10 +53,10 @@ sudo apt-fast install -y --no-install-recommends \ php5.6-xmlrpc \ php5.6-xsl \ php5.6-zip -sudo apt-get remove --purge -yq php5.6-dev +apt-get remove --purge -yq php5.6-dev # Install php7.0 -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php7.0 \ php7.0-bcmath \ php7.0-bz2 \ @@ -94,10 +94,10 @@ sudo apt-fast install -y --no-install-recommends \ php7.0-xmlrpc \ php7.0-xsl \ php7.0-zip -sudo apt-get remove --purge -yq php7.0-dev +apt-get remove --purge -yq php7.0-dev # Install php7.1 -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php7.1 \ php7.1-bcmath \ php7.1-bz2 \ @@ -135,10 +135,10 @@ sudo apt-fast install -y --no-install-recommends \ php7.1-xmlrpc \ php7.1-xsl \ php7.1-zip -sudo apt-get remove --purge -yq php7.1-dev +apt-get remove --purge -yq php7.1-dev # Install php7.2 -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php7.2 \ php7.2-bcmath \ php7.2-bz2 \ @@ -177,7 +177,7 @@ sudo apt-fast install -y --no-install-recommends \ php7.2-zip # Install php7.3 -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php7.3 \ php7.3-bcmath \ php7.3-bz2 \ @@ -216,7 +216,7 @@ sudo apt-fast install -y --no-install-recommends \ php7.3-zip # Install php7.4 -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php7.4 \ php7.4-bcmath \ php7.4-bz2 \ @@ -253,7 +253,7 @@ sudo apt-fast install -y --no-install-recommends \ php7.4-xsl \ php7.4-zip -sudo apt-fast install -y --no-install-recommends \ +apt-fast install -y --no-install-recommends \ php-amqp \ php-apcu \ php-igbinary \ @@ -265,9 +265,9 @@ sudo apt-fast install -y --no-install-recommends \ php-yaml \ php-zmq -sudo apt-get remove --purge -yq php7.2-dev +apt-get remove --purge -yq php7.2-dev -sudo apt-fast install -y --no-install-recommends snmp +apt-fast install -y --no-install-recommends snmp # Install composer php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 5fd215d4996d..983cbb420804 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -141,6 +141,32 @@ "{{template_dir}}/scripts/installers/azure-cli.sh", "{{template_dir}}/scripts/installers/azure-devops-cli.sh", "{{template_dir}}/scripts/installers/1604/basic.sh", + "{{template_dir}}/scripts/installers/aws.sh", + "{{template_dir}}/scripts/installers/build-essential.sh", + "{{template_dir}}/scripts/installers/clang.sh", + "{{template_dir}}/scripts/installers/cmake.sh", + "{{template_dir}}/scripts/installers/docker-compose.sh", + "{{template_dir}}/scripts/installers/docker-moby.sh", + "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", + "{{template_dir}}/scripts/installers/erlang.sh", + "{{template_dir}}/scripts/installers/firefox.sh", + "{{template_dir}}/scripts/installers/gcc.sh", + "{{template_dir}}/scripts/installers/gfortran.sh", + "{{template_dir}}/scripts/installers/git.sh", + "{{template_dir}}/scripts/installers/google-chrome.sh", + "{{template_dir}}/scripts/installers/google-cloud-sdk.sh", + "{{template_dir}}/scripts/installers/haskell.sh", + "{{template_dir}}/scripts/installers/heroku.sh", + "{{template_dir}}/scripts/installers/hhvm.sh", + "{{template_dir}}/scripts/installers/image-magick.sh", + "{{template_dir}}/scripts/installers/java-tools.sh", + "{{template_dir}}/scripts/installers/kind.sh", + "{{template_dir}}/scripts/installers/1604/kubernetes-tools.sh", + "{{template_dir}}/scripts/installers/leiningen.sh", + "{{template_dir}}/scripts/installers/1604/mercurial.sh", + "{{template_dir}}/scripts/installers/miniconda.sh", + "{{template_dir}}/scripts/installers/mono.sh", + "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", @@ -171,6 +197,54 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "scripts": [ + "{{template_dir}}/scripts/installers/go.sh" + ], + "environment_vars": [ + "METADATA_FILE={{user `metadata_file`}}", + "HELPER_SCRIPTS={{user `helper_script_folder`}}", + "GO_VERSIONS={{user `go_versions`}}", + "GO_DEFAULT={{user `go_default`}}" + ], + "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}" + }, + { + "type": "file", + "source": "{{template_dir}}/toolcache-1604.json", + "destination": "{{user `installer_script_folder`}}/toolcache.json" + }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/1604/android.sh", + "{{template_dir}}/scripts/installers/azpowershell.sh", + "{{template_dir}}/scripts/helpers/containercache.sh", + "{{template_dir}}/scripts/installers/hosted-tool-cache.sh", + "{{template_dir}}/scripts/installers/python.sh", + "{{template_dir}}/scripts/installers/test-toolcache.sh" + ], + "environment_vars": [ + "METADATA_FILE={{user `metadata_file`}}", + "HELPER_SCRIPTS={{user `helper_script_folder`}}", + "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", + "GITHUB_FEED_TOKEN={{user `github_feed_token`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/boost.sh" + ], + "environment_vars": [ + "METADATA_FILE={{user `metadata_file`}}", + "HELPER_SCRIPTS={{user `helper_script_folder`}}", + "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "file", "source": "{{user `metadata_file`}}", From 0c16fe7671158afb619e30f57e23363641f86175 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 25 Mar 2020 15:30:12 +0300 Subject: [PATCH 20/32] add comments --- images/linux/scripts/installers/nvm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 0325f4ab66cd..7c2f40e7514c 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -8,12 +8,14 @@ source $HELPER_SCRIPTS/document.sh export NVM_DIR="/opt/.nvm" +# should create directory with full permissions. mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash +# should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh -echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completio' >> /etc/profile.d/nvm.sh +echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> /etc/profile.d/nvm.sh source /etc/profile.d/nvm.sh if ! command -v nvm; then From b3e38a6509fec0a60dd6ab831b17faedfae63d27 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 25 Mar 2020 16:11:40 +0300 Subject: [PATCH 21/32] remoe bash_completion --- images/linux/scripts/installers/nvm.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 7c2f40e7514c..e78ee0dcf6cc 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -15,7 +15,6 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh -echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> /etc/profile.d/nvm.sh source /etc/profile.d/nvm.sh if ! command -v nvm; then From b5b584555beda4f9a9437792a23d40d1b6b07e93 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 26 Mar 2020 10:48:35 +0300 Subject: [PATCH 22/32] add nvm.sh to bashrc --- images/linux/scripts/installers/nvm.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index e78ee0dcf6cc..8cd9943fe114 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -14,8 +14,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment -echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh -source /etc/profile.d/nvm.sh +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/skel/.bashrc if ! command -v nvm; then echo "nvm was not installed" From b7acae67af77fd16cb6d446fd79d87182f381624 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 26 Mar 2020 16:21:17 +0300 Subject: [PATCH 23/32] minimize image --- images/linux/scripts/installers/nvm.sh | 1 + images/linux/ubuntu1604.json | 24 ------------------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 8cd9943fe114..e79b6568d8ff 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -15,6 +15,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/skel/.bashrc +source /etc/skel/.bashrc if ! command -v nvm; then echo "nvm was not installed" diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 983cbb420804..961adbc0264d 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -143,30 +143,6 @@ "{{template_dir}}/scripts/installers/1604/basic.sh", "{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/build-essential.sh", - "{{template_dir}}/scripts/installers/clang.sh", - "{{template_dir}}/scripts/installers/cmake.sh", - "{{template_dir}}/scripts/installers/docker-compose.sh", - "{{template_dir}}/scripts/installers/docker-moby.sh", - "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", - "{{template_dir}}/scripts/installers/erlang.sh", - "{{template_dir}}/scripts/installers/firefox.sh", - "{{template_dir}}/scripts/installers/gcc.sh", - "{{template_dir}}/scripts/installers/gfortran.sh", - "{{template_dir}}/scripts/installers/git.sh", - "{{template_dir}}/scripts/installers/google-chrome.sh", - "{{template_dir}}/scripts/installers/google-cloud-sdk.sh", - "{{template_dir}}/scripts/installers/haskell.sh", - "{{template_dir}}/scripts/installers/heroku.sh", - "{{template_dir}}/scripts/installers/hhvm.sh", - "{{template_dir}}/scripts/installers/image-magick.sh", - "{{template_dir}}/scripts/installers/java-tools.sh", - "{{template_dir}}/scripts/installers/kind.sh", - "{{template_dir}}/scripts/installers/1604/kubernetes-tools.sh", - "{{template_dir}}/scripts/installers/leiningen.sh", - "{{template_dir}}/scripts/installers/1604/mercurial.sh", - "{{template_dir}}/scripts/installers/miniconda.sh", - "{{template_dir}}/scripts/installers/mono.sh", - "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", From defcc4e28f85e2d0afd4040b6795fd02a2196405 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 26 Mar 2020 16:43:54 +0300 Subject: [PATCH 24/32] added env variable --- images/linux/scripts/installers/nvm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index e79b6568d8ff..424e58c16400 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -14,6 +14,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment +echo "export NVM_DIR=$NVM_DIR" | tee -a /etc/skel/.bashrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/skel/.bashrc source /etc/skel/.bashrc From 55ef299202278e3640fbe994f8486cdc7af9cc17 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 26 Mar 2020 17:59:33 +0300 Subject: [PATCH 25/32] run script --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 424e58c16400..1399cc8fd153 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -16,7 +16,7 @@ chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment echo "export NVM_DIR=$NVM_DIR" | tee -a /etc/skel/.bashrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/skel/.bashrc -source /etc/skel/.bashrc +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh if ! command -v nvm; then echo "nvm was not installed" From bbeebd662725ade2ea19d4d9839533af7432a77d Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 30 Mar 2020 12:26:06 +0300 Subject: [PATCH 26/32] change installation --- images/linux/scripts/installers/nvm.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 1399cc8fd153..6b5479ebe0c0 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -7,16 +7,15 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh -export NVM_DIR="/opt/.nvm" +export NVM_DIR="/etc/skel/.nvm" # should create directory with full permissions. mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment -echo "export NVM_DIR=$NVM_DIR" | tee -a /etc/skel/.bashrc -echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/skel/.bashrc -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh +echo "export NVM_DIR=$NVM_DIR" | sudo tee -a /etc/skel/.bashrc +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | sudo tee -a /etc/skel/.bashrc if ! command -v nvm; then echo "nvm was not installed" From 10043db5ee90c5c516c454408b0dc92e0041d776 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 30 Mar 2020 12:43:56 +0300 Subject: [PATCH 27/32] add run --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 6b5479ebe0c0..b33ba4d0428b 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -16,7 +16,7 @@ chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment echo "export NVM_DIR=$NVM_DIR" | sudo tee -a /etc/skel/.bashrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | sudo tee -a /etc/skel/.bashrc - +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" if ! command -v nvm; then echo "nvm was not installed" exit 1 From 7d39a15f7fb5adbdadc6644699c1d49107c44e66 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 31 Mar 2020 00:26:33 +0300 Subject: [PATCH 28/32] add profile.d --- images/linux/scripts/installers/nvm.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index b33ba4d0428b..2ad738731018 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -14,8 +14,9 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment -echo "export NVM_DIR=$NVM_DIR" | sudo tee -a /etc/skel/.bashrc -echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | sudo tee -a /etc/skel/.bashrc +echo "export NVM_DIR=$NVM_DIR" | tee -a /etc/skel/.bashrc +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bashrc +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" if ! command -v nvm; then echo "nvm was not installed" From abb7d3e4db202c4410f00e54e76f57a5c5dde6ce Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 31 Mar 2020 11:29:39 +0300 Subject: [PATCH 29/32] update bash_profile --- images/linux/scripts/installers/nvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 2ad738731018..0492432ed992 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -13,11 +13,11 @@ mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR -echo "NVM_DIR=$NVM_DIR" | tee -a /etc/environment -echo "export NVM_DIR=$NVM_DIR" | tee -a /etc/skel/.bashrc +echo "export NVM_DIR=$HOME/.nvm" | tee -a /etc/skel/.bashrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bashrc -echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /etc/profile.d/nvm.sh +echo 'source $HOME/.bashrc' | tee -a /etc/skel/.bash_profile [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + if ! command -v nvm; then echo "nvm was not installed" exit 1 From 545d4b9c059c35cd81a18531e97495f91ee31f33 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 31 Mar 2020 11:40:01 +0300 Subject: [PATCH 30/32] fix --- images/linux/scripts/installers/nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index 0492432ed992..e3225b168ad6 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -13,7 +13,7 @@ mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR -echo "export NVM_DIR=$HOME/.nvm" | tee -a /etc/skel/.bashrc +echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bashrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bashrc echo 'source $HOME/.bashrc' | tee -a /etc/skel/.bash_profile [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" From 65823fb38e25fb6116776c1e3f96831e1e4a9b45 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 31 Mar 2020 11:59:44 +0300 Subject: [PATCH 31/32] update --- images/linux/scripts/installers/nvm.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index e3225b168ad6..cb6aaa88aa93 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -13,9 +13,8 @@ mkdir -m 777 $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash # should recursively obtain subdirectories with full permissions chmod -R 777 $NVM_DIR -echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bashrc -echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bashrc -echo 'source $HOME/.bashrc' | tee -a /etc/skel/.bash_profile +echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bash_profile +echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" if ! command -v nvm; then From d9f83c982a38b2cabddfb0b05a13df5df0c94e94 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 1 Apr 2020 10:58:05 +0300 Subject: [PATCH 32/32] remove full permissions --- images/linux/scripts/installers/nvm.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index cb6aaa88aa93..cbfab1a89dd4 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -8,11 +8,8 @@ source $HELPER_SCRIPTS/document.sh export NVM_DIR="/etc/skel/.nvm" -# should create directory with full permissions. -mkdir -m 777 $NVM_DIR +mkdir $NVM_DIR curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash -# should recursively obtain subdirectories with full permissions -chmod -R 777 $NVM_DIR echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bash_profile echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"