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/ /**/ansible/inventories/test/
/bin /bin
/images /images
/images.txt
/tmp /tmp
packer/*.json packer/*.json

View file

@ -75,10 +75,10 @@ security_scanner:
- docker:dind - docker:dind
script: script:
- scripts/packer.sh debian-buster - 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: artifacts:
paths: paths:
- images/*.initramfs - images.txt
- images/*.dpkg-list - images/*.dpkg-list
- images/*.initramfs - images/*.initramfs
- images/*.linux - images/*.linux

View file

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