@@ -14,10 +14,27 @@ 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
20
36
export GOROOT PATH
37
+ export GOPROXY=" https://proxy.golang.org"
21
38
22
39
BUILD_DEPENDENCIES=" gcc g++ make patch pkg-config cmake paxctl \
23
40
libc6-dev \
@@ -97,9 +114,9 @@ BUNDLER_VERSION="$(grep "BUNDLED WITH" ${GITLAB_INSTALL_DIR}/Gemfile.lock -A 1 |
97
114
gem install bundler:" ${BUNDLER_VERSION} "
98
115
99
116
# 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/
103
120
104
121
# install gitlab-shell
105
122
echo " 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
147
164
make -C ${GITLAB_GITALY_BUILD_DIR} install
148
165
mkdir -p ${GITLAB_GITALY_INSTALL_DIR}
149
166
# 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
151
168
# <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5671> there seems to
152
169
# be some attempts to remove ruby from gitaly.
153
170
#
@@ -164,7 +181,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR}
164
181
165
182
# remove go
166
183
go 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}
168
185
169
186
# remove HSTS config from the default headers, we configure it in nginx
170
187
exec_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
206
223
exec_as_git yarn add ajv@^4.0.0
207
224
208
225
echo " 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 "
210
227
211
228
# remove auto generated ${GITLAB_DATA_DIR}/config/secrets.yml
212
229
rm -rf ${GITLAB_DATA_DIR} /config/secrets.yml
0 commit comments