Skip to content

Commit

Permalink
test: add a bom workflow with substitutions (project-stacker#562)
Browse files Browse the repository at this point in the history
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
  • Loading branch information
rchincha authored Nov 25, 2023
1 parent 2f284d8 commit da119e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/bom.bats
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ bom-child:
type: built
tag: bom-parent
bom:
generate: true
generate: ${{GENERATE}}
packages:
- name: pkg3
version: 1.0.0
Expand All @@ -129,7 +129,7 @@ bom-child:
org.opencontainers.image.vendor: bom-test
org.opencontainers.image.licenses: MIT
EOF
stacker build
stacker build --substitute GENERATE=true
[ -f .stacker/artifacts/bom-parent/installed-packages.json ]
# a full inventory for this image
[ -f .stacker/artifacts/bom-parent/inventory.json ]
Expand Down Expand Up @@ -163,7 +163,7 @@ bom-alpine:
type: docker
url: docker://ghcr.io/project-stacker/alpine:edge
bom:
generate: true
generate: ${{GENERATE}}
packages:
- name: pkg1
version: 1.0.0
Expand All @@ -175,15 +175,15 @@ bom-alpine:
org.opencontainers.image.licenses: MIT
run: |
# discover installed pkgs
/stacker/tools/static-stacker bom discover
[ ${{GENERATE}} = true ] && /stacker/tools/static-stacker bom discover
# run our cmds
ls -al /
# some changes
touch /file1
# cleanup
rm -f /etc/alpine-release /etc/apk/arch /etc/apk/repositories /etc/apk/world /etc/issue /etc/os-release /etc/secfixes.d/alpine /lib/apk/db/installed /lib/apk/db/lock /lib/apk/db/scripts.tar /lib/apk/db/triggers
EOF
stacker build
stacker build --substitute GENERATE=true
[ -f .stacker/artifacts/bom-alpine/installed-packages.json ]
# a full inventory for this image
[ -f .stacker/artifacts/bom-alpine/inventory.json ]
Expand Down

0 comments on commit da119e7

Please sign in to comment.