From 6bfc4bd78b4544f5d34fefd1e1245636f3af3807 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Wed, 11 Mar 2020 23:34:22 +0300 Subject: [PATCH 1/5] add config directory --- images/linux/ubuntu1604.json | 8 ++++++++ images/linux/ubuntu1804.json | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 51e1bb51..ea02031d 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -129,6 +129,14 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "inline": [ + "mkdir -p /etc/skel/.config/configstore", + "echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "shell", "scripts": [ diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 33800251..420c2c0c 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -132,6 +132,14 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "inline": [ + "mkdir -p /etc/skel/.config/configstore", + "echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "shell", "scripts": [ From d7c9e5f1d343f548355675f9127858e9141978ca Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 12 Mar 2020 18:54:01 +0300 Subject: [PATCH 2/5] add comment --- images/linux/ubuntu1604.json | 1 + images/linux/ubuntu1804.json | 1 + 2 files changed, 2 insertions(+) diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index ea02031d..133751f3 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -132,6 +132,7 @@ { "type": "shell", "inline": [ + "# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491)", "mkdir -p /etc/skel/.config/configstore", "echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc" ], diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 420c2c0c..d96b8bea 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -135,6 +135,7 @@ { "type": "shell", "inline": [ + "# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491)", "mkdir -p /etc/skel/.config/configstore", "echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc" ], From 09bc20f23875c19774c58472bbefdd36bbd546df Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 12 Mar 2020 23:46:11 +0300 Subject: [PATCH 3/5] move inline to envvariables.sh --- images/linux/scripts/installers/envvariables.sh | 7 +++++++ images/linux/ubuntu1604.json | 16 +++++----------- images/linux/ubuntu1804.json | 16 +++++----------- 3 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 images/linux/scripts/installers/envvariables.sh diff --git a/images/linux/scripts/installers/envvariables.sh b/images/linux/scripts/installers/envvariables.sh new file mode 100644 index 00000000..7ffdd35f --- /dev/null +++ b/images/linux/scripts/installers/envvariables.sh @@ -0,0 +1,7 @@ +#Set ImageVersion and ImageOS env variables +"echo ImageVersion=$IMAGE_VERSION | tee -a /etc/environment", +"echo ImageOS=$IMAGE_OS | tee -a /etc/environment" + +# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491) +mkdir -p /etc/skel/.config/configstore +echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 133751f3..dc08e206 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -123,18 +123,12 @@ }, { "type": "shell", - "inline": [ - "echo ImageVersion={{user `image_version`}} | tee -a /etc/environment", - "echo ImageOS={{user `image_os`}} | tee -a /etc/environment" + "scripts": [ + "{{template_dir}}/scripts/installers/envvariables.sh" ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, - { - "type": "shell", - "inline": [ - "# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491)", - "mkdir -p /etc/skel/.config/configstore", - "echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc" + "environment_vars": [ + "IMAGE_VERSION={{user `image_version`}}", + "IMAGE_OS={{user `image_os`}}" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index d96b8bea..f5443028 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -126,18 +126,12 @@ }, { "type": "shell", - "inline": [ - "echo ImageVersion={{user `image_version`}} | tee -a /etc/environment", - "echo ImageOS={{user `image_os`}} | tee -a /etc/environment" + "scripts": [ + "{{template_dir}}/scripts/installers/envvariables.sh" ], - "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" - }, - { - "type": "shell", - "inline": [ - "# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491)", - "mkdir -p /etc/skel/.config/configstore", - "echo 'export XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/skel/.bashrc" + "environment_vars": [ + "IMAGE_VERSION={{user `image_version`}}", + "IMAGE_OS={{user `image_os`}}" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, From d9f22812003fccf3b0822ad8a9f1ee76645291d8 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Fri, 13 Mar 2020 00:12:02 +0300 Subject: [PATCH 4/5] remove comma and quotes --- images/linux/scripts/installers/envvariables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/envvariables.sh b/images/linux/scripts/installers/envvariables.sh index 7ffdd35f..35e3dba6 100644 --- a/images/linux/scripts/installers/envvariables.sh +++ b/images/linux/scripts/installers/envvariables.sh @@ -1,6 +1,6 @@ #Set ImageVersion and ImageOS env variables -"echo ImageVersion=$IMAGE_VERSION | tee -a /etc/environment", -"echo ImageOS=$IMAGE_OS | tee -a /etc/environment" +echo ImageVersion=$IMAGE_VERSION | tee -a /etc/environment +echo ImageOS=$IMAGE_OS | tee -a /etc/environment # This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491) mkdir -p /etc/skel/.config/configstore From d05df3249201476de2e111f1e57d36a6ce79b34b Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Fri, 13 Mar 2020 11:09:03 +0300 Subject: [PATCH 5/5] rename script to configure-environment.sh --- .../installers/{envvariables.sh => configure-environment.sh} | 0 images/linux/ubuntu1604.json | 2 +- images/linux/ubuntu1804.json | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename images/linux/scripts/installers/{envvariables.sh => configure-environment.sh} (100%) diff --git a/images/linux/scripts/installers/envvariables.sh b/images/linux/scripts/installers/configure-environment.sh similarity index 100% rename from images/linux/scripts/installers/envvariables.sh rename to images/linux/scripts/installers/configure-environment.sh diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index dc08e206..45b7386c 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -124,7 +124,7 @@ { "type": "shell", "scripts": [ - "{{template_dir}}/scripts/installers/envvariables.sh" + "{{template_dir}}/scripts/installers/configure-environment.sh" ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index f5443028..4cf6f15b 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -127,7 +127,7 @@ { "type": "shell", "scripts": [ - "{{template_dir}}/scripts/installers/envvariables.sh" + "{{template_dir}}/scripts/installers/configure-environment.sh" ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}",