Skip to content

Commit

Permalink
build: simplify git repo checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Mar 13, 2023
1 parent b48432e commit b45855c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
JAM_REPO=https://github.com/joinmarket-webui/jam
JAM_REPO_BRANCH=master
JAM_REPO_REF=v0.1.5

JM_SERVER_REPO=https://github.com/JoinMarket-Org/joinmarket-clientserver
JM_SERVER_REPO_BRANCH=master
JM_SERVER_REPO_REF=v0.9.9
3 changes: 0 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ docker build --label "local" \

#### Build args
- `JAM_REPO` (ui git repo; defaults to `https://github.com/joinmarket-webui/jam`)
- `JAM_REPO_BRANCH` (ui git branch; defaults to `master`)
- `JAM_REPO_REF` (ui git ref; defaults to `master`)

### Inspecting the Container
Expand Down Expand Up @@ -85,11 +84,9 @@ docker build --label "local" \

#### Build args
- `JAM_REPO` (ui git repo; defaults to `https://github.com/joinmarket-webui/jam`)
- `JAM_REPO_BRANCH` (ui git branch; defaults to `master`)
- `JAM_REPO_REF` (ui git ref; defaults to `master`)
---
- `JM_SERVER_REPO` (server git repo; defaults to `https://github.com/JoinMarket-Org/joinmarket-clientserver`)
- `JM_SERVER_REPO_BRANCH` (server git branch; defaults to `master`)
- `JM_SERVER_REPO_REF` (server git ref; defaults to `master`)

### Inspecting the Container
Expand Down
12 changes: 2 additions & 10 deletions standalone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
ARG MAINTAINER='Jam https://github.com/joinmarket-webui'

ARG JAM_REPO=https://github.com/joinmarket-webui/jam
ARG JAM_REPO_BRANCH=master
ARG JAM_REPO_REF=master

ARG JM_SERVER_REPO=https://github.com/JoinMarket-Org/joinmarket-clientserver
ARG JM_SERVER_REPO_BRANCH=master
ARG JM_SERVER_REPO_REF=master

# --- Builder base
Expand All @@ -18,7 +16,6 @@ RUN apk add --no-cache --update git
# --- UI builder
FROM builder-base AS ui-builder
ARG JAM_REPO
ARG JAM_REPO_BRANCH
ARG JAM_REPO_REF

# install build dependencies
Expand All @@ -27,9 +24,7 @@ RUN apk add --no-cache --update nodejs npm
WORKDIR /usr/src/jam

# checkout and build project
RUN git clone "$JAM_REPO" . --depth=1 --branch "$JAM_REPO_BRANCH" \
&& git fetch --all --tags \
&& git checkout "$JAM_REPO_REF" \
RUN git clone "$JAM_REPO" . --depth=1 --branch "$JAM_REPO_REF" \
&& npm install --no-fund --no-audit \
&& npm run build
# --- UI builder - end
Expand Down Expand Up @@ -58,14 +53,11 @@ RUN git clone "https://github.com/davmac314/dinit" . --depth=1 --branch "v0.16.1
# --- SERVER builder
FROM builder-base AS server-builder
ARG JM_SERVER_REPO
ARG JM_SERVER_REPO_BRANCH
ARG JM_SERVER_REPO_REF

WORKDIR /usr/src/joinmarket-clientserver

RUN git clone "$JM_SERVER_REPO" . --depth=1 --branch "$JM_SERVER_REPO_BRANCH" \
&& git fetch --all --tags \
&& git checkout "$JM_SERVER_REPO_REF"
RUN git clone "$JM_SERVER_REPO" . --depth=1 --branch "$JM_SERVER_REPO_REF"
# --- SERVER builder - end

# --- RUNTIME builder
Expand Down
6 changes: 1 addition & 5 deletions ui-only/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
ARG MAINTAINER='Jam https://github.com/joinmarket-webui'

ARG JAM_REPO=https://github.com/joinmarket-webui/jam
ARG JAM_REPO_BRANCH=master
ARG JAM_REPO_REF=master

FROM alpine:3.16.2 AS builder-base
Expand All @@ -13,15 +12,12 @@ RUN apk add --no-cache --update git nodejs npm
# ---
FROM builder-base AS builder
ARG JAM_REPO
ARG JAM_REPO_BRANCH
ARG JAM_REPO_REF

WORKDIR /usr/src/app

# checkout and build project
RUN git clone "$JAM_REPO" . --depth=1 --branch "$JAM_REPO_BRANCH" \
&& git fetch --all --tags \
&& git checkout "$JAM_REPO_REF" \
RUN git clone "$JAM_REPO" . --depth=1 --branch "$JAM_REPO_REF" \
&& npm install --no-fund --no-audit \
&& npm run build

Expand Down

0 comments on commit b45855c

Please sign in to comment.