jobs: use "cmd: |", not "# keep first line ..."

Adjust README.adoc to mention "cmd: |" instead of the workaround and
replace this:
  cmd: >
   # keep first line with less indent to preserve newlines
    docker run ...

With that:
  cmd: |
    docker run ...

Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6
This commit is contained in:
Oliver Smith 2019-04-12 16:19:46 +02:00 committed by Harald Welte
parent dc5fc51c1f
commit 61b9e76cb1
3 changed files with 23 additions and 41 deletions

View File

@ -58,17 +58,14 @@ Make sure it is exactly
- newlines: - newlines:
The build commands may be multiline, but especially in the Use 'key: |' to keep new lines in multiline values, e.g.:
gerrit-verifications.yml, where the commands are first stored in 'cmd' and - shell: |
later inserted in a 'shell' section, the newlines between individual shell echo hello
lines don't all survive. Interestingly enough, only a line that has more echo world
indenting than the first line also receives an actual newline in the resulting
jenkins Execute Shell section; take a look at the job's config page on jenkins. See also:
Hence we often have a '# keep first line with less indent' comment. Note that * https://yaml-multiline.info/
issuing backslashes to span a shell command across several lines will break the * https://stackoverflow.com/a/21699210
command if the newlines are not preserved, so we need a '# keep...' comment
where there are more than one shell command, and where there are backslashes
'\' to join multiple lines.
- jobs named on cmdline are not updated: - jobs named on cmdline are not updated:

View File

@ -30,8 +30,7 @@
- cellmgr-ng: - cellmgr-ng:
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -66,8 +65,7 @@
a3_name: IU a3_name: IU
a3: !!python/tuple [--disable-iu] a3: !!python/tuple [--disable-iu]
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
mkdir -p "$ARTIFACT_STORE" mkdir -p "$ARTIFACT_STORE"
docker run --rm=true \ docker run --rm=true \
@ -95,8 +93,7 @@
- osmo-bsc: - osmo-bsc:
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -147,8 +144,7 @@
- osmo-mgw: - osmo-mgw:
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -169,8 +165,7 @@
combination_filter: > combination_filter: >
(IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--enable-iu" && WITH_MANUALS == "0") ||
(IU == "--disable-iu" && WITH_MANUALS == "1") (IU == "--disable-iu" && WITH_MANUALS == "1")
cmd: > cmd: |
# keep first line with less indent to preserve newlines
ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
mkdir -p "$ARTIFACT_STORE" mkdir -p "$ARTIFACT_STORE"
docker run --rm=true -i \ docker run --rm=true -i \
@ -221,8 +216,7 @@
combination_filter: > combination_filter: >
(IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--enable-iu" && WITH_MANUALS == "0") ||
(IU == "--disable-iu" && WITH_MANUALS == "1") (IU == "--disable-iu" && WITH_MANUALS == "1")
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -265,8 +259,7 @@
- osmo-ttcn3-hacks: - osmo-ttcn3-hacks:
repos_url: 'https://gerrit.osmocom.org/{repos}' repos_url: 'https://gerrit.osmocom.org/{repos}'
slave_axis: !!python/tuple [ttcn3] slave_axis: !!python/tuple [ttcn3]
cmd: > cmd: |
# keep first line with less indent to preserve newlines
set -e set -e
make deps; make clean; make compile make deps; make clean; make compile

View File

@ -50,8 +50,7 @@
master-libosmo-netif, master-osmo-bts master-libosmo-netif, master-osmo-bts
- libosmo-dsp: - libosmo-dsp:
cmd: > cmd: |
# keep first line with less indent to preserve newlines
autoreconf --install --force autoreconf --install --force
./configure ./configure
$MAKE $PARALLEL_MAKE $MAKE $PARALLEL_MAKE
@ -144,8 +143,7 @@
a3_name: IU a3_name: IU
a3: !!python/tuple [--disable-iu] a3: !!python/tuple [--disable-iu]
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
mkdir -p "$ARTIFACT_STORE" mkdir -p "$ARTIFACT_STORE"
docker run --rm=true \ docker run --rm=true \
@ -170,8 +168,7 @@
- osmo-bsc: - osmo-bsc:
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -220,8 +217,7 @@
- osmo-gsm-manuals: - osmo-gsm-manuals:
node: 'osmocom-master-debian9' node: 'osmocom-master-debian9'
cmd: > cmd: |
# keep first line with less indent to preserve newlines
./contrib/jenkins.sh ./contrib/jenkins.sh
- osmo-gsm-tester: - osmo-gsm-tester:
@ -241,8 +237,7 @@
- osmo-mgw: - osmo-mgw:
concurrent: true concurrent: true
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -266,8 +261,7 @@
combination_filter: > combination_filter: >
(IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--enable-iu" && WITH_MANUALS == "0") ||
(IU == "--disable-iu" && WITH_MANUALS == "1") (IU == "--disable-iu" && WITH_MANUALS == "1")
cmd: > cmd: |
# keep first line with less indent to preserve newlines
ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
mkdir -p "$ARTIFACT_STORE" mkdir -p "$ARTIFACT_STORE"
docker run --rm=true -i \ docker run --rm=true -i \
@ -321,8 +315,7 @@
combination_filter: > combination_filter: >
(IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--enable-iu" && WITH_MANUALS == "0") ||
(IU == "--disable-iu" && WITH_MANUALS == "1") (IU == "--disable-iu" && WITH_MANUALS == "1")
cmd: > cmd: |
# keep first line with less indent to preserve newlines
docker run --rm=true \ docker run --rm=true \
-e HOME=/build \ -e HOME=/build \
-e MAKE=make \ -e MAKE=make \
@ -363,8 +356,7 @@
- osmo-remsim - osmo-remsim
- osmo-asf4-dfu - osmo-asf4-dfu
- simtrace2: - simtrace2:
cmd: > cmd: |
# keep first line with less indent to preserve newlines
./contrib/jenkins.sh --publish ./contrib/jenkins.sh --publish
email: gerrit-log@lists.osmocom.org laforge@gnumonks.org kredon@sysmocom.de email: gerrit-log@lists.osmocom.org laforge@gnumonks.org kredon@sysmocom.de