X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-docker-jobs.yaml;h=6fbf09bf210d914332854b78710227f053fc0689;hb=c39a78a2527e40fbf2d46204ea70468c96dd1c05;hp=0de21fb2b8ce249b9865cb220cda2e45d21ca673;hpb=12853a424496b5d87c355f32fa27604099a0edbb;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-docker-jobs.yaml b/jjb/lf-docker-jobs.yaml index 0de21fb2..6fbf09bf 100644 --- a/jjb/lf-docker-jobs.yaml +++ b/jjb/lf-docker-jobs.yaml @@ -8,25 +8,17 @@ - builder: name: lf-docker-get-container-tag builders: - - conditional-step: - condition-kind: regex-match - regex: git-describe-params - label: '{docker-use-params-from}' - steps: - - shell: !include-raw-escape: - - ../shell/docker-get-git-describe.sh - - conditional-step: - condition-kind: regex-match - regex: yaml-file-params - label: '{docker-use-params-from}' - steps: - - shell: !include-raw-escape: - - ../shell/docker-get-yaml-tag.sh - inject: - # Import the docker image information from the previous build step + properties-content: | + 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 + - inject: + # Import the container tag set by this build step properties-file: 'env_docker_inject.txt' - - builder: name: lf-docker-build builders: @@ -36,6 +28,7 @@ DOCKER_NAME={docker-name} DOCKER_ROOT={docker-root} CONTAINER_PULL_REGISTRY={container-public-registry} + CONTAINER_PUSH_REGISTRY={container-push-registry} - shell: !include-raw-escape: - ../shell/docker-build.sh @@ -68,12 +61,15 @@ submodule-disable: false submodule-recursive: true submodule-timeout: 10 - pre_docker_build_script: '' - post_docker_build_script: '' + pre_docker_build_script: '# pre docker build script goes here' + post_docker_build_script: '# post docker build script goes here' disable-job: 'false' docker-root: '$WORKSPACE' docker-build-args: '' git-url: '$GIT_URL/$PROJECT' + container-tag-method: 'latest' + # TODO: how to interpolate value of {docker-root} parameter? + container-tag-yaml-dir: '' ##################### # Job Configuration # @@ -125,19 +121,36 @@ - comment-added-contains-event: comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$' + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: '.*' + + # github_included_regions MUST match gerrit_trigger_file_paths + github_included_regions: + - '.*' + builders: - lf-infra-pre-build - lf-infra-docker-login: global-settings-file: 'global-settings' settings-file: '{mvn-settings}' - shell: '{pre_docker_build_script}' - - lf-docker-get-container-tag - - lf-docker-build + - lf-docker-get-container-tag: + container-tag-method: '{container-tag-method}' + container-tag-yaml-dir: '{container-tag-yaml-dir}' + docker-root: '{docker-root}' + - lf-docker-build: + docker-build-args: '{docker-build-args}' + docker-name: '{docker-name}' + docker-root: '{docker-root}' + container-public-registry: '{container-public-registry}' + container-push-registry: '{container-push-registry}' - shell: '{post_docker_build_script}' - lf-provide-maven-settings-cleanup - docker_merge_common: &docker_merge_common name: docker-merge-common + cron: '' scm: - lf-infra-gerrit-scm: @@ -155,17 +168,34 @@ - comment-added-contains-event: comment-contains-value: remerge$ + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: '.*' + + # github_included_regions MUST match gerrit_trigger_file_paths + github_included_regions: + - '.*' + builders: - lf-infra-pre-build - lf-infra-docker-login: global-settings-file: 'global-settings' settings-file: '{mvn-settings}' - shell: '{pre_docker_build_script}' - - lf-docker-get-container-tag - - lf-docker-build + - lf-docker-get-container-tag: + container-tag-method: '{container-tag-method}' + container-tag-yaml-dir: '{container-tag-yaml-dir}' + docker-root: '{docker-root}' + - lf-docker-build: + docker-build-args: '{docker-build-args}' + docker-name: '{docker-name}' + docker-root: '{docker-root}' + container-public-registry: '{container-public-registry}' + container-push-registry: '{container-push-registry}' - shell: '{post_docker_build_script}' # Provided all steps have already passed, push the docker image - - lf-docker-push + - lf-docker-push: + container-push-registry: '{container-push-registry}' - lf-provide-maven-settings-cleanup ################# @@ -194,6 +224,7 @@ branches: - branch-compare-type: ANT branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' - job-template: name: '{project-name}-docker-verify-{stream}' @@ -252,6 +283,7 @@ <<: *docker_merge_common triggers: + - timed: '{obj:cron}' - gerrit: server-name: '{gerrit-server-name}' trigger-on: '{obj:gerrit_merge_triggers}' @@ -261,6 +293,7 @@ branches: - branch-compare-type: ANT branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' - job-template: name: '{project-name}-docker-merge-{stream}' @@ -292,6 +325,7 @@ jenkins-ssh-credential: '{jenkins-ssh-credential}' triggers: + - timed: '{obj:cron}' - github - pollscm: cron: ''