@@ -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
# TODO Verify, if this is necessary or not.
23
40
# BUILD_DEPENDENCIES="gcc g++ make patch pkg-config cmake paxctl \
@@ -109,9 +126,9 @@ BUNDLER_VERSION="$(grep "BUNDLED WITH" ${GITLAB_INSTALL_DIR}/Gemfile.lock -A 1 |
109
126
gem install bundler:" ${BUNDLER_VERSION} "
110
127
111
128
# download golang
112
- echo " Downloading Go ${GOLANG_VERSION} ..."
113
- wget -cnv https://storage.googleapis.com/golang/go ${GOLANG_VERSION} .linux-amd64.tar.gz -P ${GITLAB_BUILD_DIR} /
114
- tar -xf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz -C /tmp/
129
+ echo " Downloading Go ${GOLANG_VERSION} for ${PLATFORM_NAME} ..."
130
+ wget -cnv https://storage.googleapis.com/golang/${GOLANG_ARCHIVE} -P ${GITLAB_BUILD_DIR} /
131
+ tar -xf ${GITLAB_BUILD_DIR} /${GOLANG_ARCHIVE} -C /tmp/
115
132
116
133
# install gitlab-shell
117
134
echo " Downloading gitlab-shell v.${GITLAB_SHELL_VERSION} ..."
@@ -156,7 +173,7 @@ git clone -q -b v${GITALY_SERVER_VERSION} --depth 1 ${GITLAB_GITALY_URL} ${GITLA
156
173
make -C ${GITLAB_GITALY_BUILD_DIR} install
157
174
mkdir -p ${GITLAB_GITALY_INSTALL_DIR}
158
175
# The following line causes some issues. However, according to
159
- # <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5512> and
176
+ # <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5512> and
160
177
# <https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5671> there seems to
161
178
# be some attempts to remove ruby from gitaly.
162
179
#
@@ -173,7 +190,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR}
173
190
174
191
# remove go
175
192
go clean --modcache
176
- rm -rf ${GITLAB_BUILD_DIR} /go ${GOLANG_VERSION} .linux-amd64.tar.gz ${GOROOT}
193
+ rm -rf ${GITLAB_BUILD_DIR:? } / ${GOLANG_ARCHIVE} ${GOROOT}
177
194
178
195
# revert `rake gitlab:setup` changes from gitlabhq/gitlabhq@a54af831bae023770bf9b2633cc45ec0d5f5a66a
179
196
exec_as_git sed -i ' s/db:reset/db:setup/' ${GITLAB_INSTALL_DIR} /lib/tasks/gitlab/setup.rake
0 commit comments