Skip to content

Commit ebba926

Browse files
committed
Add btp CLI install to the devcontainer
1 parent d868bfb commit ebba926

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,3 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1616
# Install global node modules for SAP CAP and frontend development.
1717
RUN su node -c "npm install -g @ui5/cli @sap/cds-dk yo @sapui5/generator-sapui5-templates @sap/generator-add-hdb-module @sap/generator-base-mta-module @sap/generator-cap-project @sap/generator-fiori @sap/generator-hdb-project typescript"
1818

19-
#RUN curl \
20-
# --remote-name \
21-
# --location \
22-
# --url "https://raw.githubusercontent.com/SAP-samples/sap-tech-bytes/2021-09-01-btp-cli/getbtpcli" \
23-
# && chmod +x getbtpcli
24-
25-
#RUN ./getbtpcli
26-
27-
#RUN echo 'export PATH=$PATH:$HOME/bin' >> $HOME/.bashrc

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
// "postCreateCommand": "yarn install",
4343

4444
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
45-
"remoteUser": "node"
45+
"remoteUser": "node",
46+
"postCreateCommand": "bash -i install-btp.sh"
4647
}

install-btp.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/bash
2+
3+
cd $HOME
4+
curl \
5+
--remote-name \
6+
--location \
7+
--url "https://raw.githubusercontent.com/SAP-samples/sap-tech-bytes/2021-09-01-btp-cli/getbtpcli" \
8+
&& chmod +x getbtpcli \
9+
&& yes | ./getbtpcli
10+
11+
echo "alias bu='source <(tail -1 $HOME/.bashrc)'" >> $HOME/.bashrc
12+
source <(tail -1 $HOME/.bashrc)
13+
echo 'export PATH=$PATH:$HOME/bin' >> $HOME/.bashrc

0 commit comments

Comments
 (0)