Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..."

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Apr 15 06:46:21 UTC 2019


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13634


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

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
---
M jobs/README.adoc
M jobs/gerrit-verifications.yml
M jobs/master-builds.yml
3 files changed, 23 insertions(+), 41 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/13634/1

diff --git a/jobs/README.adoc b/jobs/README.adoc
index 1d4d405..bea1d9f 100644
--- a/jobs/README.adoc
+++ b/jobs/README.adoc
@@ -58,17 +58,14 @@
 
 - newlines:
 
-The build commands may be multiline, but especially in the
-gerrit-verifications.yml, where the commands are first stored in 'cmd' and
-later inserted in a 'shell' section, the newlines between individual shell
-lines don't all survive. Interestingly enough, only a line that has more
-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.
-Hence we often have a '# keep first line with less indent' comment. Note that
-issuing backslashes to span a shell command across several lines will break the
-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.
+Use 'key: |' to keep new lines in multiline values, e.g.:
+  - shell: |
+      echo hello
+      echo world
+
+See also:
+* https://yaml-multiline.info/
+* https://stackoverflow.com/a/21699210
 
 - jobs named on cmdline are not updated:
 
diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 6128dc5..b2cc1dd 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -30,8 +30,7 @@
 
       - cellmgr-ng:
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -66,8 +65,7 @@
           a3_name: IU
           a3: !!python/tuple [--disable-iu]
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
             mkdir -p "$ARTIFACT_STORE"
             docker run --rm=true \
@@ -95,8 +93,7 @@
 
       - osmo-bsc:
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -147,8 +144,7 @@
 
       - osmo-mgw:
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -169,8 +165,7 @@
           combination_filter: >
             (IU == "--enable-iu" && WITH_MANUALS == "0") ||
             (IU == "--disable-iu" && WITH_MANUALS == "1")
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
             mkdir -p "$ARTIFACT_STORE"
             docker run --rm=true -i \
@@ -221,8 +216,7 @@
           combination_filter: >
             (IU == "--enable-iu" && WITH_MANUALS == "0") ||
             (IU == "--disable-iu" && WITH_MANUALS == "1")
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -265,8 +259,7 @@
       - osmo-ttcn3-hacks:
           repos_url: 'https://gerrit.osmocom.org/{repos}'
           slave_axis: !!python/tuple [ttcn3]
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             set -e
             make deps; make clean; make compile
 
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 3bac7b6..373e975 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -50,8 +50,7 @@
             master-libosmo-netif, master-osmo-bts
 
       - libosmo-dsp:
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             autoreconf --install --force
             ./configure
             $MAKE $PARALLEL_MAKE
@@ -144,8 +143,7 @@
           a3_name: IU
           a3: !!python/tuple [--disable-iu]
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
             mkdir -p "$ARTIFACT_STORE"
             docker run --rm=true \
@@ -170,8 +168,7 @@
 
       - osmo-bsc:
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -220,8 +217,7 @@
 
       - osmo-gsm-manuals:
           node: 'osmocom-master-debian9'
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             ./contrib/jenkins.sh
 
       - osmo-gsm-tester:
@@ -241,8 +237,7 @@
 
       - osmo-mgw:
           concurrent: true
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -266,8 +261,7 @@
           combination_filter: >
             (IU == "--enable-iu" && WITH_MANUALS == "0") ||
             (IU == "--disable-iu" && WITH_MANUALS == "1")
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             ARTIFACT_STORE="$HOME/jenkins_build_artifact_store"
             mkdir -p "$ARTIFACT_STORE"
             docker run --rm=true -i \
@@ -321,8 +315,7 @@
           combination_filter: >
             (IU == "--enable-iu" && WITH_MANUALS == "0") ||
             (IU == "--disable-iu" && WITH_MANUALS == "1")
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             docker run --rm=true \
               -e HOME=/build \
               -e MAKE=make \
@@ -363,8 +356,7 @@
       - osmo-remsim
       - osmo-asf4-dfu
       - simtrace2:
-          cmd: >
-           # keep first line with less indent to preserve newlines
+          cmd: |
             ./contrib/jenkins.sh --publish
           email: gerrit-log at lists.osmocom.org laforge at gnumonks.org kredon at sysmocom.de
 

-- 
To view, visit https://gerrit.osmocom.org/13634
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6
Gerrit-Change-Number: 13634
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190415/6f2aead4/attachment.htm>


More information about the gerrit-log mailing list