File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 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
1414
1515GEM_CACHE_DIR=" ${GITLAB_BUILD_DIR} /cache"
1616
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+
1733GOROOT=/tmp/go
1834PATH=${GOROOT} /bin:$PATH
1935
@@ -97,9 +113,9 @@ BUNDLER_VERSION="$(grep "BUNDLED WITH" ${GITLAB_INSTALL_DIR}/Gemfile.lock -A 1 |
97113gem install bundler:" ${BUNDLER_VERSION} "
98114
99115# 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} ( ${PLATFORM} ) ..."
117+ wget -cnv https://storage.googleapis.com/golang/${GOLANG_ARCHIVE} -P ${GITLAB_BUILD_DIR} /
118+ tar -xf ${GITLAB_BUILD_DIR} /${GOLANG_ARCHIVE} -C /tmp/
103119
104120# install gitlab-shell
105121echo " Downloading gitlab-shell v.${GITLAB_SHELL_VERSION} ..."
@@ -159,7 +175,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR}
159175
160176# remove go
161177go clean --modcache
162- rm -rf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz ${GOROOT}
178+ rm -rf ${GITLAB_BUILD_DIR} /${GOLANG_ARCHIVE} ${GOROOT}
163179
164180# remove HSTS config from the default headers, we configure it in nginx
165181exec_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