File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ function execute_stage2_playbook {
6666 $ARGS
6767}
6868
69+ function generate_and_upload_sbom {
70+ nix run github:supabase/postgres#ubuntu-sbom -- --nix-target /nix/var/nix/profiles/default --include-files --no-progress --output /tmp/ami-system-sbom.json
71+ }
72+
6973function cleanup_packages {
7074 apt-get remove --purge --yes ansible
7175}
@@ -79,7 +83,6 @@ function report_packages {
7983 # shellcheck disable=SC2016
8084 dpkg-query -W -f=' ${Package}\t${Version}\t${Architecture}\n' | LC_COLLATE=C.UTF-8 sort
8185 find /nix/store -maxdepth 1 | LC_COLLATE=C.UTF-8 sort -t- -k2
82- nix run .# ubuntu-sbom -- --nix-target /nix/var/nix/profiles/default --include-files --no-progress --output /tmp/ami-system-sbom.json
8386}
8487
8588function report_disk_usage {
@@ -93,9 +96,10 @@ update_and_upgrade_apt
9396install_packages
9497install_nix
9598execute_stage2_playbook
99+ generate_and_upload_sbom
96100cleanup_packages
97- cleanup_nix
98101update_and_upgrade_apt
99102cleanup_apt
100103report_packages
104+ cleanup_nix
101105report_disk_usage
Original file line number Diff line number Diff line change @@ -162,6 +162,11 @@ function execute_stage2_playbook {
162162 --extra-vars @./ansible/qemu-vars.yaml
163163}
164164
165+
166+ function generate_and_upload_sbom {
167+ nix run github:supabase/postgres#ubuntu-sbom -- --nix-target /nix/var/nix/profiles/default --include-files --no-progress --output /tmp/ami-system-sbom.json
168+ }
169+
165170function clean_legacy_things {
166171 # removes things that are bundled for legacy reasons, but we can start without for our newer artifacts
167172 apt-mark auto zlib1g* # TODO (darora): need to make sure that there aren't other things that still need this
@@ -268,6 +273,7 @@ execute_playbook
268273
269274install_nix
270275execute_stage2_playbook
276+ generate_and_upload_sbom
271277clean_legacy_things
272278clean_system
273279clean_nix
Original file line number Diff line number Diff line change 3434 cli-smoke-test = mkApp "cli-smoke-test" ;
3535 ubuntu-sbom = {
3636 type = "app" ;
37- program = "${ self' . packages . ubuntu- sbom} /bin/ubuntu-sbom" ;
37+ program = "${ self' . packages . sbom } /bin/ubuntu-sbom" ;
3838 } ;
3939 } ;
4040 } ;
Original file line number Diff line number Diff line change 120120 inherit ( pkgs ) yq ;
121121 postgresql_15 = self' . packages . "postgresql_15" ;
122122 } ;
123- ubuntu-sbom =
124- inputs . ubuntu-nix-sbom . packages . ${ pkgs . stdenv . hostPlatform . system } . ubuntu-sbom-generator ;
123+ sbom = inputs . ubuntu-nix-sbom . packages . ${ pkgs . stdenv . hostPlatform . system } . sbom ;
125124 inherit ( pkgs . callPackage ./wal-g.nix { } ) wal-g-2 wal-g-3 ;
126125 inherit ( supascan-pkgs ) goss supascan supascan-specs ;
127126 inherit ( pg-startup-profiler-pkgs ) pg-startup-profiler ;
You can’t perform that action at this time.
0 commit comments