From 7870629b68ea8d67c5978475df5849bb47e3ff8c Mon Sep 17 00:00:00 2001 From: Leonardo Rossetti Date: Sep 21 2021 08:03:49 +0000 Subject: [PATCH 1/4] adding quay.io secret in job --- diff --git a/.zuul.yaml b/.zuul.yaml index bc1bf0a..c919b31 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -7,6 +7,9 @@ name: operator-image-push description: Build and push the operator image if needed run: ci/operator-image-push.yaml + secrets: + - name: quay_push_bot + secret: quay-push-bot - job: name: components-image-push diff --git a/ci/components-image-push.yaml b/ci/components-image-push.yaml index c95b5b9..c97c33d 100644 --- a/ci/components-image-push.yaml +++ b/ci/components-image-push.yaml @@ -1,6 +1,11 @@ --- - hosts: all tasks: - - name: Placeholder task - debug: - msg: "TODO: Build and push components images to a registry" + - name: Ensuser docker config folder exists + file: + path: "{{ lookup('env', 'HOME') }}/.docker" + state: directory + - name: Copy quay.io config file + copy: + content: "{{ quay_push_bot.config }}" + dest: "{{ lookup('env', 'HOME') }}/.docker/config.json" From 95417415ec9d62e1952afbb6d23045810695b8de Mon Sep 17 00:00:00 2001 From: Leonardo Rossetti Date: Sep 21 2021 16:33:10 +0000 Subject: [PATCH 2/4] moving content to zuul.d --- diff --git a/.zuul.yaml b/.zuul.yaml deleted file mode 100644 index c919b31..0000000 --- a/.zuul.yaml +++ /dev/null @@ -1,24 +0,0 @@ -- job: - name: operator-test - description: Run operator sanity tests using molecule - run: ci/operator-test.yaml - -- job: - name: operator-image-push - description: Build and push the operator image if needed - run: ci/operator-image-push.yaml - secrets: - - name: quay_push_bot - secret: quay-push-bot - -- job: - name: components-image-push - description: Build and push component images to a registry if needed - run: ci/components-image-push.yaml - -- project: - check: - jobs: - - operator-test - - operator-image-push - - components-image-push diff --git a/zuul.d/ci.yaml b/zuul.d/ci.yaml new file mode 100644 index 0000000..c919b31 --- /dev/null +++ b/zuul.d/ci.yaml @@ -0,0 +1,24 @@ +- job: + name: operator-test + description: Run operator sanity tests using molecule + run: ci/operator-test.yaml + +- job: + name: operator-image-push + description: Build and push the operator image if needed + run: ci/operator-image-push.yaml + secrets: + - name: quay_push_bot + secret: quay-push-bot + +- job: + name: components-image-push + description: Build and push component images to a registry if needed + run: ci/components-image-push.yaml + +- project: + check: + jobs: + - operator-test + - operator-image-push + - components-image-push diff --git a/zuul.d/publish-secret.yaml b/zuul.d/publish-secret.yaml new file mode 100644 index 0000000..dafd0c3 --- /dev/null +++ b/zuul.d/publish-secret.yaml @@ -0,0 +1,15 @@ + +- secret: + name: quay-push-bot + data: + config: !encrypted/pkcs1-oaep + - dDV62ZJpsknhb13ZCCH+q7kJ6hqXe1+p2AFKqqkB3H1cztTT/R5g/8AI/gc8iFoeZH17u + y3wfF+E//XudG01YStkW3+Uoq8jfcFH1IW4oSGFQhTjzAGl1hLFVsW+bvAM7wq0knDeft + FRYTBmZ2kfjBY/J+qX6uLAnWlz+9LawV8NAtdiG7o2X0om3HK04TZ6om3l71NHCCyr5z2 + zjPWd6fL0nNjaHM/a3heu5G0p5iYYcCmwgIMamYMSOuZK5LUt975E1tU5gI6xSkElF6eS + Lr+xfFGbu/bJedPh0L6K8HLNNADx3XsC8rKIQMM5oW0WO3uwcu3wnGthoBEI3vzysUQe/ + 9QMiJ92NQZRFDUhe/Ouu0AFzFSR3OKcWnJcaMzsK4qJ1ZTzdPl1+0M/PA5vTezOhrwE1j + pkAh1xJpkvCBVs4jBBtUiy81jXsbMzaSPieW0wZVZiP5VpHkE21+GeLQTNcAhMQnATJuU + SGAyXfFgo0HyExBtOGvs2DE/7HSdIIxtRGYu5yjR2R/aNs4SU+mUdh2kZpqgzEYiJtAPz + G3quMQt6k9Le8F0ZUFRX/D2JhW7XWY0NJ8GnofQTXDN2cSIPdAIEiyhnF05EiBQ6yJu6K + X2zrO82U7pPvQ+PC+Kz6kTWO/Rz4dG/UGQdNqFa6fFG+zTI0NqHPmeP3zcy71s= From a75ba5945752bfefd1dcfcfb3ff3581b8cf4aa83 Mon Sep 17 00:00:00 2001 From: Leonardo Rossetti Date: Sep 28 2021 15:37:02 +0000 Subject: [PATCH 3/4] zuul fix --- diff --git a/ci/components-image-push.yaml b/ci/components-image-push.yaml deleted file mode 100644 index c97c33d..0000000 --- a/ci/components-image-push.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- hosts: all - tasks: - - name: Ensuser docker config folder exists - file: - path: "{{ lookup('env', 'HOME') }}/.docker" - state: directory - - name: Copy quay.io config file - copy: - content: "{{ quay_push_bot.config }}" - dest: "{{ lookup('env', 'HOME') }}/.docker/config.json" diff --git a/ci/operator-image-build.yaml b/ci/operator-image-build.yaml new file mode 100644 index 0000000..d7d480b --- /dev/null +++ b/ci/operator-image-build.yaml @@ -0,0 +1,6 @@ +--- +- hosts: all + tasks: + - name: Placeholder task + debug: + msg: "TODO: build operator image" diff --git a/zuul.d/ci.yaml b/zuul.d/ci.yaml deleted file mode 100644 index c919b31..0000000 --- a/zuul.d/ci.yaml +++ /dev/null @@ -1,24 +0,0 @@ -- job: - name: operator-test - description: Run operator sanity tests using molecule - run: ci/operator-test.yaml - -- job: - name: operator-image-push - description: Build and push the operator image if needed - run: ci/operator-image-push.yaml - secrets: - - name: quay_push_bot - secret: quay-push-bot - -- job: - name: components-image-push - description: Build and push component images to a registry if needed - run: ci/components-image-push.yaml - -- project: - check: - jobs: - - operator-test - - operator-image-push - - components-image-push diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml new file mode 100644 index 0000000..b484516 --- /dev/null +++ b/zuul.d/jobs.yaml @@ -0,0 +1,18 @@ +- job: + name: operator-test + description: Tests the operator code + run: ci/operator-test.yaml + +- job: + name: operator-image-build + description: Tests the operator code + run: ci/operator-image-build.yaml + +- job: + name: operator-image-push + description: Build and push the operator image if needed + run: ci/operator-image-build.yaml + post-run: ci/operator-image-push.yaml + secrets: + - name: quay_push_bot_secret + secret: quay-push-bot-secret diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 0000000..9742737 --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,7 @@ +- project: + check: + jobs: + - operator-test + post: + jobs: + - operator-image-push diff --git a/zuul.d/publish-secret.yaml b/zuul.d/publish-secret.yaml deleted file mode 100644 index dafd0c3..0000000 --- a/zuul.d/publish-secret.yaml +++ /dev/null @@ -1,15 +0,0 @@ - -- secret: - name: quay-push-bot - data: - config: !encrypted/pkcs1-oaep - - dDV62ZJpsknhb13ZCCH+q7kJ6hqXe1+p2AFKqqkB3H1cztTT/R5g/8AI/gc8iFoeZH17u - y3wfF+E//XudG01YStkW3+Uoq8jfcFH1IW4oSGFQhTjzAGl1hLFVsW+bvAM7wq0knDeft - FRYTBmZ2kfjBY/J+qX6uLAnWlz+9LawV8NAtdiG7o2X0om3HK04TZ6om3l71NHCCyr5z2 - zjPWd6fL0nNjaHM/a3heu5G0p5iYYcCmwgIMamYMSOuZK5LUt975E1tU5gI6xSkElF6eS - Lr+xfFGbu/bJedPh0L6K8HLNNADx3XsC8rKIQMM5oW0WO3uwcu3wnGthoBEI3vzysUQe/ - 9QMiJ92NQZRFDUhe/Ouu0AFzFSR3OKcWnJcaMzsK4qJ1ZTzdPl1+0M/PA5vTezOhrwE1j - pkAh1xJpkvCBVs4jBBtUiy81jXsbMzaSPieW0wZVZiP5VpHkE21+GeLQTNcAhMQnATJuU - SGAyXfFgo0HyExBtOGvs2DE/7HSdIIxtRGYu5yjR2R/aNs4SU+mUdh2kZpqgzEYiJtAPz - G3quMQt6k9Le8F0ZUFRX/D2JhW7XWY0NJ8GnofQTXDN2cSIPdAIEiyhnF05EiBQ6yJu6K - X2zrO82U7pPvQ+PC+Kz6kTWO/Rz4dG/UGQdNqFa6fFG+zTI0NqHPmeP3zcy71s= diff --git a/zuul.d/quay-push-bot-secret.yaml b/zuul.d/quay-push-bot-secret.yaml new file mode 100644 index 0000000..264ae0d --- /dev/null +++ b/zuul.d/quay-push-bot-secret.yaml @@ -0,0 +1,15 @@ + +- secret: + name: quay-push-bot-secret + data: + config: !encrypted/pkcs1-oaep + - j7WIrtwNJ6WU9FpxFy44vXx3kGVJyAo4ZBKEfIzZeAhOL4sNLiWLkgmq3zg0XY3VI+ONT + 7/sPWbIicPy4iifD+j2M1jmZrnqtvtbmnZYu2ElbLQGGIL9Atp4Jcd4a/TpmP00FbUx6h + URdGx4EVPd3nMBwzVgoldCAFN5jMSn6xLlc1C0mOOLW755KOInYua9tbWIaVJ38pMceIW + cvrMGNBx/od3Hlv8U9xhKs/OVlstOJ37uVqKtoqT42KtX1bG/AoqqLw9qUS1Fui7b1qCg + oXvuk6r0d+Za+l4b4dJMgLQ5JLf7YPKxDjpmu1AwZTBYwvUXYzpnkzke4XRcwRud+NQv7 + 7Kr0AOe7IxOkuIbAEF3MQ6U/g9pNSg33592piXTa4og8LVRH9BEWcDK8aNgHye40fVCBT + cxJ3C/pSDGwbQychhChy2rNAV0tXO5mSCWMPK3YkRNKCjRSVyZIEf9D0NJVyok/372l6/ + TNY6WE31l0BJ5yCdiDyM4FK9qBUOHeGiFXcXMCn0Yg17n2aaLa6WFXme1D8eNGwBAMYFq + mb9ynpOfmQRQ0jUeD/SWEGMJp0fA2e/g33AbHIV7z/tgFnpy9tcJqBEYDGdJx4RFtE5E6 + yoZMYksS2VNLgLY+PbTGkWzawh5dvXqFyrhgBO3ZjpWAePpU3ZACi2LuTqXMBw= From 65db2857d8c4d64ad19b954d4deeaf0221b9f4e4 Mon Sep 17 00:00:00 2001 From: Leonardo Rossetti Date: Sep 28 2021 18:23:29 +0000 Subject: [PATCH 4/4] adding docker role --- diff --git a/ci/operator-test.yaml b/ci/operator-test.yaml index 686d77e..28c438d 100644 --- a/ci/operator-test.yaml +++ b/ci/operator-test.yaml @@ -1,6 +1,6 @@ --- - hosts: all tasks: - - name: Placeholder task - debug: - msg: "TODO: run tests in minikube or docker" + - name: Install docker + include_role: + name: docker diff --git a/ci/roles/docker/defaults/main.yml b/ci/roles/docker/defaults/main.yml new file mode 100644 index 0000000..2f431ee --- /dev/null +++ b/ci/roles/docker/defaults/main.yml @@ -0,0 +1 @@ +docker_username: zuul-worker diff --git a/ci/roles/docker/tasks/main.yml b/ci/roles/docker/tasks/main.yml new file mode 100644 index 0000000..e6e9403 --- /dev/null +++ b/ci/roles/docker/tasks/main.yml @@ -0,0 +1,12 @@ +- name: Install podman package + dnf: + name: + - docker + become: true + +- name: Service setup + systemd: + name: docker + state: restarted + daemon_reload: yes + become: trie