@@ -14,10 +14,27 @@ 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
2036export GOROOT PATH
37+ export GOPROXY=" https://proxy.golang.org"
2138
2239BUILD_DEPENDENCIES=" gcc g++ make patch pkg-config cmake paxctl \
2340 libc6-dev \
@@ -104,9 +121,9 @@ BUNDLER_VERSION="$(grep "BUNDLED WITH" ${GITLAB_INSTALL_DIR}/Gemfile.lock -A 1 |
104121gem install bundler:" ${BUNDLER_VERSION} "
105122
106123# download golang
107- echo " Downloading Go ${GOLANG_VERSION} ..."
108- wget -cnv https://storage.googleapis.com/golang/go ${GOLANG_VERSION} .linux-amd64.tar.gz -P ${GITLAB_BUILD_DIR} /
109- tar -xf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz -C /tmp/
124+ echo " Downloading Go ${GOLANG_VERSION} for ${PLATFORM_NAME} ..."
125+ wget -cnv https://storage.googleapis.com/golang/${GOLANG_ARCHIVE} -P ${GITLAB_BUILD_DIR} /
126+ tar -xf ${GITLAB_BUILD_DIR} /${GOLANG_ARCHIVE} -C /tmp/
110127
111128# install gitlab-shell
112129echo " Downloading gitlab-shell v.${GITLAB_SHELL_VERSION} ..."
@@ -154,7 +171,7 @@ git clone -q -b v${GITALY_SERVER_VERSION} --depth 1 ${GITLAB_GITALY_URL} ${GITLA
154171make -C ${GITLAB_GITALY_BUILD_DIR} install
155172mkdir -p ${GITLAB_GITALY_INSTALL_DIR}
156173# The following line causes some issues. However, according to
157- # <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5512> and
174+ # <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5512> and
158175# <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5671> there seems to
159176# be some attempts to remove ruby from gitaly.
160177#
@@ -171,7 +188,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR}
171188
172189# remove go
173190go clean --modcache
174- rm -rf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz ${GOROOT}
191+ rm -rf ${GITLAB_BUILD_DIR:? } / ${GOLANG_ARCHIVE} ${GOROOT}
175192
176193# remove HSTS config from the default headers, we configure it in nginx
177194exec_as_git sed -i " /headers\['Strict-Transport-Security'\]/d" ${GITLAB_INSTALL_DIR} /app/controllers/application_controller.rb
@@ -212,7 +229,7 @@ chown ${GITLAB_USER}: ${GITLAB_INSTALL_DIR}/config/database.yml
212229exec_as_git yarn install --production --pure-lockfile
213230
214231echo " Compiling assets. Please be patient, this could take a while..."
215- exec_as_git bundle exec rake gitlab:assets:compile USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS=" --max-old-space-size=4096 "
232+ exec_as_git bundle exec rake gitlab:assets:compile USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS=" --max-old-space-size=8192 "
216233
217234# remove auto generated ${GITLAB_DATA_DIR}/config/secrets.yml
218235rm -rf ${GITLAB_DATA_DIR} /config/secrets.yml
0 commit comments