Skip to content

Commit 829e54b

Browse files
authored
install kcl binaries to /home/vscode/.kusion/kclvm/bin (#4)
* install kcl-language-server to /home/vscode/.kusion/ * install kclvm --------- Co-authored-by: xiarui.xr <xiarui.xr@antgroup.com>
1 parent 64141d9 commit 829e54b

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎src/kusion/devcontainer-feature.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
},
1313
"containerEnv": {
14-
"PATH": "/home/vscode/.kusion:${PATH}",
14+
"PATH": "/home/vscode/.kusion:/home/vscode/.kusion/kclvm/bin:${PATH}",
1515
"KUSION_PATH": "/home/vscode/.kusion"
1616
},
1717
"customizations": {

‎src/kusion/install.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -eux
66
VERSION=${VERSION:-"0.8.1"}
77
KUSION_URL="https://github.com/KusionStack/kusion/releases/download/v${VERSION}/kusion_${VERSION}_linux_amd64.tar.gz"
88
KUSION_LOCATION="/home/vscode/.kusion"
9+
KCLVM_URL="https://github.com/KusionStack/kcl/releases/download/v0.5.0-alpha.1/kclvm-v0.5.0-alpha.1-linux-amd64.tar.gz"
910

1011
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
1112

@@ -29,7 +30,11 @@ mkdir -p ${KUSION_LOCATION}
2930

3031
# install Kusion pack
3132
wget -c ${KUSION_URL} -qO - | tar xz -C ${KUSION_LOCATION}
32-
# the kusion bin location is added to path by devcontainer-feature.json file
33+
# the kusion location is added to path by devcontainer-feature.json file
34+
35+
# install kclvm. the unziped files contains kclvm binaries under: t ${KUSION_LOCATION}/kclvm/bin
36+
wget -c ${KCLVM_URL} -qO - | tar xz -C ${KUSION_LOCATION}
37+
# the kclvm bin location is added to path by devcontainer-feature.json file
3338

3439
# ensure that the kusion install path has correct privs
3540
chown -R $USERNAME ${KUSION_LOCATION}

‎test/_global/kusion.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ source dev-container-features-test-lib
1818

1919
echo -e "The result of the 'kusion' command will be:\n"
2020
kusion
21+
echo -e "The kcl-language-server location is:\n"
22+
which kcl-language-server
2123
echo -e "\n"
2224

2325
# Feature-specific tests
2426
# The 'check' command comes from the dev-container-features-test-lib.
2527
check "check kusion version produces version info" kusion version | grep 'releaseVersion: v0.8.1'
2628
check "check PATH env is set properly" echo ${PATH} | grep '.kusion'
2729
check "check KUSION_PATH env is set properly" echo ${KUSION_PATH} | grep '.kusion'
30+
check "check kcl-language-server is installed" which kcl-language-server | grep '.kusion/kclvm/bin'
2831

2932
# Report result
3033
# If any of the checks above exited with a non-zero exit code, the test will fail.

‎test/kusion/test.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ source dev-container-features-test-lib
2828
# Feature-specific tests
2929
# The 'check' command comes from the dev-container-features-test-lib.
3030
check "version" kusion version | grep 'releaseVersion: v0.8.1'
31+
check "check kcl-language-server is installed" which kcl-language-server | grep '.kusion/kclvm/bin'
3132

3233
# Report result
3334
# If any of the checks above exited with a non-zero exit code, the test will fail.

0 commit comments

Comments
 (0)