From c699a43a2cfbd00a9fb5ca5e2f33c1470bc7de32 Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Tue, 7 Feb 2023 17:05:56 +0000 Subject: [PATCH 1/3] doc: examples: Move debian-ospack example to own directory To allow for more examples to be merged in future, move the debian-ospack example into its own directory. Signed-off-by: Christopher Obbard --- .../ospack-debian.yaml} | 0 doc/examples/{ => ospack-debian}/overlays/sudo/etc/sudoers.d/user | 0 doc/examples/{ => ospack-debian}/scripts/setup-user.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename doc/examples/{debian-example-ospack.yaml => ospack-debian/ospack-debian.yaml} (100%) rename doc/examples/{ => ospack-debian}/overlays/sudo/etc/sudoers.d/user (100%) rename doc/examples/{ => ospack-debian}/scripts/setup-user.sh (100%) diff --git a/doc/examples/debian-example-ospack.yaml b/doc/examples/ospack-debian/ospack-debian.yaml similarity index 100% rename from doc/examples/debian-example-ospack.yaml rename to doc/examples/ospack-debian/ospack-debian.yaml diff --git a/doc/examples/overlays/sudo/etc/sudoers.d/user b/doc/examples/ospack-debian/overlays/sudo/etc/sudoers.d/user similarity index 100% rename from doc/examples/overlays/sudo/etc/sudoers.d/user rename to doc/examples/ospack-debian/overlays/sudo/etc/sudoers.d/user diff --git a/doc/examples/scripts/setup-user.sh b/doc/examples/ospack-debian/scripts/setup-user.sh similarity index 100% rename from doc/examples/scripts/setup-user.sh rename to doc/examples/ospack-debian/scripts/setup-user.sh From 66ca26689bf5ddcf88fff4a9ce70e463721f51c6 Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Tue, 7 Feb 2023 17:10:49 +0000 Subject: [PATCH 2/3] docs: Explain example recipes in README Signed-off-by: Christopher Obbard --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6e1c08af..3ccd0502 100644 --- a/README.md +++ b/README.md @@ -112,11 +112,10 @@ this: debos -t image:"debian-arm64.tgz" example.yaml -## Other examples +## Other example recipes -Example recipes are collected in a separate repository: - -https://github.com/go-debos/debos-recipes +See the [bundled example recipes](docs/examples) for some more detailed example +recipes. Additional more detailed example recipes are stored under [debos-recipes](https://github.com/go-debos/debos-recipes). ## Environment variables From a6bd19d91966300f4757f5dcade249b911d9fec8 Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Tue, 7 Feb 2023 17:11:05 +0000 Subject: [PATCH 3/3] ci: Build example recipes in GitHub Actions To ensure that we don't ship broken example recipes (as reported in some previous bugs), we should build the example recipes and make sure they build before pushing new container images to DockerHub. Signed-off-by: Christopher Obbard --- .github/workflows/ci.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 438641f5..e44a3e5b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -173,6 +173,42 @@ jobs: ${{matrix.test.variables}} ${{matrix.test.case}}/test.yaml + example-tests: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + example: + - ospack-debian + name: Example recipe ${{matrix.example}} + steps: + - name: Repository checkout + uses: actions/checkout@v3 + + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: debos-image + path: /tmp + - name: Load image + run: | + docker load --input /tmp/debos-image.tar + + - name: run in docker image + run: + docker run + --cgroupns=private + -v $(pwd)/tests:/tests + -w /tests + --tmpfs /scratch:exec + --tmpfs /run + --privileged + -e TMP=/scratch + -e SYSTEMD_NSPAWN_UNIFIED_HIERARCHY=1 + debos -v + ${{matrix.example}}/${{matrix.example}}.yaml + # Job to key success status against allgreen: name: allgreen @@ -180,6 +216,7 @@ jobs: needs: - unit-tests - recipe-tests + - example-tests runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed @@ -192,6 +229,7 @@ jobs: needs: - unit-tests - recipe-tests + - example-tests if: github.event_name != 'pull_request' runs-on: ubuntu-latest permissions: @@ -268,6 +306,7 @@ jobs: - check-dockerhub-secrets - unit-tests - recipe-tests + - example-tests if: | needs.check-dockerhub-secrets.outputs.has-secrets == 'true' && github.event_name != 'pull_request'