File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,22 @@ RUBY_SRC_URL=https://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION%.*}/ruby-${RUBY
14
14
15
15
GEM_CACHE_DIR=" ${GITLAB_BUILD_DIR} /cache"
16
16
17
+ # check system platform
18
+ # TODO: cover as many variations as possible (depending on the platform supported by golang)
19
+ case " $( uname -m) " in
20
+ " x86_64" )
21
+ PLATFORM_NAME=" amd64"
22
+ ;;
23
+ " aarch64" )
24
+ PLATFORM_NAME=" arm64"
25
+ ;;
26
+ * )
27
+ echo " The platform not supported ($( uname -a) )"
28
+ exit 1
29
+ esac
30
+
31
+ GOLANG_ARCHIVE=" go${GOLANG_VERSION} .linux-${PLATFORM_NAME} .tar.gz"
32
+
17
33
GOROOT=/tmp/go
18
34
PATH=${GOROOT} /bin:$PATH
19
35
@@ -97,9 +113,9 @@ BUNDLER_VERSION="$(grep "BUNDLED WITH" ${GITLAB_INSTALL_DIR}/Gemfile.lock -A 1 |
97
113
gem install bundler:" ${BUNDLER_VERSION} "
98
114
99
115
# download golang
100
- echo " Downloading Go ${GOLANG_VERSION} ..."
101
- wget -cnv https://storage.googleapis.com/golang/go ${GOLANG_VERSION} .linux-amd64.tar.gz -P ${GITLAB_BUILD_DIR} /
102
- tar -xf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz -C /tmp/
116
+ echo " Downloading Go ${GOLANG_VERSION} for ${PLATFORM_NAME} ..."
117
+ wget -cnv https://storage.googleapis.com/golang/${GOLANG_ARCHIVE} -P ${GITLAB_BUILD_DIR} /
118
+ tar -xf ${GITLAB_BUILD_DIR} /${GOLANG_ARCHIVE} -C /tmp/
103
119
104
120
# install gitlab-shell
105
121
echo " Downloading gitlab-shell v.${GITLAB_SHELL_VERSION} ..."
@@ -164,7 +180,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR}
164
180
165
181
# remove go
166
182
go clean --modcache
167
- rm -rf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz ${GOROOT}
183
+ rm -rf ${GITLAB_BUILD_DIR:? } / ${GOLANG_ARCHIVE} ${GOROOT}
168
184
169
185
# remove HSTS config from the default headers, we configure it in nginx
170
186
exec_as_git sed -i " /headers\['Strict-Transport-Security'\]/d" ${GITLAB_INSTALL_DIR} /app/controllers/application_controller.rb
You can’t perform that action at this time.
0 commit comments