|
| 1 | +name: soci-snapshotter |
| 2 | +variant: scratch |
| 3 | +shell: /bin/bash |
| 4 | +dependencies: |
| 5 | + - stage: base |
| 6 | +steps: |
| 7 | + - sources: |
| 8 | + - url: https://github.com/awslabs/soci-snapshotter/archive/refs/tags/{{ .SOCI_SNAPSHOTTER_VERSION }}.tar.gz |
| 9 | + destination: soci-snapshotter.tar.gz |
| 10 | + sha256: {{ .SOCI_SNAPSHOTTER_SHA256 }} |
| 11 | + sha512: {{ .SOCI_SNAPSHOTTER_SHA512 }} |
| 12 | + env: |
| 13 | + GOPATH: /tmp/go |
| 14 | + cachePaths: |
| 15 | + - /.cache/go-build |
| 16 | + - /tmp/go/pkg |
| 17 | + - network: default |
| 18 | + prepare: |
| 19 | + - | |
| 20 | + mkdir -p ${GOPATH}/src/github.com/awslabs/soci-snapshotter |
| 21 | +
|
| 22 | + tar -xzf soci-snapshotter.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/awslabs/soci-snapshotter |
| 23 | + - | |
| 24 | + cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter/cmd |
| 25 | + go mod download |
| 26 | + - network: none |
| 27 | + build: |
| 28 | + - | |
| 29 | + cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter |
| 30 | +
|
| 31 | + make soci-snapshotter-grpc |
| 32 | + make soci |
| 33 | + install: |
| 34 | + - | |
| 35 | + mkdir -p /rootfs/usr/local/bin |
| 36 | + mkdir -p /rootfs/usr/local/lib/containers/soci-snapshotter |
| 37 | +
|
| 38 | + cd ${GOPATH}/src/github.com/containerd/soci-snapshotter |
| 39 | +
|
| 40 | + cp ./out/soci-snapshotter-grpc /rootfs/usr/local/lib/containers/soci-snapshotter/soci-snapshotter-grpc |
| 41 | + chmod +x rootfs/usr/local/lib/containers/soci-snapshotter/soci-snapshotter-grpc |
| 42 | +
|
| 43 | + cp ./out/soci /rootfs/usr/local/lib/containers/soci-snapshotter/soci |
| 44 | + chmod +x rootfs/usr/local/lib/containers/soci-snapshotter/soci |
| 45 | +
|
| 46 | + cp /pkg/config.toml /rootfs/usr/local/lib/containers/soci-snapshotter/etc/soci-snapshotter-grpc/config.toml |
| 47 | + - | |
| 48 | + mkdir -p /rootfs/etc/cri/conf.d |
| 49 | + cp /pkg/10-soci-snapshotter.part /rootfs/etc/cri/conf.d/10-soci-snapshotter.part |
| 50 | +
|
| 51 | + mkdir -p /rootfs/usr/local/etc/containers |
| 52 | + cp /pkg/soci-snapshotter.yaml /rootfs/usr/local/etc/containers/ |
| 53 | + test: |
| 54 | + - | |
| 55 | + mkdir -p /extensions-validator-rootfs |
| 56 | + cp -r /rootfs/ /extensions-validator-rootfs/rootfs |
| 57 | + cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml |
| 58 | + /extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}" |
| 59 | + sbom: |
| 60 | + outputPath: /rootfs/usr/local/share/spdx/soci-snapshotter.spdx.json |
| 61 | + version: {{ .SOCI_SNAPSHOTTER_VERSION }} |
| 62 | + licenses: |
| 63 | + - Apache-2.0 |
| 64 | +finalize: |
| 65 | + - from: /rootfs |
| 66 | + to: /rootfs |
| 67 | + - from: /pkg/manifest.yaml |
| 68 | + to: / |
0 commit comments