From c0e0737404deabca13373625d214c0bfc6eda7ab Mon Sep 17 00:00:00 2001 From: Ivan Chvets Date: Tue, 26 Sep 2023 12:04:00 -0400 Subject: [PATCH 1/2] feat: initial rock Summary of changes: - Initial ROCK based on the same version of source code as upstream container. --- rockcraft.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 rockcraft.yaml diff --git a/rockcraft.yaml b/rockcraft.yaml new file mode 100644 index 0000000..41c6d0e --- /dev/null +++ b/rockcraft.yaml @@ -0,0 +1,44 @@ +# Based on https://github.com/metacontroller/metacontroller/blob/v2.0.4/Dockerfile +name: metacontroller +summary: Metacontroller in a ROCK. +description: "Metacontroller is an add-on for Kubernetes that makes it easy to write and deploy custom controllers in the form of simple scripts." +version: "2.0.4_22.04_1" +license: Apache-2.0 +build-base: ubuntu:22.04 +base: bare +run-user: _daemon_ +services: + metacontroller: + command: metacontroller + working-dir: /usr/bin + override: replace + startup: enabled +platforms: + amd64: + +parts: + metacontroller: + plugin: go + source: https://github.com/metacontroller/metacontroller + source-type: git + source-tag: "v2.0.4" + build-snaps: + - go/1.16/stable + build-environment: + - CGO_ENABLED: 0 + stage-packages: + - ca-certificates + override-build: | + set -xe + make install + mkdir -p ${CRAFT_PART_INSTALL}/usr/bin + install -D ${CRAFT_PART_INSTALL}/bin/metacontroller ${CRAFT_PART_INSTALL}/usr/bin + + security-team-requirement: + plugin: nil + override-build: | + # security requirement + # there are no packages installed in `bare` base which is used in this rock + mkdir -p ${CRAFT_PART_INSTALL}/usr/share/rocks + (echo "# os-release" && cat /etc/os-release && echo "# dpkg-query") \ + > ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query From 0f8f4c9e46f54a39dacba7dc57db4678c2d16a24 Mon Sep 17 00:00:00 2001 From: Ivan Chvets Date: Fri, 29 Sep 2023 09:12:32 -0400 Subject: [PATCH 2/2] fix: removed set -ex --- rockcraft.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/rockcraft.yaml b/rockcraft.yaml index 41c6d0e..d8e0adb 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -29,7 +29,6 @@ parts: stage-packages: - ca-certificates override-build: | - set -xe make install mkdir -p ${CRAFT_PART_INSTALL}/usr/bin install -D ${CRAFT_PART_INSTALL}/bin/metacontroller ${CRAFT_PART_INSTALL}/usr/bin