Write image names to image.txt

This commit is contained in:
Jakob Lechner 2020-01-24 00:10:23 +01:00
parent 7ec88bfe39
commit 762869b77c
3 changed files with 11 additions and 5 deletions

1
.gitignore vendored
View file

@ -2,5 +2,6 @@
/**/ansible/inventories/test/
/bin
/images
/images.txt
/tmp
packer/*.json

View file

@ -75,10 +75,10 @@ security_scanner:
- docker:dind
script:
- scripts/packer.sh debian-buster
- aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive
- aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive --no-progress
artifacts:
paths:
- images/*.initramfs
- images.txt
- images/*.dpkg-list
- images/*.initramfs
- images/*.linux

View file

@ -1,12 +1,17 @@
#!/bin/sh
set -e
set -o nounset
export NAME="$1"
mkdir -p images
export IMAGES="$(realpath images)"
(
cd packer
python3 -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout, indent=4)' < "$NAME.yaml" > "$NAME.json"
packer build "$NAME.json"
)
echo "$NAME" >> images.txt