UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Containers
G
GitLab
Gitlab
gitlab-task-runner
Commits
0de28de3
Verified
Commit
0de28de3
authored
Jun 22, 2021
by
DJ Mountney
Browse files
Update GitLab to the 14.0.0 Major Release
parent
04ff40a4
Pipeline
#330008
failed with stages
in 3 minutes
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
21 deletions
+21
-21
Dockerfile
Dockerfile
+2
-2
build-scripts/build.sh
build-scripts/build.sh
+1
-1
hardening_manifest.yaml
hardening_manifest.yaml
+7
-7
scripts/bin/backup-utility
scripts/bin/backup-utility
+1
-1
scripts/lib/object_storage_backup.rb
scripts/lib/object_storage_backup.rb
+10
-10
No files found.
Dockerfile
View file @
0de28de3
ARG
GITLAB_VERSION=v1
3.12.2
-ubi8
ARG
GITLAB_VERSION=v1
4.0.0
-ubi8
ARG
BASE_REGISTRY=nexus-docker-secure.levelup-nexus.svc.cluster.local:18082
ARG
BASE_REGISTRY=nexus-docker-secure.levelup-nexus.svc.cluster.local:18082
ARG
BASE_IMAGE=gitlab/gitlab/gitlab-rails
ARG
BASE_IMAGE=gitlab/gitlab/gitlab-rails
ARG
BASE_TAG=1
3.12.2
ARG
BASE_TAG=1
4.0.0
ARG
RAILS_IMAGE=${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
ARG
RAILS_IMAGE=${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
...
...
build-scripts/build.sh
View file @
0de28de3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
set
-euxo
pipefail
set
-euxo
pipefail
TAG
=
${
1
:-
1
3
.12.2
}
TAG
=
${
1
:-
1
4
.0.0
}
REPOSITORY
=
${
2
:-}
REPOSITORY
=
${
2
:-}
DOCKER_OPTS
=
${
DOCKER_OPTS
:-
""
}
DOCKER_OPTS
=
${
DOCKER_OPTS
:-
""
}
...
...
hardening_manifest.yaml
View file @
0de28de3
...
@@ -5,12 +5,12 @@ name: "gitlab/gitlab/gitlab-task-runner"
...
@@ -5,12 +5,12 @@ name: "gitlab/gitlab/gitlab-task-runner"
# The most specific version should be the first tag and will be shown
# The most specific version should be the first tag and will be shown
# on ironbank.dsop.io
# on ironbank.dsop.io
tags
:
tags
:
-
"
1
3.12.2
"
-
"
1
4.0.0
"
-
"
latest"
-
"
latest"
# Build args passed to Dockerfile ARGs
# Build args passed to Dockerfile ARGs
args
:
args
:
BASE_IMAGE
:
"
gitlab/gitlab/gitlab-rails"
BASE_IMAGE
:
"
gitlab/gitlab/gitlab-rails"
BASE_TAG
:
"
1
3.12.2
"
BASE_TAG
:
"
1
4.0.0
"
# Docker image labels
# Docker image labels
labels
:
labels
:
org.opencontainers.image.title
:
"
Gitlab
Task
Runner"
org.opencontainers.image.title
:
"
Gitlab
Task
Runner"
...
@@ -22,7 +22,7 @@ labels:
...
@@ -22,7 +22,7 @@ labels:
org.opencontainers.image.url
:
"
https://about.gitlab.com/"
org.opencontainers.image.url
:
"
https://about.gitlab.com/"
## Name of the distributing entity, organization or individual
## Name of the distributing entity, organization or individual
org.opencontainers.image.vendor
:
"
Gitlab"
org.opencontainers.image.vendor
:
"
Gitlab"
org.opencontainers.image.version
:
"
1
3.12.2
"
org.opencontainers.image.version
:
"
1
4.0.0
"
## Keywords to help with search (ex. "cicd,gitops,golang")
## Keywords to help with search (ex. "cicd,gitops,golang")
mil.dso.ironbank.image.keywords
:
"
gitlab,
git,
gitops"
mil.dso.ironbank.image.keywords
:
"
gitlab,
git,
gitops"
## This value can be "opensource" or "commercial"
## This value can be "opensource" or "commercial"
...
@@ -43,13 +43,13 @@ maintainers:
...
@@ -43,13 +43,13 @@ maintainers:
username
:
"
alfontaine"
username
:
"
alfontaine"
email
:
"
alan.fontaine@centauricorp.com"
email
:
"
alan.fontaine@centauricorp.com"
resources
:
resources
:
-
url
:
"
https://gitlab-ubi.s3.amazonaws.com/ubi8-build-dependencies-v1
3.12.2
-ubi8/gitlab-task-runner-ee.tar.gz"
-
url
:
"
https://gitlab-ubi.s3.amazonaws.com/ubi8-build-dependencies-v1
4.0.0
-ubi8/gitlab-task-runner-ee.tar.gz"
filename
:
"
gitlab-task-runner-ee.tar.gz"
filename
:
"
gitlab-task-runner-ee.tar.gz"
validation
:
validation
:
type
:
"
sha256"
type
:
"
sha256"
value
:
"
fcc8fde5e263dc8d53cbd5fbd09db0b01e2ec6b1174730d5cde2f689e620a2f6
"
value
:
"
bf8db92af98abe995f4411a73acede96a01da96b5fee5915173a05fe6605d15d
"
-
url
:
"
https://gitlab-ubi.s3.amazonaws.com/ubi8-build-dependencies-v1
3.12.2
-ubi8/gitlab-python.tar.gz"
-
url
:
"
https://gitlab-ubi.s3.amazonaws.com/ubi8-build-dependencies-v1
4.0.0
-ubi8/gitlab-python.tar.gz"
filename
:
"
gitlab-python.tar.gz"
filename
:
"
gitlab-python.tar.gz"
validation
:
validation
:
type
:
"
sha256"
type
:
"
sha256"
value
:
"
504cc701f686141196608dbd60aa23150d1e8c1b14564e6bcd6b5bdbb1ece21d
"
value
:
"
48068e0e17bb7f3083861f050cad709115360c072e89cce31566def73760c723
"
scripts/bin/backup-utility
View file @
0de28de3
...
@@ -109,7 +109,7 @@ function get_existing_backups(){
...
@@ -109,7 +109,7 @@ function get_existing_backups(){
# Example: TIMESTAMP_YYYY_MM_DD_VERSION_gitlab_backup.tar
# Example: TIMESTAMP_YYYY_MM_DD_VERSION_gitlab_backup.tar
case
$BACKUP_BACKEND
in
case
$BACKUP_BACKEND
in
s3
)
s3
)
existing_backups
=(
$(
s3cmd
ls
s3://
$BACKUP_BUCKET_NAME
--rinclude
'^\d{10}_\d{4}_\d{2}_\d{2}_.+_gitlab_backup.tar$'
|
awk
'{print $4}'
|
LC_ALL
=
C
sort
)
)
existing_backups
=(
$(
s3cmd
${
S3_CMD_BACKUP_OPTION
}
ls
s3://
$BACKUP_BUCKET_NAME
--rinclude
'^\d{10}_\d{4}_\d{2}_\d{2}_.+_gitlab_backup.tar$'
|
awk
'{print $4}'
|
LC_ALL
=
C
sort
)
)
;;
;;
gcs
)
gcs
)
# Note: gsutil doesn't support regex, so we need to try to match the prefix as best we can with wildcards
# Note: gsutil doesn't support regex, so we need to try to match the prefix as best we can with wildcards
...
...
scripts/lib/object_storage_backup.rb
View file @
0de28de3
...
@@ -41,7 +41,7 @@ class ObjectStorageBackup
...
@@ -41,7 +41,7 @@ class ObjectStorageBackup
FileUtils
.
mkdir_p
(
"/srv/gitlab/tmp/
#{
@name
}
"
,
mode:
0700
)
FileUtils
.
mkdir_p
(
"/srv/gitlab/tmp/
#{
@name
}
"
,
mode:
0700
)
output
,
status
=
run_cmd
(
cmd
)
output
,
status
=
run_cmd
(
cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'creation of working directory'
,
output
)
unless
status
.
zero?
# check the destiation for contents. Bucket may have been empty.
# check the destiation for contents. Bucket may have been empty.
if
Dir
.
empty?
"/srv/gitlab/tmp/
#{
@name
}
"
if
Dir
.
empty?
"/srv/gitlab/tmp/
#{
@name
}
"
...
@@ -54,7 +54,7 @@ class ObjectStorageBackup
...
@@ -54,7 +54,7 @@ class ObjectStorageBackup
cmd
=
%W(tar -cf
#{
@local_tar_path
}
-I
#{
gzip_cmd
}
-C /srv/gitlab/tmp/
#{
@name
}
. )
cmd
=
%W(tar -cf
#{
@local_tar_path
}
-I
#{
gzip_cmd
}
-C /srv/gitlab/tmp/
#{
@name
}
. )
output
,
status
=
run_cmd
(
cmd
)
output
,
status
=
run_cmd
(
cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'archive'
,
output
)
unless
status
.
zero?
puts
"done"
.
green
puts
"done"
.
green
end
end
...
@@ -68,9 +68,9 @@ class ObjectStorageBackup
...
@@ -68,9 +68,9 @@ class ObjectStorageBackup
puts
"done"
.
green
puts
"done"
.
green
end
end
def
failure_abort
(
error_message
)
def
failure_abort
(
action
,
error_message
)
puts
"[Error]
#{
error_message
}
"
.
red
puts
"[Error]
#{
error_message
}
"
.
red
abort
"
Restore
#{
@name
}
failed"
abort
"
#{
action
}
of
#{
@name
}
failed"
end
end
def
upload_to_object_storage
(
source_path
)
def
upload_to_object_storage
(
source_path
)
...
@@ -83,7 +83,7 @@ class ObjectStorageBackup
...
@@ -83,7 +83,7 @@ class ObjectStorageBackup
output
,
status
=
run_cmd
(
cmd
)
output
,
status
=
run_cmd
(
cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'upload'
,
output
)
unless
status
.
zero?
end
end
def
backup_existing
def
backup_existing
...
@@ -97,7 +97,7 @@ class ObjectStorageBackup
...
@@ -97,7 +97,7 @@ class ObjectStorageBackup
output
,
status
=
run_cmd
(
cmd
)
output
,
status
=
run_cmd
(
cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'sync existing'
,
output
)
unless
status
.
zero?
end
end
def
cleanup
def
cleanup
...
@@ -107,7 +107,7 @@ class ObjectStorageBackup
...
@@ -107,7 +107,7 @@ class ObjectStorageBackup
# Check if the bucket has any objects
# Check if the bucket has any objects
list_objects_cmd
=
%W(gsutil ls gs://
#{
@remote_bucket_name
}
/)
list_objects_cmd
=
%W(gsutil ls gs://
#{
@remote_bucket_name
}
/)
output
,
status
=
run_cmd
(
list_objects_cmd
)
output
,
status
=
run_cmd
(
list_objects_cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'GCS ls'
,
output
)
unless
status
.
zero?
# There are no objects in the bucket so skip the cleanup
# There are no objects in the bucket so skip the cleanup
if
output
.
length
==
0
if
output
.
length
==
0
...
@@ -117,20 +117,20 @@ class ObjectStorageBackup
...
@@ -117,20 +117,20 @@ class ObjectStorageBackup
cmd
=
%W(gsutil rm -f -r gs://
#{
@remote_bucket_name
}
/*)
cmd
=
%W(gsutil rm -f -r gs://
#{
@remote_bucket_name
}
/*)
end
end
output
,
status
=
run_cmd
(
cmd
)
output
,
status
=
run_cmd
(
cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'bucket cleanup'
,
output
)
unless
status
.
zero?
end
end
def
restore_from_backup
def
restore_from_backup
extracted_tar_path
=
File
.
join
(
File
.
dirname
(
@local_tar_path
),
"/srv/gitlab/tmp/
#{
@name
}
"
)
extracted_tar_path
=
File
.
join
(
File
.
dirname
(
@local_tar_path
),
"/srv/gitlab/tmp/
#{
@name
}
"
)
FileUtils
.
mkdir_p
(
extracted_tar_path
,
mode:
0700
)
FileUtils
.
mkdir_p
(
extracted_tar_path
,
mode:
0700
)
failure_abort
(
"
#{
@local_tar_path
}
not found"
)
unless
File
.
exist?
(
@local_tar_path
)
failure_abort
(
'restore'
,
"
#{
@local_tar_path
}
not found"
)
unless
File
.
exist?
(
@local_tar_path
)
untar_cmd
=
%W(tar -xf
#{
@local_tar_path
}
-C
#{
extracted_tar_path
}
)
untar_cmd
=
%W(tar -xf
#{
@local_tar_path
}
-C
#{
extracted_tar_path
}
)
output
,
status
=
run_cmd
(
untar_cmd
)
output
,
status
=
run_cmd
(
untar_cmd
)
failure_abort
(
output
)
unless
status
.
zero?
failure_abort
(
'un-archive'
,
output
)
unless
status
.
zero?
Dir
.
glob
(
"
#{
extracted_tar_path
}
/*"
).
each
do
|
file
|
Dir
.
glob
(
"
#{
extracted_tar_path
}
/*"
).
each
do
|
file
|
upload_to_object_storage
(
file
)
upload_to_object_storage
(
file
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment