From: Jessica Wagantall Date: Thu, 21 Nov 2019 00:56:25 +0000 (-0800) Subject: Update lf-docker-get-container-tag X-Git-Tag: v0.49.0~27^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=57cdf62628e9c858b2bfdea51d340edcb89d8342;p=releng%2Fglobal-jjb.git Update lf-docker-get-container-tag Allow shell script builder step to be customizable in lf-docker-get-container-tag. This will allow other teams like ONAP to call their own script. Set to default to "../shell/docker-get-container-tag.sh" which is what teams were already using. This feature is requested by ONAP's DCAE team to allow them to handle tags differently via their own script. Issue-ID: RELENG-2422 Signed-off-by: Jessica Wagantall Change-Id: I9afd52a0ad8916694db0e958e42eb80f98e4e28b --- diff --git a/docs/jjb/lf-docker-jobs.rst b/docs/jjb/lf-docker-jobs.rst index e029bed9..09abbbb8 100644 --- a/docs/jjb/lf-docker-jobs.rst +++ b/docs/jjb/lf-docker-jobs.rst @@ -27,7 +27,8 @@ If container-tag-method: yaml-file, the tag is obtained using the yq command, which requires that the repository has a YAML file named 'container-tag.yaml'. The script checks the docker-root directory by default or the directory specified by parameter container-tag-yaml-dir. -An example file appears below. +An example file appears below. Optionally, teams can call their own script to +handle the docker tagging differently. lf-docker-build @@ -79,6 +80,8 @@ Executes a docker build task. (default: latest) :container-tag-yaml-dir: Directory with container-tag.yaml. (default: $DOCKER_ROOT) :docker-build-args: Additional arguments for the docker build command. + :docker-get-container-tag-script: Pointer to script to handle docker tags. + (default: ../shell/docker-get-container-tag.sh) :docker-root: Build directory within the repo. (default: $WORKSPACE, the repo root) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :pre_docker_build_script: Build script to execute before the main verify @@ -148,6 +151,8 @@ Executes a docker build task and publishes the resulting images to a specified D one may want to provide more than 1 cron timer. No default. Use '@daily' to run daily or 'H H * * 0' to run weekly. :docker-build-args: Additional arguments for the docker build command. + :docker-get-container-tag-script: Pointer to script to handle docker tags. + (default: ../shell/docker-get-container-tag.sh) :docker-root: Build directory within the repo. (default: $WORKSPACE, the repo root) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :pre_docker_build_script: Build script to execute before the main merge diff --git a/jjb/lf-docker-jobs.yaml b/jjb/lf-docker-jobs.yaml index 1f9635c3..bc522ca2 100644 --- a/jjb/lf-docker-jobs.yaml +++ b/jjb/lf-docker-jobs.yaml @@ -13,8 +13,7 @@ CONTAINER_TAG_METHOD={container-tag-method} CONTAINER_TAG_YAML_DIR={container-tag-yaml-dir} DOCKER_ROOT={docker-root} - - shell: !include-raw-escape: - - ../shell/docker-get-container-tag.sh + - shell: !include-raw-escape: "{docker-get-container-tag-script}" - inject: # Import the container tag set by this build step properties-file: "env_docker_inject.txt" @@ -64,6 +63,7 @@ pre_docker_build_script: "# pre docker build script goes here" post_docker_build_script: "# post docker build script goes here" disable-job: "false" + docker-get-container-tag-script: "../shell/docker-get-container-tag.sh" docker-root: "$WORKSPACE" docker-build-args: "" git-url: "$GIT_URL/$PROJECT" @@ -139,6 +139,7 @@ container-tag-method: "{container-tag-method}" container-tag-yaml-dir: "{container-tag-yaml-dir}" docker-root: "{docker-root}" + docker-get-container-tag-script: "{docker-get-container-tag-script}" - lf-docker-build: docker-build-args: "{docker-build-args}" docker-name: "{docker-name}" @@ -186,6 +187,7 @@ container-tag-method: "{container-tag-method}" container-tag-yaml-dir: "{container-tag-yaml-dir}" docker-root: "{docker-root}" + docker-get-container-tag-script: "{docker-get-container-tag-script}" - lf-docker-build: docker-build-args: "{docker-build-args}" docker-name: "{docker-name}" diff --git a/releasenotes/notes/update-docker-get-container-tag-09c452d215cdc16b.yaml b/releasenotes/notes/update-docker-get-container-tag-09c452d215cdc16b.yaml new file mode 100644 index 00000000..eaef4374 --- /dev/null +++ b/releasenotes/notes/update-docker-get-container-tag-09c452d215cdc16b.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Make shell script builder step customizable in lf-docker-get-container-tag. + This will allow ONAP to call their own script. Set to default to + "../shell/docker-get-container-tag.sh" which is what teams were already using.