Skip to content

Commit 90e713f

Browse files
feat(devcontainer): Alternate repo selection
1 parent 7470e4a commit 90e713f

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

packages/kittensgame/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
FROM docker.io/library/node:20.10.0-bookworm@sha256:8d0f16fe841577f9317ab49011c6d819e1fa81f8d4af7ece7ae0ac815e07ac84
22

3+
ARG REPO=https://github.com/nuclear-unicorn/kittensgame.git
34
ARG BRANCH=master
45

56
EXPOSE 8080
67
EXPOSE 8086
78

8-
RUN git clone --branch $BRANCH --single-branch https://github.com/nuclear-unicorn/kittensgame.git \
9+
RUN git clone --branch "$BRANCH" --single-branch "$REPO" \
910
&& cd kittensgame \
11+
&& git pull \
1012
&& yarn add -D watch-http-server \
1113
&& yarn install
1214

packages/kittensgame/scripts/build-development-container.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ cd "$(dirname "$0")"
1111

1212
main() {
1313
BRANCH=${1:-master}
14+
REPO=${2:-https://github.com/nuclear-unicorn/kittensgame.git}
1415

15-
echo "Building development container on $BRANCH branch..."
16+
echo "Building development container on $BRANCH branch of $REPO..."
1617
cd ..
1718
podman build \
1819
--build-arg BRANCH="$BRANCH" \
20+
--build-arg REPO="$REPO" \
1921
--tag kittensgame .
2022
echo "Done."
2123
}

packages/kittensgame/scripts/rebuild-development-container.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ cd "$(dirname "$0")"
1111

1212
main() {
1313
BRANCH=${1:-master}
14+
REPO=${2:-https://github.com/nuclear-unicorn/kittensgame.git}
1415

15-
echo "Re-Building development container on $BRANCH branch..."
16+
echo "Re-Building development container on $BRANCH branch of $REPO..."
1617
cd ..
1718
podman build \
1819
--build-arg BRANCH="$BRANCH" \
20+
--build-arg REPO="$REPO" \
1921
--no-cache \
2022
--tag kittensgame .
2123
echo "Done."

packages/kittensgame/scripts/run-development-container.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ cd "$(dirname "$0")"
1212
main() {
1313
BASEDIR=$(pwd)
1414
BRANCH=${1:-master}
15+
REPO=${2:-https://github.com/nuclear-unicorn/kittensgame.git}
1516

1617
yarn kitten-scientists:build
17-
yarn devcontainer:build "$BRANCH"
18+
yarn devcontainer:build "$BRANCH" "$REPO"
1819

1920
echo "Removing previous container..."
2021
podman stop kittensgame > /dev/null || true

0 commit comments

Comments
 (0)