Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
GitLab Runner Scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
GitLab Runner Scripts
Commits
4e69dde3
Commit
4e69dde3
authored
Jul 14, 2020
by
Michał Kępień
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'michal/use-CUSTOM_ENV_CI_JOB_IMAGE' into 'main'
Use CUSTOM_ENV_CI_JOB_IMAGE See merge request
!5
parents
be3f09fd
42f67e3b
Pipeline
#46749
passed with stage
in 6 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
24 deletions
+2
-24
libvirt-qemu/README.md
libvirt-qemu/README.md
+0
-9
libvirt-qemu/executor.sh
libvirt-qemu/executor.sh
+2
-15
No files found.
libvirt-qemu/README.md
View file @
4e69dde3
...
...
@@ -89,15 +89,6 @@ libvirt domains (over SSH).
redirects COM1 to a file which can be inspected on the host in case of
boot issues.
-
[
GitLab Runner Docker executor
][
3
]
uses the
`image`
keyword for
determining which Docker image to use. The contents of that keyword
are not exposed as an environment variable by the
[
GitLab Runner
Custom executor
][
4
]
and thus it cannot be used for determining the
operating system image to use. Instead, the latter is extracted from
the job name. The QCOW2 image file path is derived from the detected
operating system name and release (see the
`do_prepare()`
function in
`executor.sh`
for hints on expected file naming).
## QCOW2 Image Synchronization
Whenever
[
GitLab Runner Docker executor
][
3
]
runs a GitLab CI job, it
...
...
libvirt-qemu/executor.sh
View file @
4e69dde3
...
...
@@ -18,10 +18,6 @@ CONFIG_PATH="/etc/gitlab-runner/executor-libvirt-qemu.conf"
# shellcheck source=executor.conf.sample
.
"
${
CONFIG_PATH
}
"
CENTOS_RELEASE
=
"
$(
expr
"
${
CUSTOM_ENV_CI_JOB_NAME
}
"
:
".*:el
\(
[6-8]
\)\(
:
\|
$\
)"
||
:
)
"
OPENBSD_RELEASE
=
"
$(
expr
"
${
CUSTOM_ENV_CI_JOB_NAME
}
"
:
".*:openbsd
\(
[0-9][0-9.]*
\)\(
:
\|
$\
)"
||
:
)
"
FREEBSD_RELEASE
=
"
$(
expr
"
${
CUSTOM_ENV_CI_JOB_NAME
}
"
:
".*:freebsd
\(
[0-9][0-9.]*
\)\(
:
\|
$\
)"
||
:
)
"
BASE_IMAGE_DIR
=
"
${
BASE_DIR
}
/qcow2"
RUNNER_NAME
=
"runner-
${
CUSTOM_ENV_CI_JOB_ID
}
"
DOMAIN_DEFINITION_PATH
=
"
${
BASE_DIR
}
/
${
RUNNER_NAME
}
.xml"
...
...
@@ -50,18 +46,9 @@ do_config() {
}
do_prepare
()
{
if
[
-n
"
${
CENTOS_RELEASE
}
"
]
;
then
BASE_IMAGE_PATH
=
"
$(
readlink
-f
"
${
BASE_IMAGE_DIR
}
/centos-
${
CENTOS_RELEASE
}
-x86_64"
)
"
elif
[
-n
"
${
FREEBSD_RELEASE
}
"
]
;
then
BASE_IMAGE_PATH
=
"
$(
readlink
-f
"
${
BASE_IMAGE_DIR
}
/freebsd-
${
FREEBSD_RELEASE
}
-x86_64"
)
"
elif
[
-n
"
${
OPENBSD_RELEASE
}
"
]
;
then
BASE_IMAGE_PATH
=
"
$(
readlink
-f
"
${
BASE_IMAGE_DIR
}
/openbsd-
${
OPENBSD_RELEASE
}
-x86_64"
)
"
else
fatal_error
"Unable to extract OS to use from job name (
${
CUSTOM_ENV_CI_JOB_NAME
}
)"
fi
BASE_IMAGE_PATH
=
"
$(
readlink
-f
"
${
BASE_IMAGE_DIR
}
/
${
CUSTOM_ENV_CI_JOB_IMAGE
}
"
)
"
if
[
!
-f
"
${
BASE_IMAGE_PATH
}
"
]
;
then
fatal_error
"Base image
${
BASE_IMAGE_PATH
}
does not exist"
fatal_error
"Base image
${
CUSTOM_ENV_CI_JOB_IMAGE
}
does not exist"
fi
cp
"
${
DOMAIN_DEFINITION_TEMPLATE_PATH
}
"
"
${
DOMAIN_DEFINITION_PATH
}
"
...
...
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