From 99189b6582a07450964bbea666991eadece7e28d Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Fri, 14 Jun 2024 15:18:07 -0400 Subject: [PATCH] feat: adding craft version as a file (#27) Co-authored-by: Ghislain Bourgeois --- CONTRIBUTING.md | 5 +++-- rockcraft.yaml | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8076ef7..419b533 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-smf_1.4.0_amd64.rock docker-daemon:sdcore-smf:1.4.0 -docker run sdcore-smf:1.4.0 +sudo rockcraft.skopeo --insecure-policy copy oci-archive:sdcore-smf_1.4.2_amd64.rock docker-daemon:sdcore-smf:1.4.2 +docker run sdcore-smf:1.4.2 ``` \ No newline at end of file diff --git a/rockcraft.yaml b/rockcraft.yaml index 1d3b1c8..873fade 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -14,7 +14,7 @@ parts: plugin: go source: https://github.com/omec-project/smf.git source-type: git - source-tag: v1.4.2 + 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/smf + 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/