From df4f49dac33297635a89415bf43f65389576f98f Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 27 Feb 2018 16:36:07 +0100 Subject: [PATCH] ceph-container: add job to build and push images MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit After a PR is merged we trigger a build and a push the newly built images to the Docker Hub. Signed-off-by: Sébastien Han --- ceph-container-build-push-imgs/build/build | 33 +++++++++++++++ .../config/JENKINS_URL | 1 + .../ceph-container-build-push-imgs.yml | 41 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 ceph-container-build-push-imgs/build/build create mode 100644 ceph-container-build-push-imgs/config/JENKINS_URL create mode 100644 ceph-container-build-push-imgs/config/definitions/ceph-container-build-push-imgs.yml diff --git a/ceph-container-build-push-imgs/build/build b/ceph-container-build-push-imgs/build/build new file mode 100644 index 00000000..6bbb9a63 --- /dev/null +++ b/ceph-container-build-push-imgs/build/build @@ -0,0 +1,33 @@ +#!/bin/bash +set -e + + +############# +# FUNCTIONS # +############# + +function login_docker_hub { + echo "Login in the Docker Hub" + docker login -u "$DOCKER_HUB_USERNAME" -p "$DOCKER_HUB_PASSWORD" +} + +function build_ceph_imgs { + make build.parallel +} + +function push_ceph_imgs { + make push +} + + +######## +# MAIN # +######## + +login_docker_hub +set -x +cd "$WORKSPACE"/ceph-container/ || exit +build_ceph_imgs +push_ceph_imgs +cd - || exit + diff --git a/ceph-container-build-push-imgs/config/JENKINS_URL b/ceph-container-build-push-imgs/config/JENKINS_URL new file mode 100644 index 00000000..e97cf671 --- /dev/null +++ b/ceph-container-build-push-imgs/config/JENKINS_URL @@ -0,0 +1 @@ +2.jenkins.ceph.com diff --git a/ceph-container-build-push-imgs/config/definitions/ceph-container-build-push-imgs.yml b/ceph-container-build-push-imgs/config/definitions/ceph-container-build-push-imgs.yml new file mode 100644 index 00000000..a42116f5 --- /dev/null +++ b/ceph-container-build-push-imgs/config/definitions/ceph-container-build-push-imgs.yml @@ -0,0 +1,41 @@ +- job: + name: ceph-container-build-push-imgs + node: small && trusty + project-type: freestyle + defaults: global + display-name: 'ceph-container: build and push container images to Docker Hub' + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - github: + url: https://github.com/ceph/ceph-container + logrotate: + daysToKeep: -1 + numToKeep: -1 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + triggers: + - github + + scm: + - git: + url: https://github.com/ceph/ceph-container.git + branches: + - master + browser: auto + basedir: "ceph-container" + timeout: 20 + + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/build + + wrappers: + - inject-passwords: + global: true + mask-password-params: true -- 2.39.5