Skip to content

Commit 4462ebf

Browse files
author
Pedro Pombeiro
committed
Install nvm if no system nodejs is found
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
1 parent 5a69b41 commit 4462ebf

7 files changed

Lines changed: 439 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Status-Windows-x86_64.exe
147147
/desktop/CMakeFiles/
148148
/desktop/reportApp/Makefile
149149
/deployment/windows/Status.rc
150+
/docker/*/scripts/
150151
*_autogen/
151152
CompleteBundleWin.cmake
152153
logger_settings.ini

docker/linux/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ RUN mkdir -p $LEIN_INSTALL \
8383
ARG NVM_VERSION
8484
ARG NODE_VERSION
8585
ARG YARN_VERSION
86-
RUN curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash
86+
ADD scripts/3rd-party/nvm/${NVM_VERSION}/install.sh /tmp/nvm/${NVM_VERSION}/
8787

88-
RUN mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \
88+
RUN /tmp/nvm/${NVM_VERSION}/install.sh && \
89+
mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \
8990
git init && git remote add origin https://github.com/status-im/react-native-desktop.git && \
9091
git fetch --depth=1 origin ${REACT_NATIVE_DESKTOP_COMMIT_SHA} && \
9192
git reset --hard FETCH_HEAD && \
@@ -106,7 +107,7 @@ RUN addgroup --gid 1002 jenkins && \
106107
--uid 1001 --gid 1002 jenkins
107108

108109
# Install NVM for Jenkins
109-
RUN su jenkins -c 'curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash'
110+
RUN su jenkins -c '/tmp/nvm/${NVM_VERSION}/install.sh'
110111

111112
LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/docker" \
112113
description="Image for building Linux Desktop version of Status app." \

docker/linux/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ IMAGE_TAG = 1.1.1
1515
IMAGE_NAME = statusteam/linux-desktop-ubuntu:$(IMAGE_TAG)
1616

1717
build: $(QT_ARCHIVE)
18+
rm -rf ./scripts && \
19+
mkdir -p ./scripts/3rd-party && \
20+
cp -R ../../scripts/3rd-party/ ./scripts/ && \
1821
docker build \
1922
--build-arg="QT_VERSION=$(QT_VERSION)" \
2023
--build-arg="QT_CI_COMMIT_SHA=$(QT_CI_COMMIT_SHA)" \
@@ -24,7 +27,8 @@ build: $(QT_ARCHIVE)
2427
--build-arg="NVM_VERSION=$(call __read__toolversion__,nvm)" \
2528
--build-arg="YARN_VERSION=$(call __read__toolversion__,yarn)" \
2629
--label="commit=$(GIT_COMMIT)" \
27-
-t $(IMAGE_NAME) .
30+
-t $(IMAGE_NAME) .; \
31+
rm -rf ./scripts
2832

2933
$(QT_ARCHIVE):
3034
wget $(QT_URL)/$(QT_VER_MJR)/$(QT_VERSION)/$(QT_ARCHIVE)

docker/windows/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ RUN mkdir -p $LEIN_INSTALL \
4949

5050
ARG NVM_VERSION
5151
ARG NODE_VERSION
52-
RUN curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash
52+
ADD scripts/3rd-party/nvm/${NVM_VERSION}/install.sh /tmp/nvm/${NVM_VERSION}/
5353

54-
RUN mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \
54+
RUN /tmp/nvm/${NVM_VERSION}/install.sh && \
55+
mkdir -p /tmp/react-native-desktop && cd /tmp/react-native-desktop && \
5556
git --version && \
5657
git init && git remote add origin https://github.com/status-im/react-native-desktop.git && \
5758
git fetch --depth=1 origin ${REACT_NATIVE_DESKTOP_COMMIT_SHA} && \
@@ -72,7 +73,7 @@ RUN addgroup --gid 1002 jenkins && \
7273
--uid 1001 --gid 1002 jenkins
7374

7475
# Install NVM for Jenkins
75-
RUN su jenkins -c 'curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash'
76+
RUN su jenkins -c '/tmp/nvm/${NVM_VERSION}/install.sh'
7677

7778
LABEL source="https://github.com/status-im/status-react/tree/develop/desktop/windows/docker" \
7879
description="Image for building Windows Desktop version of Status app." \

docker/windows/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ REACT_NATIVE_DESKTOP_COMMIT_SHA = 2a76c435a27f0bf6c089f74222212b3a58e10385
88
__read__toolversion__ = $(shell grep $(1) ../../../.TOOLVERSIONS | cut -d'=' -f2-)
99

1010
build:
11+
rm -rf ./scripts && \
12+
mkdir -p ./scripts/3rd-party && \
13+
cp -R ../../scripts/3rd-party/ ./scripts/ && \
1114
docker build \
1215
--build-arg="REACT_NATIVE_DESKTOP_COMMIT_SHA=$(REACT_NATIVE_DESKTOP_COMMIT_SHA)" \
1316
--build-arg="CONAN_VERSION=$(call __read__toolversion__,conan)" \
1417
--build-arg="LEIN_VERSION=$(call __read__toolversion__,lein)" \
1518
--build-arg="NODE_VERSION=$(call __read__toolversion__,node)" \
1619
--build-arg="NVM_VERSION=$(call __read__toolversion__,nvm)" \
1720
--label="commit=$(GIT_COMMIT)" \
18-
-t $(IMAGE_NAME) .
21+
-t $(IMAGE_NAME) .; \
22+
rm -rf ./scripts
1923

2024
push: build
2125
docker push $(IMAGE_NAME)

0 commit comments

Comments
 (0)