Browse Source

Manually checkout related gitea commit

Piotr Orzechowski 6 months ago
parent
commit
7c463fefaf
2 changed files with 6 additions and 2 deletions
  1. 4
    2
      Dockerfile
  2. 2
    0
      build.sh

+ 4
- 2
Dockerfile View File

@@ -12,9 +12,11 @@ ENV GOPATH="/go"
12 12
 ENV SRC_DIR="${GOPATH}/src/code.gitea.io/gitea"
13 13
 WORKDIR "$SRC_DIR"
14 14
 
15
-ARG gitea_repo_url
16 15
 ARG gitea_version
17
-RUN set -eu; git clone --branch "v${gitea_version}" --depth 1 "$gitea_repo_url" "$SRC_DIR"
16
+ARG gitea_checksum
17
+ARG gitea_repo_url
18
+RUN set -eu; git clone --branch "v${gitea_version}" --depth 1 --no-checkout "$gitea_repo_url" .; \
19
+             git checkout "$gitea_checksum"
18 20
 
19 21
 ARG gitea_build_tags
20 22
 RUN set -eu; TAGS="$gitea_build_tags" make generate build

+ 2
- 0
build.sh View File

@@ -3,6 +3,7 @@
3 3
 set -eu
4 4
 
5 5
 gitea_version='1.2.3'
6
+gitea_checksum='09bd05732de61930c99509ee5a25816895f430a8'
6 7
 gitea_build_tags='bindata sqlite'
7 8
 gitea_repo_url='https://github.com/go-gitea/gitea.git'
8 9
 golang_version='1.9'
@@ -11,6 +12,7 @@ image_name='orzech/gitea'
11 12
 
12 13
 docker build \
13 14
   --build-arg gitea_version="$gitea_version" \
15
+  --build-arg gitea_checksum="$gitea_checksum" \
14 16
   --build-arg gitea_build_tags="$gitea_build_tags" \
15 17
   --build-arg gitea_repo_url="$gitea_repo_url" \
16 18
   --build-arg golang_version="$golang_version" \