Skip to content

Commit 41519b1

Browse files
committed
fix: build
Signed-off-by: Raccoon <[email protected]>
1 parent 209cd29 commit 41519b1

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

deployments/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ARG RUNTIME
2+
13
FROM hackmdio/buildpack:node-10-0baafb79 as BUILD
24

35
COPY --chown=hackmd:hackmd . .
@@ -14,9 +16,7 @@ RUN set -xe && \
1416
package-lock.json webpack.prod.js webpack.htmlexport.js webpack.dev.js webpack.common.js \
1517
config.json.example README.md CONTRIBUTING.md AUTHORS node_modules
1618

17-
ARG RUNTIME=hackmdio/runtime:node-10-0baafb79
18-
19-
FROM hackmdio/runtime:node-10-0baafb79
19+
FROM $RUNTIME
2020
USER hackmd
2121
WORKDIR /home/hackmd/app
2222
COPY --chown=1500:1500 --from=BUILD /home/hackmd/app .

deployments/build.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env bash
22

3+
set -euo pipefail
4+
set -x
5+
36
CURRENT_DIR=$(dirname "$BASH_SOURCE")
47

58
GIT_SHA1="$(git rev-parse HEAD)"
6-
GIT_SHORT_ID="${SHA1:0:8}"
7-
GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
9+
GIT_SHORT_ID="${GIT_SHA1:0:8}"
10+
GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/null || echo "")
811

912
DOCKER_TAG="${GIT_TAG:-$GIT_SHORT_ID}"
1013

11-
docker build -t "hackmdio/codimd:$DOCKER_TAG" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
14+
docker build --build-arg RUNTIME=hackmdio/runtime:node-10-0baafb79 -t "hackmdio/hackmd:$DOCKER_TAG" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
1215

13-
docker build --build-arg RUNTIME=node-10-cjk-0baafb79 -t "hackmdio/codimd:$DOCKER_TAG-cjk" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
16+
docker build --build-arg RUNTIME=hackmdio/runtime:node-10-cjk-0baafb79 -t "hackmdio/hackmd:$DOCKER_TAG-cjk" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."

0 commit comments

Comments
 (0)