diff --git a/src/spec-configuration/containerFeaturesConfiguration.ts b/src/spec-configuration/containerFeaturesConfiguration.ts index b2a00b13f..1f2a019c1 100644 --- a/src/spec-configuration/containerFeaturesConfiguration.ts +++ b/src/spec-configuration/containerFeaturesConfiguration.ts @@ -244,7 +244,9 @@ export function getFeatureLayers(featuresConfig: FeaturesConfig) { result += ` RUN cd /tmp/build-features/${feature.consecutiveId} \\ -&& export $(cat devcontainer-features.env | xargs) \\ +&& set -a \\ +&& . ./devcontainer-features.env \\ +&& set +a \\ && chmod +x ./install.sh \\ && ./install.sh diff --git a/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/.devcontainer.json b/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/.devcontainer.json index 0427989cc..96cbc26a9 100644 --- a/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/.devcontainer.json +++ b/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/.devcontainer.json @@ -4,7 +4,8 @@ }, "features": { "./local-features/localFeatureA": { - "greeting": "buongiorno" + "greeting": "Hello there", + "punctuation": "!!!!" }, "./local-features/localFeatureB": { "favorite": "gold" diff --git a/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/local-features/localFeatureA/install.sh b/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/local-features/localFeatureA/install.sh index 9088fe5a2..95d670a48 100644 --- a/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/local-features/localFeatureA/install.sh +++ b/src/test/container-features/configs/dockerfile-with-v2-local-features-no-dev-container-folder/local-features/localFeatureA/install.sh @@ -3,6 +3,7 @@ echo "Activating feature 'localFeatureA'" GREETING=${GREETING:-undefined} +PUNCTUATION=${PUNCTUATION:-?????} echo "The provided greeting is: $GREETING" tee /usr/hello.sh > /dev/null \ @@ -10,7 +11,7 @@ tee /usr/hello.sh > /dev/null \ #!/bin/bash RED='\033[0;91m' NC='\033[0m' # No Color -echo -e -n "\${RED}${GREETING}, \$(whoami)!" +echo -e -n "\${RED}${GREETING}, \$(whoami)${PUNCTUATION}" echo -e -n "\${NC}" EOF diff --git a/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/.devcontainer/devcontainer.json b/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/.devcontainer/devcontainer.json index 0427989cc..96cbc26a9 100644 --- a/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/.devcontainer/devcontainer.json +++ b/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/.devcontainer/devcontainer.json @@ -4,7 +4,8 @@ }, "features": { "./local-features/localFeatureA": { - "greeting": "buongiorno" + "greeting": "Hello there", + "punctuation": "!!!!" }, "./local-features/localFeatureB": { "favorite": "gold" diff --git a/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/local-features/localFeatureA/install.sh b/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/local-features/localFeatureA/install.sh index 9088fe5a2..95d670a48 100644 --- a/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/local-features/localFeatureA/install.sh +++ b/src/test/container-features/configs/dockerfile-with-v2-local-features-with-dev-container-folder/local-features/localFeatureA/install.sh @@ -3,6 +3,7 @@ echo "Activating feature 'localFeatureA'" GREETING=${GREETING:-undefined} +PUNCTUATION=${PUNCTUATION:-?????} echo "The provided greeting is: $GREETING" tee /usr/hello.sh > /dev/null \ @@ -10,7 +11,7 @@ tee /usr/hello.sh > /dev/null \ #!/bin/bash RED='\033[0;91m' NC='\033[0m' # No Color -echo -e -n "\${RED}${GREETING}, \$(whoami)!" +echo -e -n "\${RED}${GREETING}, \$(whoami)${PUNCTUATION}" echo -e -n "\${NC}" EOF diff --git a/src/test/container-features/e2e.test.ts b/src/test/container-features/e2e.test.ts index c2cfc6793..958502510 100644 --- a/src/test/container-features/e2e.test.ts +++ b/src/test/container-features/e2e.test.ts @@ -171,7 +171,7 @@ describe('Dev Container Features E2E (local-path)', function () { const response = JSON.parse(res.stdout); console.log(res.stderr); assert.equal(response.outcome, 'success'); - assert.match(res.stderr, /buongiorno, root!/); + assert.match(res.stderr, /Hello there, root!!!!/); }); it('should read configuration with features', async () => { @@ -201,7 +201,7 @@ describe('Dev Container Features E2E (local-path)', function () { const response = JSON.parse(res.stdout); console.log(res.stderr); assert.equal(response.outcome, 'success'); - assert.match(res.stderr, /buongiorno, root!/); + assert.match(res.stderr, /Hello there, root!!!!/); }); it('should read configuration with features with customizations', async () => {