Please help fill in this template with all the details to help others help you more efficiently. Use formatting blocks for code, config, logs and ensure to remove sensitive data.
Problem to solve
I created a gitlab-ci.yml file with this content:
stages:
- build-iso
# --- Reusable bits (anchors) ---
.default_vars: &default_vars
RELEASEVER: "42"
ISO_BASENAME: "athenaos-live"
.common_before: &common_before
- dnf install -y lorax pykickstart git anaconda sshpass rsync gh
- git config --global user.email "littleowl@athenaos.org"
- git config --global user.name "Little Owl"
- git remote set-url origin "https://gitlab-ci-token:${CI_PUSH_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"
# ---------- x86_64 ----------
build-iso:x86_64:
stage: build-iso
image: fedora:latest # pulls x86_64 on an x86_64 runner
#tags:
# - x86_64 # <-- your x86_64 runner tag
when: manual # keep manual like your original
variables:
<<: *default_vars
ARCH: "x86_64"
OUTDIR: "results/${ARCH}"
ISO_NAME: "${ISO_BASENAME}-${ARCH}.iso"
before_script: *common_before
script:
- mkdir -p "${OUTDIR}"
- livemedia-creator --make-iso --ks athena-iso.ks --no-virt \
--iso-only --iso-name "${ISO_NAME}" --resultdir "${OUTDIR}" \
--releasever "${RELEASEVER}"
- sha256sum "${OUTDIR}/${ISO_NAME}" | tee "${OUTDIR}/${ISO_NAME}.sha256"
- sshpass -p "${MIRROR_SECRET}" rsync -avzzlr --delete \
-e "ssh -p 1027 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
"${OUTDIR}/${ISO_NAME}" "${OUTDIR}/${ISO_NAME}.sha256" \
"${MIRROR_USER}@hub.athenaos.org:/srv/mirrors/athena-images/rolling/"
- gh release upload "v23.11" "${OUTDIR}/${ISO_NAME}" --repo Athena-OS/athena --clobber
artifacts:
when: always
paths:
- "${OUTDIR}/"
# ---------- aarch64 ----------
build-iso:aarch64:
stage: build-iso
image: fedora:latest # pulls aarch64 on an ARM64 runner
tags:
- saas-linux-small-arm64 # <-- your ARM64 runner tag
when: manual
variables:
<<: *default_vars
ARCH: "aarch64"
OUTDIR: "results/${ARCH}"
ISO_NAME: "${ISO_BASENAME}-${ARCH}.iso"
before_script: *common_before
script:
- mkdir -p "${OUTDIR}"
- livemedia-creator --make-iso --ks athena-iso.ks --no-virt \
--iso-only --iso-name "${ISO_NAME}" --resultdir "${OUTDIR}" \
--releasever "${RELEASEVER}"
- sha256sum "${OUTDIR}/${ISO_NAME}" | tee "${OUTDIR}/${ISO_NAME}.sha256"
- sshpass -p "${MIRROR_SECRET}" rsync -avzzlr --delete \
-e "ssh -p 1027 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
"${OUTDIR}/${ISO_NAME}" "${OUTDIR}/${ISO_NAME}.sha256" \
"${MIRROR_USER}@hub.athenaos.org:/srv/mirrors/athena-images/rolling/"
- gh release upload "v23.11" "${OUTDIR}/${ISO_NAME}" --repo Athena-OS/athena --clobber
artifacts:
when: always
paths:
- "${OUTDIR}/"
When I run the jobs, they file due to:
$ livemedia-creator --make-iso --ks athena-iso.ks --no-virt \ --iso-only --iso-name "${ISO_NAME}" --resultdir "${OUTDIR}" \ --releasever "${RELEASEVER}"
usage: livemedia-creator [-h] (--make-iso | --make-disk | --make-fsimage |
--make-appliance | --make-ami | --make-tar |
--make-tar-disk | --make-pxe-live |
--make-ostree-live | --make-oci | --make-vagrant)
[--iso ISO] [--iso-only] [--iso-name ISO_NAME]
[--ks KS] [--image-only] [--no-virt] [--proxy PROXY]
[--anaconda-arg ANACONDA_ARGS]
[--armplatform ARMPLATFORM] [--location LOCATION]
[--logfile LOGFILE]
[--lorax-templates LORAX_TEMPLATES] [--tmp TMP]
[--resultdir RESULT_DIR] [--macboot] [--nomacboot]
[--extra-boot-args EXTRA_BOOT_ARGS] [-r RELEASE]
[-t VARIANT] [-b URL] [--isfinal]
[--disk-image DISK_IMAGE] [--keep-image]
[--fs-image FS_IMAGE] [--image-name IMAGE_NAME]
[--tar-disk-name TAR_DISK_NAME] [--fs-label FS_LABEL]
[--image-size-align IMAGE_SIZE_ALIGN]
[--image-type IMAGE_TYPE] [--qemu-arg QEMU_ARGS]
[--qcow2] [--qcow2-arg QEMU_ARGS]
[--compression COMPRESSION]
[--compress-arg COMPRESS_ARGS] [--app-name APP_NAME]
[--app-template APP_TEMPLATE] [--app-file APP_FILE]
[--ram MEMORY] [--cpu CPU] [--vcpus VCPUS]
[--vnc VNC] [--arch ARCH] [--kernel-args KERNEL_ARGS]
[--firmware FW_PATH] [--virt-uefi] [--no-kvm]
[--with-rng WITH_RNG] [--dracut-conf DRACUT_CONF]
[--dracut-arg DRACUT_ARGS]
[--live-rootfs-size LIVE_ROOTFS_SIZE]
[--live-rootfs-keep-size] [--oci-config OCI_CONFIG]
[--oci-runtime OCI_RUNTIME]
[--vagrant-metadata VAGRANT_METADATA]
[--vagrantfile VAGRANTFILE] [--project PRODUCT]
[-p PRODUCT] [--releasever RELEASEVER]
[--volid VOLID] [--squashfs-only]
[--rootfs-type ROOTFSTYPE] [--timeout TIMEOUT] [-V]
livemedia-creator: error: unrecognized arguments: --iso-only --releasever 42
so, it seems that it is not reading \
for multiline.
In the past, when I only used a single job with:
stages:
- build-iso
build-iso:
image: fedora:latest
stage: build-iso
when: manual
before_script:
- dnf install -y lorax pykickstart git anaconda sshpass rsync gh
- git config --global user.email "littleowl@athenaos.org"
- git config --global user.name "Little Owl"
- git remote set-url origin "https://gitlab-ci-token:${CI_PUSH_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"
script:
#- git clone https://pagure.io/fedora-kickstarts.git
#- cp athena-iso.ks fedora-kickstarts/athena-iso.ks
#- cd fedora-kickstarts
#- ksflatten -c athena-iso.ks -o athena-flatten.ks
- livemedia-creator --make-iso --ks athena-iso.ks --no-virt --iso-only --iso-name athenaos-live-x86_64.iso --resultdir ./results --releasever 42
- sha256sum ./results/athenaos-live-x86_64.iso | tee ./results/athenaos-live-x86_64.iso.sha256
- sshpass -p "${MIRROR_SECRET}" rsync -avzzlr --delete -e "ssh -p 1027 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" results/athenaos-live-x86_64.iso results/athenaos-live-x86_64.iso.sha256 ${MIRROR_USER}@hub.athenaos.org:/srv/mirrors/athena-images/rolling/
it worked.
Why on my new use case with two jobs, I cannot use multiline by \
?
Steps to reproduce
Just create a test repository with this .ks file and run a GitLab CI with the following file:
stages:
- build-iso
# --- Reusable bits (anchors) ---
.default_vars: &default_vars
RELEASEVER: "42"
ISO_BASENAME: "athenaos-live"
.common_before: &common_before
- dnf install -y lorax pykickstart git anaconda sshpass rsync gh
- git config --global user.email "littleowl@athenaos.org"
- git config --global user.name "Little Owl"
- git remote set-url origin "https://gitlab-ci-token:${CI_PUSH_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"
# ---------- x86_64 ----------
build-iso:x86_64:
stage: build-iso
image: fedora:latest # pulls x86_64 on an x86_64 runner
#tags:
# - x86_64 # <-- your x86_64 runner tag
when: manual # keep manual like your original
variables:
<<: *default_vars
ARCH: "x86_64"
OUTDIR: "results/${ARCH}"
ISO_NAME: "${ISO_BASENAME}-${ARCH}.iso"
before_script: *common_before
script:
- mkdir -p "${OUTDIR}"
- livemedia-creator --make-iso --ks athena-iso.ks --no-virt \
--iso-only --iso-name "${ISO_NAME}" --resultdir "${OUTDIR}" \
--releasever "${RELEASEVER}"
- sha256sum "${OUTDIR}/${ISO_NAME}" | tee "${OUTDIR}/${ISO_NAME}.sha256"
- sshpass -p "${MIRROR_SECRET}" rsync -avzzlr --delete \
-e "ssh -p 1027 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
"${OUTDIR}/${ISO_NAME}" "${OUTDIR}/${ISO_NAME}.sha256" \
"${MIRROR_USER}@hub.athenaos.org:/srv/mirrors/athena-images/rolling/"
- gh release upload "v23.11" "${OUTDIR}/${ISO_NAME}" --repo Athena-OS/athena --clobber
artifacts:
when: always
paths:
- "${OUTDIR}/"
# ---------- aarch64 ----------
build-iso:aarch64:
stage: build-iso
image: fedora:latest # pulls aarch64 on an ARM64 runner
tags:
- saas-linux-small-arm64 # <-- your ARM64 runner tag
when: manual
variables:
<<: *default_vars
ARCH: "aarch64"
OUTDIR: "results/${ARCH}"
ISO_NAME: "${ISO_BASENAME}-${ARCH}.iso"
before_script: *common_before
script:
- mkdir -p "${OUTDIR}"
- livemedia-creator --make-iso --ks athena-iso.ks --no-virt \
--iso-only --iso-name "${ISO_NAME}" --resultdir "${OUTDIR}" \
--releasever "${RELEASEVER}"
- sha256sum "${OUTDIR}/${ISO_NAME}" | tee "${OUTDIR}/${ISO_NAME}.sha256"
- sshpass -p "${MIRROR_SECRET}" rsync -avzzlr --delete \
-e "ssh -p 1027 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
"${OUTDIR}/${ISO_NAME}" "${OUTDIR}/${ISO_NAME}.sha256" \
"${MIRROR_USER}@hub.athenaos.org:/srv/mirrors/athena-images/rolling/"
- gh release upload "v23.11" "${OUTDIR}/${ISO_NAME}" --repo Athena-OS/athena --clobber
artifacts:
when: always
paths:
- "${OUTDIR}/"
Configuration
Add the CI/CD configuration from .gitlab-ci.yml
and other configuration if relevant (e.g. docker-compose.yml). Alternatively, create a public GitLab.com
example project that provides all necessary files to reproduce the question.
Versions
Please select whether options apply, and add the version information.
- Self-managed
-
GitLab.com
SaaS - Dedicated
- Self-hosted Runners
Versions
- GitLab (Web:
/help
or self-managed system informationsudo gitlab-rake gitlab:env:info
): - GitLab Runner, if self-hosted (Web
/admin/runners
or CLIgitlab-runner --version
):
Helpful resources
- Check the FAQ for helpful documentation, issues/bugs/feature proposals, and troubleshooting tips.
- Before opening a new topic, make sure to search for keywords in the forum search
- Check the GitLab and GitLab Runner projects for existing issues. If you encounter a bug, please create a bug report issue.
- Review existing troubleshooting docs.
Thanks for taking the time to be thorough in your request, it really helps!