Blob Blame History Raw
From 089471c8fbe655ae1e519fb415394aa9485a6554 Mon Sep 17 00:00:00 2001
From: Mohammed Naser <mnaser@vexxhost.com>
Date: Mon, 14 Oct 2019 12:27:29 -0400
Subject: [PATCH 6/9] Added Docker image builds

Change-Id: If0b5c982020faf0f512a1c0d9b7b495789b9aa4f
Signed-off-by: Matthieu Huin <mhuin@redhat.com>
---
 .zuul.yaml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Dockerfile | 26 +++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 Dockerfile

diff --git a/.zuul.yaml b/.zuul.yaml
index 7a12e67..49e6f97 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,3 +1,58 @@
+- secret:
+    name: gear-opendev-dockerhub
+    data:
+      username: opendevzuul
+      password: !encrypted/pkcs1-oaep
+        - bROAu0oGBv+2l67dlC94t+s33rmdogBhWzyk7d/Zj7bSHZtfap2f1u+0RWogAKwjRtxtR
+          C6mqoVjKdWd+qBcnek0U/6Czgnhp5og3d9rsN+3SeQ9aOTTjoYkiqsg+c7N0rMh1AGndG
+          Qn3LU8i0EDGfzn5C+1KTcRHJ5brSrZzB+GsiXZxm8eLlupuFCep/yrUcnsH6f73sKGHQI
+          C9OcENQCelPLEdEtLb1eyx0hL1+o1ar0FdRCDrvZwih1SE/UUa18Zi7QCMEmkwZ8fil7B
+          zVtcBSTxTqIY49bgjerUykq0YKH1gTZrVC+UPFPjPZfNS39fxgcdqUMgbUTuWCoIrI0Jh
+          2pKg+KZ/3L8zqcmqOZFQOFvVi7zOtXdKZI3rmWRAzM/BgVXFeBsQZkGZ75TzE8Xm70uA4
+          WYdIva8kjBLrTz1/uRijZqNSrwM2fGO3VI+1SXUQI6FWJfZ+uSWzCDk9JswLPFzoXa7+J
+          ASDaygdGvU6q+pkxOQ/v9lgTnwZCdEAoCRdSZBKz/y3OosKAYIRIismLRJ9Kfkqxl8IEi
+          /0U+rSsWpWb5jufUcwAmL2Rj6YVcgUl3qSq2TzP3R+DPPda6Et4NZQ3RLpWP8if4VuNq7
+          gJ2yQTSLJLOG6nhDMRJoW3GLjUMWUw3sbvFE1VzcIggIs4mfxVp21Ps/6hRoAI=
+
+- job:
+    name: gear-build-opendev-image
+    parent: opendev-build-docker-image
+    description: Build OpenDev Docker images for gear
+    requires:
+      - python-base-container-image
+      - python-builder-container-image
+    provides: gear-container-image
+    vars: &gear_opendev_image_vars
+      zuul_work_dir: src/opendev.org/opendev/gear
+      docker_images:
+        - context: .
+          repository: opendevorg/geard
+          target: geard
+
+- job:
+    name: gear-upload-opendev-image
+    parent: opendev-upload-docker-image
+    description: Build OpenDev gear Docker images and upload to Docker Hub.
+    requires:
+      - python-base-container-image
+      - python-builder-container-image
+    provides: gear-container-image
+    vars: *gear_opendev_image_vars
+    secrets:
+      - name: docker_credentials
+        secret: gear-opendev-dockerhub
+        pass-to-parent: true
+
+- job:
+    name: gear-promote-opendev-image
+    parent: opendev-promote-docker-image
+    description: Promote previously uploaded gear Docker images.
+    vars: *gear_opendev_image_vars
+    secrets:
+      - name: docker_credentials
+        secret: gear-opendev-dockerhub
+        pass-to-parent: true
+
 - project:
     vars:
       release_python: python3
@@ -10,6 +65,7 @@
         - tox-py35:
             nodeset: ubuntu-xenial
         - build-python-release
+        - gear-build-opendev-image
     gate:
       jobs:
         - tox-pep8
@@ -17,9 +73,19 @@
         - tox-py35:
             nodeset: ubuntu-xenial
         - build-python-release
+        - gear-upload-opendev-image
     promote:
       jobs:
         - opendev-promote-python
+        - gear-promote-opendev-image
     release:
       jobs:
         - opendev-release-python
+        - upload-docker-image:
+            secrets:
+              name: docker_credentials
+              secret: gear-opendev-dockerhub
+              pass-to-parent: true
+            vars:
+              <<: *gear_opendev_image_vars
+              upload_docker_image_promote: false
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..13a86af
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,26 @@
+# Copyright (c) 2019 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM opendevorg/python-builder as builder
+
+COPY . /tmp/src
+RUN assemble
+
+FROM opendevorg/python-base as geard
+
+COPY --from=builder /output/ /output
+RUN /output/install-from-bindep
+
+CMD ["/usr/local/bin/geard"]
-- 
2.31.1