Skip to content

Commit be69422

Browse files
committed
feat: lots of changes that make it work
1 parent 69a7726 commit be69422

10 files changed

Lines changed: 77 additions & 23 deletions

File tree

Dockerfile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
ARG IMAGE_TAG=latest
1+
FROM ubuntu:latest AS build
22

3-
FROM node:${IMAGE_TAG}
4-
ENV DEBIAN_FRONTEND=noninteractive
5-
WORKDIR /home/
6-
7-
ENTRYPOINT ["./scripts/setup-origin.sh"]
8-
9-
RUN scripts/install.sh
10-
RUN scripts/mkdir.sh
11-
RUN scripts/ccache.sh
12-
RUN scripts/npm.sh
13-
RUN scripts/fetch.sh
3+
RUN groupadd --gid 1000 developer \
4+
&& useradd --uid 1000 --gid developer --shell /bin/bash --create-home developer
145

6+
ENV DEBIAN_FRONTEND=1
157
ENV PATH /usr/lib/ccache:$PATH
168

17-
RUN scripts/build.sh
9+
COPY ./scripts/ ./scripts/
10+
RUN ./scripts/install.sh
11+
RUN ./scripts/mkdir.sh && ./scripts/ccache.sh && ./scripts/clone.sh
12+
RUN ./scripts/build.sh
13+
RUN make install -C ~/nodejs/node
14+
RUN ./scripts/ncu.sh

scripts/build.sh

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
python configure.py --ninja --node-builtin-modules-path /home/nodejs/node && ninja -C out/Release -j 2
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
5+
~/nodejs/node/configure --ninja --debug && make -C ~/nodejs/node

scripts/ccache.sh

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
15
# create symlinks
26
/usr/sbin/update-ccache-symlinks

scripts/clone.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
5+
cd ~/nodejs
6+
git clone https://github.com/nodejs/node.git
7+
cd ~/nodejs/node
8+
git remote add upstream https://github.com/nodejs/node.git
9+
git fetch upstream

scripts/fetch.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/install.sh

100644100755
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
5+
package_list="
6+
build-essential \
7+
ccache \
8+
curl \
9+
nano \
10+
python3 \
11+
python-setuptools \
12+
python3-pip \
13+
ninja-build \
14+
python3 \
15+
g++ \
16+
sudo \
17+
make \
18+
git \
19+
locales \
20+
gpg \
21+
wget"
22+
23+
# Install Packages
24+
apt-get update
25+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $package_list
26+
27+
# set up GitHub CLI resistry stuff to get gh CLI
128
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
229
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
30+
gh_package_list="gh"
331
apt-get update
4-
apt-get install -y gh build-essential ccache curl ninja-build python3 g++ make git
32+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $gh_package_list
33+
34+
# No Sudo Prompt - thanks Electron for this
35+
echo 'developer ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-developer
36+
echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep

scripts/mkdir.sh

100644100755
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
mkdir nodejs
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
5+
mkdir ~/nodejs
6+
mkdir -p ~/ninja/out/Release

scripts/ncu.sh

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
15
npm install -g node-core-utils
26

37
ncu-config set upstream upstream
4-
ncu-config set branch master
8+
ncu-config set branch master

scripts/setup-origin.sh

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # Exit with nonzero exit code if anything fails
4+
15
if [[ -z "${ORIGIN_URL}" ]]
26
then
37
echo "ORIGIN_URL is not set"
48
else
59
git remote set-url origin ${ORIGIN_URL}
6-
fi
10+
fi

scripts/tests.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)