@@ -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 \
@@ -97,9 +114,9 @@ BUNDLER_VERSION="$(grep "BUNDLED WITH" ${GITLAB_INSTALL_DIR}/Gemfile.lock -A 1 |
97114gem install bundler:" ${BUNDLER_VERSION} "
98115
99116# 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/
117+ echo " Downloading Go ${GOLANG_VERSION} for ${PLATFORM_NAME} ..."
118+ wget -cnv https://storage.googleapis.com/golang/${GOLANG_ARCHIVE} -P ${GITLAB_BUILD_DIR} /
119+ tar -xf ${GITLAB_BUILD_DIR} /${GOLANG_ARCHIVE} -C /tmp/
103120
104121# install gitlab-shell
105122echo " Downloading gitlab-shell v.${GITLAB_SHELL_VERSION} ..."
@@ -147,7 +164,7 @@ git clone -q -b v${GITALY_SERVER_VERSION} --depth 1 ${GITLAB_GITALY_URL} ${GITLA
147164make -C ${GITLAB_GITALY_BUILD_DIR} install
148165mkdir -p ${GITLAB_GITALY_INSTALL_DIR}
149166# The following line causes some issues. However, according to
150- # <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5512> and
167+ # <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5512> and
151168# <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5671> there seems to
152169# be some attempts to remove ruby from gitaly.
153170#
@@ -164,7 +181,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR}
164181
165182# remove go
166183go clean --modcache
167- rm -rf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz ${GOROOT}
184+ rm -rf ${GITLAB_BUILD_DIR:? } / ${GOLANG_ARCHIVE} ${GOROOT}
168185
169186# remove HSTS config from the default headers, we configure it in nginx
170187exec_as_git sed -i " /headers\['Strict-Transport-Security'\]/d" ${GITLAB_INSTALL_DIR} /app/controllers/application_controller.rb
@@ -206,7 +223,7 @@ exec_as_git yarn install --production --pure-lockfile
206223exec_as_git yarn add ajv@^4.0.0
207224
208225echo " Compiling assets. Please be patient, this could take a while..."
209- exec_as_git bundle exec rake gitlab:assets:compile USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS=" --max-old-space-size=4096 "
226+ exec_as_git bundle exec rake gitlab:assets:compile USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS=" --max-old-space-size=8192 "
210227
211228# remove auto generated ${GITLAB_DATA_DIR}/config/secrets.yml
212229rm -rf ${GITLAB_DATA_DIR} /config/secrets.yml
0 commit comments