From c808f2938004410cd66aac23ee13cabd4fa7ce0b Mon Sep 17 00:00:00 2001 From: Sheng Yu Date: Fri, 1 Dec 2023 14:57:18 -0500 Subject: [PATCH 1/2] chore(linter): fix docs linter errors --- README.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 0f46721ab..0171c7b64 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,8 @@ Rockcraft Purpose ------- -Tool to create OCI Images using the language from `Snapcraft`_ and `Charmcraft`_. +Tool to create OCI Images using the language from `Snapcraft`_ and +`Charmcraft`_. .. _Snapcraft: https://snapcraft.io @@ -44,13 +45,14 @@ https://canonical-rockcraft.readthedocs-hosted.com/ :target: https://snapcraft.io/rockcraft - + Testing ------- -In addition to unit tests in :code:`tests/unit`, which can be run with :code:`make test-units`, -a number of integrated tests in :code:`tests/spread` can be run with `Spread`_. See the -`general notes`_ and take note of these ``rockcraft``-specific instructions: +In addition to unit tests in :code:`tests/unit`, which can be run with +:code:`make test-units`, a number of integrated tests in :code:`tests/spread` +can be run with `Spread`_. See the `general notes`_ and take note of these +``rockcraft``-specific instructions: * Initialize/update git submodules to fetch Spread-related helper scripts: From 29906eeae6a69f9f8361e729216f49101d059136 Mon Sep 17 00:00:00 2001 From: Sheng Yu Date: Wed, 13 Dec 2023 09:25:31 -0500 Subject: [PATCH 2/2] chore(linter): fix yaml linter errors --- .github/ISSUE_TEMPLATE/bug.yaml | 1 - .github/workflows/snap.yaml | 2 +- .github/workflows/spread-large.yaml | 4 +- .github/workflows/tests.yaml | 1 - docs/how-to/code/build-docs/task.yaml | 6 +- .../convert-to-pebble-layer/rockcraft.yaml | 7 +- .../code/convert-to-pebble-layer/task.yaml | 6 +- docs/how-to/code/create-slice/openssl.yaml | 32 +++---- docs/how-to/code/create-slice/task.yaml | 4 +- docs/how-to/code/get-started/task.yaml | 6 +- docs/how-to/code/install-slice/rockcraft.yaml | 18 ++-- docs/how-to/code/install-slice/task.yaml | 4 +- docs/how-to/code/publish-slice/task.yaml | 6 +- .../code/rockcraft-pack-action/task.yaml | 6 +- docs/reference/code/example/task.yaml | 1 - docs/tutorials/code/chisel/task.yaml | 8 +- docs/tutorials/code/hello-world/task.yaml | 6 +- .../migrate-to-chiselled-rock/rockcraft.yaml | 2 +- .../code/migrate-to-chiselled-rock/task.yaml | 10 +-- docs/tutorials/code/node-app/rockcraft.yaml | 24 ++--- docs/tutorials/code/node-app/task.yaml | 1 - docs/tutorials/code/pyfiglet/task.yaml | 6 +- snap/snapcraft.yaml | 90 +++++++++---------- spread.yaml | 23 +++-- tests/spread/general/bare-base/task.yaml | 2 +- tests/spread/general/big/rockcraft.yaml | 7 +- tests/spread/general/big/task.yaml | 4 +- tests/spread/general/chisel/rockcraft.yaml | 2 +- tests/spread/general/clean/rockcraft.yaml | 7 +- tests/spread/general/craftctl/rockcraft.yaml | 2 +- tests/spread/general/craftctl/task.yaml | 1 - .../spread/general/destructive/rockcraft.yaml | 2 +- tests/spread/general/destructive/task.yaml | 8 +- .../general/entrypoint-service/task.yaml | 2 +- .../spread/general/environment/rockcraft.yaml | 2 +- tests/spread/general/environment/task.yaml | 2 +- .../general/health-checks/rockcraft.yaml | 4 +- .../general/invalid-name/rockcraft.orig.yaml | 6 +- tests/spread/general/invalid-name/task.yaml | 2 +- .../general/overlay-logs/rockcraft.yaml | 8 +- tests/spread/general/plugin-go/task.yaml | 1 - .../plugin-python-3.6/rockcraft.orig.yaml | 14 +-- .../plugin-python-error/rockcraft.orig.yaml | 10 +-- .../plugin-python/base-2204/rockcraft.yaml | 2 +- tests/spread/general/plugin-python/parts.yaml | 1 - tests/spread/general/plugin-python/task.yaml | 16 ++-- tests/spread/general/prune/task.yaml | 2 +- tests/spread/general/repo-bare-base/task.yaml | 2 +- .../spread/general/repo-ubuntu-base/task.yaml | 4 +- tests/spread/general/run-user/rockcraft.yaml | 1 - tests/spread/general/run-user/task.yaml | 2 +- tests/spread/general/usrmerge/rockcraft.yaml | 4 +- tests/spread/general/usrmerge/task.yaml | 4 +- 53 files changed, 193 insertions(+), 205 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml index 6d2ee0afc..a6906bd0f 100644 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -58,4 +58,3 @@ body: render: shell validations: required: true - diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index dcdeb50bf..27ffd426f 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -32,7 +32,7 @@ jobs: run: | if [[ "${{ github.event_name }}" == "pull_request" ]] then - echo "branch=pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT" + echo "branch=pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT" else branch=$(echo ${GITHUB_REF#refs/*/} | sed -e 's|feature/\(.*\)|\1|') echo "branch=$branch" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/spread-large.yaml b/.github/workflows/spread-large.yaml index 894ec0c6c..e85cb41f6 100644 --- a/.github/workflows/spread-large.yaml +++ b/.github/workflows/spread-large.yaml @@ -1,9 +1,9 @@ name: Spread (large) on: pull_request: - types: [ labeled ] + types: [labeled] schedule: - - cron: "0 2 * * 0,3" # run at 2 AM on Sundays and Wednesdays + - cron: "0 2 * * 0,3" # run at 2 AM on Sundays and Wednesdays jobs: snap-build: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ce7a6fae2..aa326ed8d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -105,4 +105,3 @@ jobs: - name: Run integration tests run: | make test-integrations - diff --git a/docs/how-to/code/build-docs/task.yaml b/docs/how-to/code/build-docs/task.yaml index dbb1a4d94..6758bff3b 100644 --- a/docs/how-to/code/build-docs/task.yaml +++ b/docs/how-to/code/build-docs/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the "Build the docs" guide @@ -16,7 +16,7 @@ execute: | # [docs:install-deps] make installdocs # [docs:install-deps-end] - + # [docs:make-docs] make docs # the home page can be found at docs/_build/html/index.html # [docs:make-docs-end] diff --git a/docs/how-to/code/convert-to-pebble-layer/rockcraft.yaml b/docs/how-to/code/convert-to-pebble-layer/rockcraft.yaml index b7d294325..060ff34e2 100644 --- a/docs/how-to/code/convert-to-pebble-layer/rockcraft.yaml +++ b/docs/how-to/code/convert-to-pebble-layer/rockcraft.yaml @@ -3,16 +3,16 @@ base: "ubuntu@22.04" version: latest summary: An NGINX rock description: | - A rock equivalent of the official NGINX Docker image from Docker Hub. + A rock equivalent of the official NGINX Docker image from Docker Hub. license: Apache-2.0 platforms: - amd64: + amd64: package-repositories: - type: apt url: https://nginx.org/packages/mainline/ubuntu key-id: 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 - suites: + suites: - jammy components: - nginx @@ -49,4 +49,3 @@ services: environment: TZ: UTC on-failure: shutdown - \ No newline at end of file diff --git a/docs/how-to/code/convert-to-pebble-layer/task.yaml b/docs/how-to/code/convert-to-pebble-layer/task.yaml index ee2ba0a1f..c5bf4aac4 100644 --- a/docs/how-to/code/convert-to-pebble-layer/task.yaml +++ b/docs/how-to/code/convert-to-pebble-layer/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the "How to convert a popular entrypoint to a Pebble layer" guide @@ -27,4 +27,4 @@ execute: | # [docs:curl-end] docker rm -f nginx-pebble-service - docker rmi -f custom-nginx-rock:latest \ No newline at end of file + docker rmi -f custom-nginx-rock:latest diff --git a/docs/how-to/code/create-slice/openssl.yaml b/docs/how-to/code/create-slice/openssl.yaml index 3de2ff4b0..38d359920 100644 --- a/docs/how-to/code/create-slice/openssl.yaml +++ b/docs/how-to/code/create-slice/openssl.yaml @@ -1,19 +1,19 @@ package: openssl slices: - bins: - essential: - - libc6_libs - - libc6_config - - libssl3_libs - - openssl_config - contents: - /usr/bin/c_rehash: - /usr/bin/openssl: + bins: + essential: + - libc6_libs + - libc6_config + - libssl3_libs + - openssl_config + contents: + /usr/bin/c_rehash: + /usr/bin/openssl: - config: - contents: - /etc/ssl/private/: - /etc/ssl/openssl.cnf: - /usr/lib/ssl/certs: - /usr/lib/ssl/openssl.cnf: - /usr/lib/ssl/private: + config: + contents: + /etc/ssl/private/: + /etc/ssl/openssl.cnf: + /usr/lib/ssl/certs: + /usr/lib/ssl/openssl.cnf: + /usr/lib/ssl/private: diff --git a/docs/how-to/code/create-slice/task.yaml b/docs/how-to/code/create-slice/task.yaml index f87127ee8..8571c4683 100644 --- a/docs/how-to/code/create-slice/task.yaml +++ b/docs/how-to/code/create-slice/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the "Create a package slice for Chisel" guide diff --git a/docs/how-to/code/get-started/task.yaml b/docs/how-to/code/get-started/task.yaml index 6d2963856..98cd298a1 100644 --- a/docs/how-to/code/get-started/task.yaml +++ b/docs/how-to/code/get-started/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the steps for getting started with Rockcraft @@ -13,7 +13,7 @@ execute: | # [docs:snap-version-end] # [docs:lxd-version] - lxd --version + lxd --version # [docs:lxd-version-end] # [docs:lxd-status] diff --git a/docs/how-to/code/install-slice/rockcraft.yaml b/docs/how-to/code/install-slice/rockcraft.yaml index 805995bda..5f2895b09 100644 --- a/docs/how-to/code/install-slice/rockcraft.yaml +++ b/docs/how-to/code/install-slice/rockcraft.yaml @@ -4,15 +4,15 @@ build_base: "ubuntu@22.04" version: '0.0.1' summary: A chiselled rock with a custom OpenSSL slice description: | - A rock containing only the binaries (and corresponding dependencies) from the OpenSSL package. - Built from a custom Chisel release. + A rock containing only the binaries (and corresponding dependencies) from the OpenSSL package. + Built from a custom Chisel release. license: GPL-3.0 platforms: - amd64: + amd64: parts: - build-context: - plugin: nil - source: chisel-releases/ - source-type: local - override-build: - chisel cut --release ./ --root ${CRAFT_PART_INSTALL} openssl_bins + build-context: + plugin: nil + source: chisel-releases/ + source-type: local + override-build: + chisel cut --release ./ --root ${CRAFT_PART_INSTALL} openssl_bins diff --git a/docs/how-to/code/install-slice/task.yaml b/docs/how-to/code/install-slice/task.yaml index e729d9cb4..c5fbd2a8d 100644 --- a/docs/how-to/code/install-slice/task.yaml +++ b/docs/how-to/code/install-slice/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the "Install a custom package slice" guide diff --git a/docs/how-to/code/publish-slice/task.yaml b/docs/how-to/code/publish-slice/task.yaml index e1da7f4dc..69b6fdcdf 100644 --- a/docs/how-to/code/publish-slice/task.yaml +++ b/docs/how-to/code/publish-slice/task.yaml @@ -1,15 +1,15 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the "Release a slice definitions file" guide execute: | git clone -b ubuntu-22.04 https://github.com/canonical/chisel-releases.git - + # [docs:new-branch] cd chisel-releases git checkout -b create-openssl-bins-slice diff --git a/docs/how-to/code/rockcraft-pack-action/task.yaml b/docs/how-to/code/rockcraft-pack-action/task.yaml index 3c72b3f46..9b5658fe1 100644 --- a/docs/how-to/code/rockcraft-pack-action/task.yaml +++ b/docs/how-to/code/rockcraft-pack-action/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test the "Use the GitHub Action" guide @@ -11,4 +11,4 @@ prepare: | tests.pkgs install yamllint execute: | - yamllint rockcraft-pack.yaml \ No newline at end of file + yamllint rockcraft-pack.yaml diff --git a/docs/reference/code/example/task.yaml b/docs/reference/code/example/task.yaml index d3af7b4c1..313b96e29 100644 --- a/docs/reference/code/example/task.yaml +++ b/docs/reference/code/example/task.yaml @@ -1,4 +1,3 @@ - summary: Check that we can build the example rockcraft.yaml execute: | diff --git a/docs/tutorials/code/chisel/task.yaml b/docs/tutorials/code/chisel/task.yaml index 30c05475e..cbd96a93f 100644 --- a/docs/tutorials/code/chisel/task.yaml +++ b/docs/tutorials/code/chisel/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: test for the "Install packages slices into a rock" tutorial @@ -15,7 +15,7 @@ execute: | # [docs:build-rock] rockcraft pack # [docs:build-rock-end] - + test -f chisel-openssl_0.0.1_amd64.rock # [docs:skopeo-copy] @@ -29,5 +29,5 @@ execute: | # [docs:docker-run-with-args] docker run --rm chisel-openssl exec --env=SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt openssl s_client -connect ubuntu.com:443 -brief # [docs:docker-run-with-args-end] - + docker run --rm chisel-openssl exec --env=SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt openssl s_client -connect ubuntu.com:443 -brief 2>&1 | grep "Verification: OK" diff --git a/docs/tutorials/code/hello-world/task.yaml b/docs/tutorials/code/hello-world/task.yaml index c7db9fa92..915801911 100644 --- a/docs/tutorials/code/hello-world/task.yaml +++ b/docs/tutorials/code/hello-world/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: hello world tutorial @@ -36,5 +36,5 @@ execute: | # [docs:docker-run] docker run --rm hello:1.0 exec hello -t # [docs:docker-run-end] - + docker run --rm hello:1.0 exec hello -t | grep "hello, world" diff --git a/docs/tutorials/code/migrate-to-chiselled-rock/rockcraft.yaml b/docs/tutorials/code/migrate-to-chiselled-rock/rockcraft.yaml index 288604872..84f8bdb02 100644 --- a/docs/tutorials/code/migrate-to-chiselled-rock/rockcraft.yaml +++ b/docs/tutorials/code/migrate-to-chiselled-rock/rockcraft.yaml @@ -25,7 +25,7 @@ parts: stage-packages: - base-files_base - dotnet-runtime-6.0_libs - + # Based on requirement R4, create the symbolic link override-prime: | craftctl default diff --git a/docs/tutorials/code/migrate-to-chiselled-rock/task.yaml b/docs/tutorials/code/migrate-to-chiselled-rock/task.yaml index 3b28d9791..a734b0d70 100644 --- a/docs/tutorials/code/migrate-to-chiselled-rock/task.yaml +++ b/docs/tutorials/code/migrate-to-chiselled-rock/task.yaml @@ -1,8 +1,8 @@ ########################################### # IMPORTANT # Comments matter! -# The docs use the wrapping comments as -# markers for including said instructions +# The docs use the wrapping comments as +# markers for including said instructions # as snippets in the docs. ########################################### summary: docker image migration tutorial @@ -21,7 +21,7 @@ execute: | # [docs:build-docker-image] docker build -t dotnet-runtime:reference . # [docs:build-docker-image-end] - + popd # [docs:inspect-docker-image] @@ -48,7 +48,7 @@ execute: | # [docs:skopeo-copy] sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:dotnet-runtime_chiselled_amd64.rock docker-daemon:dotnet-runtime:chiselled # [docs:skopeo-copy-end] - + # [docs:inspect-rock] docker images dotnet-runtime:chiselled # [docs:inspect-rock-end] @@ -56,7 +56,7 @@ execute: | # [docs:run-rock] docker run --rm dotnet-runtime:chiselled exec dotnet --info # [docs:run-rock-end] - + restore: | rm dotnet-runtime_chiselled_amd64.rock docker rmi -f dotnet-runtime:chiselled dotnet-runtime:reference diff --git a/docs/tutorials/code/node-app/rockcraft.yaml b/docs/tutorials/code/node-app/rockcraft.yaml index 810ed1d64..8c6846521 100644 --- a/docs/tutorials/code/node-app/rockcraft.yaml +++ b/docs/tutorials/code/node-app/rockcraft.yaml @@ -9,17 +9,17 @@ platforms: amd64: services: - app: - override: replace - command: node server.js - startup: enabled - on-success: shutdown - on-failure: shutdown - working-dir: /lib/node_modules/node_web_app + app: + override: replace + command: node server.js + startup: enabled + on-success: shutdown + on-failure: shutdown + working-dir: /lib/node_modules/node_web_app parts: - app: - plugin: npm - npm-include-node: True - npm-node-version: "21.1.0" - source: src/ + app: + plugin: npm + npm-include-node: true + npm-node-version: "21.1.0" + source: src/ diff --git a/docs/tutorials/code/node-app/task.yaml b/docs/tutorials/code/node-app/task.yaml index 6135889b8..5b35f199c 100644 --- a/docs/tutorials/code/node-app/task.yaml +++ b/docs/tutorials/code/node-app/task.yaml @@ -1,4 +1,3 @@ - summary: nodejs tutorial execute: | diff --git a/docs/tutorials/code/pyfiglet/task.yaml b/docs/tutorials/code/pyfiglet/task.yaml index 06384e64a..ad8475dea 100644 --- a/docs/tutorials/code/pyfiglet/task.yaml +++ b/docs/tutorials/code/pyfiglet/task.yaml @@ -11,12 +11,12 @@ execute: | # [docs:create-pyfiglet-dir] mkdir pyfiglet-rock && cd pyfiglet-rock # [docs:create-pyfiglet-dir-end] - + cp ../rockcraft.yaml . - + # [docs:build-rock] rockcraft pack - # [docs:build-rock-end] + # [docs:build-rock-end] # [docs:skopeo-copy] sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:pyfiglet_0.7.6_amd64.rock docker-daemon:pyfiglet:0.7.6 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index df9b7ccbc..17bca4618 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -27,45 +27,45 @@ parts: rockcraft-libs: plugin: nil build-attributes: - - enable-patchelf + - enable-patchelf stage-packages: - - apt - - apt-transport-https - - apt-utils - - binutils - - gpg - - gpgv - - libpython3-stdlib - - libpython3.10-stdlib - - libpython3.10-minimal - - python3-pip - - python3-setuptools - - python3-wheel - - python3-venv - - python3-minimal - - python3-distutils - - python3-pkg-resources - - python3.10-minimal - - fuse-overlayfs + - apt + - apt-transport-https + - apt-utils + - binutils + - gpg + - gpgv + - libpython3-stdlib + - libpython3.10-stdlib + - libpython3.10-minimal + - python3-pip + - python3-setuptools + - python3-wheel + - python3-venv + - python3-minimal + - python3-distutils + - python3-pkg-resources + - python3.10-minimal + - fuse-overlayfs organize: - "usr/bin/fuse-overlayfs": "libexec/rockcraft/fuse-overlayfs" + "usr/bin/fuse-overlayfs": "libexec/rockcraft/fuse-overlayfs" rockcraft: source: . plugin: python python-packages: - - wheel - - pip - - setuptools + - wheel + - pip + - setuptools python-requirements: - - requirements-jammy.txt - - requirements.txt + - requirements-jammy.txt + - requirements.txt build-attributes: - - enable-patchelf + - enable-patchelf build-environment: - - "CFLAGS": "$(pkg-config python-3.10 yaml-0.1 --cflags)" + - "CFLAGS": "$(pkg-config python-3.10 yaml-0.1 --cflags)" organize: - bin/craftctl: libexec/rockcraft/craftctl + bin/craftctl: libexec/rockcraft/craftctl override-build: | ${SNAP}/libexec/snapcraft/craftctl default @@ -83,14 +83,14 @@ parts: source: https://github.com/opencontainers/umoci.git source-tag: v0.4.7 make-parameters: - - umoci.static + - umoci.static override-build: | - make umoci.static - mkdir "$CRAFT_PART_INSTALL"/bin - install -m755 umoci.static "$CRAFT_PART_INSTALL"/bin/umoci + make umoci.static + mkdir "$CRAFT_PART_INSTALL"/bin + install -m755 umoci.static "$CRAFT_PART_INSTALL"/bin/umoci build-packages: - - golang-go - - make + - golang-go + - make skopeo: plugin: nil @@ -101,20 +101,20 @@ parts: mkdir "$CRAFT_PART_INSTALL"/bin install -m755 skopeo "$CRAFT_PART_INSTALL"/bin/skopeo stage-packages: - - libgpgme11 - - libassuan0 - - libbtrfs0 - - libdevmapper1.02.1 + - libgpgme11 + - libassuan0 + - libbtrfs0 + - libdevmapper1.02.1 build-attributes: - - enable-patchelf + - enable-patchelf build-snaps: - - go/1.17/stable + - go/1.17/stable build-packages: - - libgpgme-dev - - libassuan-dev - - libbtrfs-dev - - libdevmapper-dev - - pkg-config + - libgpgme-dev + - libassuan-dev + - libbtrfs-dev + - libdevmapper-dev + - pkg-config chisel: plugin: go diff --git a/spread.yaml b/spread.yaml index 551aa1781..9c7149158 100644 --- a/spread.yaml +++ b/spread.yaml @@ -7,13 +7,13 @@ environment: PATH: /snap/bin:$PATH:$SNAPD_TESTING_TOOLS:$PROJECT_PATH/tools/spread include: - - tests/ - - tools/ - - docs/ - - requirements-doc.txt - - requirements-jammy.txt - - Makefile - - rockcraft/ + - tests/ + - tools/ + - docs/ + - requirements-doc.txt + - requirements-jammy.txt + - Makefile + - rockcraft/ backends: google: @@ -81,11 +81,11 @@ prepare: | snap install docker --channel=core18/stable else snap install docker - fi + fi # make sure docker is working retry -n 10 --wait 2 sh -c 'docker run --rm hello-world' - + install_rockcraft restore-each: | @@ -98,7 +98,7 @@ restore-each: | lxc --project=rockcraft delete --force "$instance" fi done - fi + fi debug-each: | # output latest rockcraft log file on test failure @@ -118,7 +118,7 @@ suites: docs/how-to/code/: summary: tests how-to guides from the docs systems: - - ubuntu-22.04-64 + - ubuntu-22.04-64 docs/reference/code/: summary: tests reference code from the docs @@ -129,4 +129,3 @@ suites: tests/spread/large/: summary: bigger tests that take longer to run manual: true - diff --git a/tests/spread/general/bare-base/task.yaml b/tests/spread/general/bare-base/task.yaml index 84b912866..69bd4ac67 100644 --- a/tests/spread/general/bare-base/task.yaml +++ b/tests/spread/general/bare-base/task.yaml @@ -15,5 +15,5 @@ execute: | grep_docker_log "$id" "ship it!" docker exec "$id" pebble services | grep hello docker exec "$id" pebble ls /usr/bin/hello - + docker rm -f "$id" diff --git a/tests/spread/general/big/rockcraft.yaml b/tests/spread/general/big/rockcraft.yaml index 5570edf69..fea4f44c0 100644 --- a/tests/spread/general/big/rockcraft.yaml +++ b/tests/spread/general/big/rockcraft.yaml @@ -3,10 +3,10 @@ version: latest summary: A big rock to test many features description: | A big rock whose purpose is to test many features while only paying the "setup" - and "teardown" price once. Feel free to add to this file and to "task.yaml", + and "teardown" price once. Feel free to add to this file and to "task.yaml", adding references to issues/PRs where appropriate. license: Apache-2.0 -base: ubuntu:22.04 # Leaving ":"-notation on purpose here +base: ubuntu:22.04 # Leaving ":"-notation on purpose here platforms: amd64: @@ -18,7 +18,7 @@ services: on-success: shutdown on-failure: shutdown working-dir: /tmp - + parts: issue-44-dir-owner: plugin: dump @@ -52,4 +52,3 @@ parts: mkdir fake_rock_dir touch fake_rock_dir/fake_rock_file ln -s fake_rock_dir .rock - diff --git a/tests/spread/general/big/task.yaml b/tests/spread/general/big/task.yaml index b2e4daf13..38bc0581f 100644 --- a/tests/spread/general/big/task.yaml +++ b/tests/spread/general/big/task.yaml @@ -28,7 +28,7 @@ execute: | # Check the rock's output docker run --rm big:latest | MATCH "/tmp" - + ############################################################################################ # test ownership: "newfiles" and "a.txt" are owned by uid 9999, "b.txt" is owned by uid 3333 # (github issue #44) @@ -54,7 +54,7 @@ execute: | file pebble | grep "statically linked" docker rm -f big-container rm pebble - + ############################################################################################ # This check documents the fact that we currently don't preserve/observe symlinks between # layers - we only take the base on which the rock was built into account. If the behavior diff --git a/tests/spread/general/chisel/rockcraft.yaml b/tests/spread/general/chisel/rockcraft.yaml index ea391783e..e28703fa4 100644 --- a/tests/spread/general/chisel/rockcraft.yaml +++ b/tests/spread/general/chisel/rockcraft.yaml @@ -7,7 +7,7 @@ version: "0.0.1" base: bare build_base: ubuntu@22.04 run-user: _daemon_ -services: +services: dotnet: override: replace command: /usr/lib/dotnet/dotnet [ --info ] diff --git a/tests/spread/general/clean/rockcraft.yaml b/tests/spread/general/clean/rockcraft.yaml index 20198a522..f1347bfc7 100644 --- a/tests/spread/general/clean/rockcraft.yaml +++ b/tests/spread/general/clean/rockcraft.yaml @@ -5,9 +5,8 @@ summary: A minimal hello world rock description: A minimal hello world rock license: GPL-3.0 platforms: - amd64: + amd64: parts: - my-part: - plugin: nil - + my-part: + plugin: nil diff --git a/tests/spread/general/craftctl/rockcraft.yaml b/tests/spread/general/craftctl/rockcraft.yaml index 4a76d2349..db731c916 100644 --- a/tests/spread/general/craftctl/rockcraft.yaml +++ b/tests/spread/general/craftctl/rockcraft.yaml @@ -8,7 +8,7 @@ platforms: craftctl: build-on: ["amd64", "i386"] build-for: amd64 - + parts: hello: plugin: make diff --git a/tests/spread/general/craftctl/task.yaml b/tests/spread/general/craftctl/task.yaml index 82fe1331f..2141a6a52 100644 --- a/tests/spread/general/craftctl/task.yaml +++ b/tests/spread/general/craftctl/task.yaml @@ -17,4 +17,3 @@ execute: | docker run --rm --entrypoint /usr/bin/hello craftctl-test:latest docker run --rm craftctl-test:latest help docker run --rm craftctl-test:latest --help - \ No newline at end of file diff --git a/tests/spread/general/destructive/rockcraft.yaml b/tests/spread/general/destructive/rockcraft.yaml index 260b6767b..f946ed436 100644 --- a/tests/spread/general/destructive/rockcraft.yaml +++ b/tests/spread/general/destructive/rockcraft.yaml @@ -3,7 +3,7 @@ version: latest summary: A destructively-built rock description: Building a rock in destructive mode license: Apache-2.0 -build-base: ubuntu:22.04 # Leaving ":"-notation on purpose here +build-base: ubuntu:22.04 # Leaving ":"-notation on purpose here base: bare platforms: amd64: diff --git a/tests/spread/general/destructive/task.yaml b/tests/spread/general/destructive/task.yaml index 7e51f472c..52b4aaff7 100644 --- a/tests/spread/general/destructive/task.yaml +++ b/tests/spread/general/destructive/task.yaml @@ -3,16 +3,16 @@ summary: destructive-mode test execute: | # Check that work dirs *don't* exist test ! -d parts -a ! -d stage -a ! -d prime - + run_rockcraft pack --destructive-mode test -f destructive-mode*.rock - + # Check that work dirs *do* exist test -d parts -a -d stage -a -d prime - + run_rockcraft clean --destructive-mode - + # Check that work dirs *don't* exist again test ! -d parts -a ! -d stage -a ! -d prime diff --git a/tests/spread/general/entrypoint-service/task.yaml b/tests/spread/general/entrypoint-service/task.yaml index 8af1dba18..31882dd54 100644 --- a/tests/spread/general/entrypoint-service/task.yaml +++ b/tests/spread/general/entrypoint-service/task.yaml @@ -7,7 +7,7 @@ execute: | # test container execution sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:entrypoint-service-test_latest_amd64.rock docker-daemon:entrypoint-service-test:latest - rm entrypoint-service-test_latest*.rock + rm entrypoint-service-test_latest*.rock docker images entrypoint-service-test:latest id=$(docker run -d entrypoint-service-test) test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/bin/pebble","enter","--verbose","--args","test-service"]' diff --git a/tests/spread/general/environment/rockcraft.yaml b/tests/spread/general/environment/rockcraft.yaml index 0eb9fc353..bcb39d2eb 100644 --- a/tests/spread/general/environment/rockcraft.yaml +++ b/tests/spread/general/environment/rockcraft.yaml @@ -21,7 +21,7 @@ platforms: amd64v2: build-on: ["amd64", "i386"] build-for: amd64 - + parts: part1: plugin: nil diff --git a/tests/spread/general/environment/task.yaml b/tests/spread/general/environment/task.yaml index 31a3b23fd..83d41e899 100644 --- a/tests/spread/general/environment/task.yaml +++ b/tests/spread/general/environment/task.yaml @@ -10,7 +10,7 @@ execute: | # test container execution docker images sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:environment-test_latest_amd64v2.rock docker-daemon:environment-test:latest - rm environment-test_latest*.rock + rm environment-test_latest*.rock docker images environment-test:latest id=$(docker run --rm -d environment-test -v) grep_docker_log "$id" "X=ship it!" diff --git a/tests/spread/general/health-checks/rockcraft.yaml b/tests/spread/general/health-checks/rockcraft.yaml index f59a43db1..526fd8b3f 100644 --- a/tests/spread/general/health-checks/rockcraft.yaml +++ b/tests/spread/general/health-checks/rockcraft.yaml @@ -6,7 +6,7 @@ license: Apache-2.0 version: latest base: ubuntu@22.04 -services: +services: webserver: override: replace command: timeout 30 nginx -g 'daemon off;' @@ -39,7 +39,7 @@ package-repositories: - type: apt url: https://nginx.org/packages/mainline/ubuntu key-id: 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 - suites: + suites: - jammy components: - nginx diff --git a/tests/spread/general/invalid-name/rockcraft.orig.yaml b/tests/spread/general/invalid-name/rockcraft.orig.yaml index 85131e28b..14ad2a5f2 100644 --- a/tests/spread/general/invalid-name/rockcraft.orig.yaml +++ b/tests/spread/general/invalid-name/rockcraft.orig.yaml @@ -5,8 +5,8 @@ summary: A rock with an invalid name description: A rock with an invalid name license: GPL-3.0 platforms: - amd64: + amd64: parts: - my-part: - plugin: nil + my-part: + plugin: nil diff --git a/tests/spread/general/invalid-name/task.yaml b/tests/spread/general/invalid-name/task.yaml index 9b64999c0..dd8e0311a 100644 --- a/tests/spread/general/invalid-name/task.yaml +++ b/tests/spread/general/invalid-name/task.yaml @@ -5,4 +5,4 @@ execute: | do sed "s/placeholder-name/$name/" rockcraft.orig.yaml > rockcraft.yaml rockcraft pack 2>&1 >/dev/null | MATCH "Invalid name for rock" - done \ No newline at end of file + done diff --git a/tests/spread/general/overlay-logs/rockcraft.yaml b/tests/spread/general/overlay-logs/rockcraft.yaml index 4f8d9ded3..6aef5b0fc 100644 --- a/tests/spread/general/overlay-logs/rockcraft.yaml +++ b/tests/spread/general/overlay-logs/rockcraft.yaml @@ -5,9 +5,9 @@ summary: Check overlay logs description: Check that actions done inside the overlay are logged license: GPL-3.0 platforms: - amd64: + amd64: parts: - my-part: - plugin: nil - overlay-packages: [idontexist] + my-part: + plugin: nil + overlay-packages: [idontexist] diff --git a/tests/spread/general/plugin-go/task.yaml b/tests/spread/general/plugin-go/task.yaml index c3e88fb74..e29eab3a2 100644 --- a/tests/spread/general/plugin-go/task.yaml +++ b/tests/spread/general/plugin-go/task.yaml @@ -2,4 +2,3 @@ summary: check that the build-snap used by the go plugin does not interfere with execute: | run_rockcraft prime - diff --git a/tests/spread/general/plugin-python-3.6/rockcraft.orig.yaml b/tests/spread/general/plugin-python-3.6/rockcraft.orig.yaml index df4c47edb..a120e4ef0 100644 --- a/tests/spread/general/plugin-python-3.6/rockcraft.orig.yaml +++ b/tests/spread/general/plugin-python-3.6/rockcraft.orig.yaml @@ -6,7 +6,7 @@ summary: A project using Python 3.6 description: A project using Python 3.6 license: GPL-3.0 platforms: - amd64: + amd64: package-repositories: - type: apt @@ -14,9 +14,9 @@ package-repositories: priority: always parts: - my-part: - plugin: python - source: src - stage-packages: [python3.6-venv] - build-environment: - - PARTS_PYTHON_INTERPRETER: python3.6 + my-part: + plugin: python + source: src + stage-packages: [python3.6-venv] + build-environment: + - PARTS_PYTHON_INTERPRETER: python3.6 diff --git a/tests/spread/general/plugin-python-error/rockcraft.orig.yaml b/tests/spread/general/plugin-python-error/rockcraft.orig.yaml index 25f8b4afc..0933bd912 100644 --- a/tests/spread/general/plugin-python-error/rockcraft.orig.yaml +++ b/tests/spread/general/plugin-python-error/rockcraft.orig.yaml @@ -6,10 +6,10 @@ summary: An invalid Python plugin project description: A project that uses the Python plugin but doesn't include Python license: GPL-3.0 platforms: - amd64: + amd64: parts: - my-part: - plugin: python - source: . - build-packages: [python3-pip] + my-part: + plugin: python + source: . + build-packages: [python3-pip] diff --git a/tests/spread/general/plugin-python/base-2204/rockcraft.yaml b/tests/spread/general/plugin-python/base-2204/rockcraft.yaml index f02ddd2c7..6a74d6a53 100644 --- a/tests/spread/general/plugin-python/base-2204/rockcraft.yaml +++ b/tests/spread/general/plugin-python/base-2204/rockcraft.yaml @@ -2,4 +2,4 @@ name: base-2204 base: ubuntu@22.04 # Remaining contents will come from "parts.yaml" -#'/usr/lib/python3/dist-packages', '/lib/python3.10/site-packages' \ No newline at end of file +# '/usr/lib/python3/dist-packages', '/lib/python3.10/site-packages' diff --git a/tests/spread/general/plugin-python/parts.yaml b/tests/spread/general/plugin-python/parts.yaml index 65b0dede4..34b0277da 100644 --- a/tests/spread/general/plugin-python/parts.yaml +++ b/tests/spread/general/plugin-python/parts.yaml @@ -1,4 +1,3 @@ - # Actual parts definition for the rockcraft + python cases that we are testing. # (this gets appended to all rockcraft.yaml files in the subdirectories in the # main task.yaml). diff --git a/tests/spread/general/plugin-python/task.yaml b/tests/spread/general/plugin-python/task.yaml index fca5194cc..213db3f4c 100644 --- a/tests/spread/general/plugin-python/task.yaml +++ b/tests/spread/general/plugin-python/task.yaml @@ -8,40 +8,40 @@ execute: | SCENARIO_DIR="${SCENARIO}" ROCK_FILE="${SCENARIO}_0.1_amd64.rock" IMAGE="${SCENARIO}:0.1" - + # change into the scenario's directory cd ${SCENARIO_DIR} - + # add the parts definition, common to all scenarios cat ../parts.yaml >> rockcraft.yaml - + # copy the Python source of the project we're building (also shared) cp -r ../src . - + # Build the rock & load it into docker run_rockcraft pack test -f ${ROCK_FILE} sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:${ROCK_FILE} docker-daemon:${IMAGE} docker images rm ${ROCK_FILE} - + # Run the packaged project, both via the console script and via "python -m" docker run --rm $IMAGE exec hello | MATCH "hello world" docker run --rm $IMAGE exec /bin/python3 -m hello | MATCH "hello world" docker run --rm $IMAGE exec /usr/bin/python3 -m hello | MATCH "hello world" docker run --rm $IMAGE exec python3 -m hello | MATCH "hello world" - + # Run the extra Python package, installed as a python-package, to make sure it's found docker run --rm $IMAGE exec black --version docker run --rm $IMAGE exec /bin/python3 -m black --version docker run --rm $IMAGE exec /usr/bin/python3 -m black --version docker run --rm $IMAGE exec python3 -m black --version - + # Run the extra Python dist-package, installed as a stage-package, to make sure it's found docker run --rm $IMAGE exec /bin/python3 -m cpuinfo --help docker run --rm $IMAGE exec /usr/bin/python3 -m cpuinfo --help docker run --rm $IMAGE exec python3 -m cpuinfo --help - + # Run "check-pythonpath.py" to make sure the ordering of the packages dirs is correct docker run --rm $IMAGE exec /bin/python3 /check-pythonpath.py docker run --rm $IMAGE exec /usr/bin/python3 /check-pythonpath.py diff --git a/tests/spread/general/prune/task.yaml b/tests/spread/general/prune/task.yaml index 615270a5d..c89983789 100644 --- a/tests/spread/general/prune/task.yaml +++ b/tests/spread/general/prune/task.yaml @@ -4,7 +4,7 @@ execute: | run_rockcraft pack test -f ./*.rock - + # Unpack the rock and verify that the lifecycle-based layer has no files in # common with the base Ubuntu layer. tar -xf ./*.rock diff --git a/tests/spread/general/repo-bare-base/task.yaml b/tests/spread/general/repo-bare-base/task.yaml index 794a5bf1d..0162d67e7 100644 --- a/tests/spread/general/repo-bare-base/task.yaml +++ b/tests/spread/general/repo-bare-base/task.yaml @@ -12,7 +12,7 @@ execute: | sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:apt-repo-static-test_latest_amd64.rock docker-daemon:apt-repo-static-test:latest # Ensure container exists docker images apt-repo-static-test | MATCH "apt-repo-static-test" - + docker run --rm apt-repo-static-test exec /bin/bash-static /usr/bin/test-ppa | MATCH "hello!" restore: | diff --git a/tests/spread/general/repo-ubuntu-base/task.yaml b/tests/spread/general/repo-ubuntu-base/task.yaml index 2dc789e63..be4c10f32 100644 --- a/tests/spread/general/repo-ubuntu-base/task.yaml +++ b/tests/spread/general/repo-ubuntu-base/task.yaml @@ -12,9 +12,9 @@ execute: | sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:apt-repo-test_latest_amd64.rock docker-daemon:apt-repo-test:latest # Ensure container exists docker images apt-repo-test | MATCH "apt-repo-test" - + docker run --rm apt-repo-test exec /usr/bin/python3.12 -c "import sys;print(sys.version)" | MATCH "3.12" - + restore: | rm -f apt-repo-test_latest_amd64.rock docker rmi -f apt-repo-test diff --git a/tests/spread/general/run-user/rockcraft.yaml b/tests/spread/general/run-user/rockcraft.yaml index 6b38b1325..46b5292aa 100644 --- a/tests/spread/general/run-user/rockcraft.yaml +++ b/tests/spread/general/run-user/rockcraft.yaml @@ -21,4 +21,3 @@ parts: overlay-script: | set -x useradd -R $CRAFT_OVERLAY -M -U -r test-user - \ No newline at end of file diff --git a/tests/spread/general/run-user/task.yaml b/tests/spread/general/run-user/task.yaml index 5b5571653..b5e8de0c8 100644 --- a/tests/spread/general/run-user/task.yaml +++ b/tests/spread/general/run-user/task.yaml @@ -13,7 +13,7 @@ execute: | # Ensure container exists docker images run-user-test | MATCH "run-user-test" docker inspect run-user-test --format '{{.Config.User}}' | MATCH "_daemon_" - + # ensure container doesn't exist docker rm -f run-user-test-container docker run --rm --entrypoint /bin/sh run-user-test -c 'whoami' | MATCH "_daemon_" diff --git a/tests/spread/general/usrmerge/rockcraft.yaml b/tests/spread/general/usrmerge/rockcraft.yaml index 77c2f5c19..5f1b2554c 100644 --- a/tests/spread/general/usrmerge/rockcraft.yaml +++ b/tests/spread/general/usrmerge/rockcraft.yaml @@ -14,11 +14,11 @@ parts: # This build script adds a file in bin/ - the symlink in the base should be preserved. mkdir ${CRAFT_PART_INSTALL}/bin touch ${CRAFT_PART_INSTALL}/bin/new_bin_file - + # Also add subdirectories in bin/ to make sure they are correctly handled. mkdir -p ${CRAFT_PART_INSTALL}/bin/subdir1/subdir2 touch ${CRAFT_PART_INSTALL}/bin/subdir1/subdir2/subdir_bin_file - + # Also add the same subdirectory structure in usr/bin/ to make sure they are not # duplicated in the layer file mkdir -p ${CRAFT_PART_INSTALL}/usr/bin/subdir1/subdir2 diff --git a/tests/spread/general/usrmerge/task.yaml b/tests/spread/general/usrmerge/task.yaml index ab4dde6ec..8829a45be 100644 --- a/tests/spread/general/usrmerge/task.yaml +++ b/tests/spread/general/usrmerge/task.yaml @@ -13,13 +13,13 @@ execute: | rm "$ROCK" docker images usrmerge:latest - + ############################################################################################ # check that the /bin symlink to /usr/bin *was not* broken by the /bin/new_bin_file addition ############################################################################################ docker run --rm usrmerge exec readlink /bin | MATCH usr/bin docker run --rm usrmerge exec ls /bin/bash /bin/new_bin_file /bin/subdir1/subdir2/subdir_bin_file - + ############################################################################################ # check that the contents of bin/ and usr/bin *both* ended up in /usr/bin ############################################################################################