From bbabae653fa13fc164f465ba1df3db536ec78d42 Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Fri, 14 Jun 2024 14:50:51 -0400 Subject: [PATCH] feat: adding craft version as a file Creates a new part for storing the content of the craft version variable --- CONTRIBUTING.md | 5 +++-- rockcraft.yaml | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0174735..f7c0cc5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,8 @@ ## Build and deploy ```bash +sudo snap install rockcraft --classic --edge rockcraft pack -v -sudo skopeo --insecure-policy copy oci-archive:sdcore-webui_1.4.0_amd64.rock docker-daemon:sdcore-webui:1.4.0 -docker run sdcore-webui:1.4.0 +sudo rockcraft.skopeo --insecure-policy copy oci-archive:sdcore-webui_1.4.1_amd64.rock docker-daemon:sdcore-webui:1.4.1 +docker run sdcore-webui:1.4.1 ``` diff --git a/rockcraft.yaml b/rockcraft.yaml index e29ca3a..723efeb 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -14,7 +14,7 @@ parts: plugin: go source: https://github.com/omec-project/webconsole.git source-type: git - source-tag: v1.4.1 + source-tag: v${CRAFT_PROJECT_VERSION} build-snaps: - go/1.21/stable stage-packages: @@ -22,3 +22,12 @@ parts: - base-files_lib organize: bin/cmd: bin/webui + version: + plugin: nil + override-build: | + mkdir -p ${CRAFT_PART_INSTALL}/etc/ + echo ${CRAFT_PROJECT_VERSION} > ${CRAFT_PART_INSTALL}/etc/workload-version + organize: + "*": etc/ + stage: + - etc/