64 lines
1.1 KiB
YAML
64 lines
1.1 KiB
YAML
image: docker:latest
|
|
|
|
variables:
|
|
PACKER_VERSION: 1.2.0
|
|
|
|
stages:
|
|
- setup
|
|
- rootfs
|
|
- torrent
|
|
|
|
prepare:
|
|
variables:
|
|
ZIPFILE: packer_${PACKER_VERSION}_linux_amd64.zip
|
|
stage: setup
|
|
cache:
|
|
key: binaries
|
|
paths:
|
|
- bin
|
|
script:
|
|
- mkdir -p bin
|
|
- |
|
|
[ ! -e bin/packer ] && wget -c https://releases.hashicorp.com/packer/${PACKER_VERSION}/${ZIPFILE} && unzip "$ZIPFILE" -d bin && rm -f "$ZIPFILE"
|
|
- apk add --no-cache mktorrent
|
|
only:
|
|
- /ci/
|
|
|
|
packer:
|
|
stage: rootfs
|
|
script:
|
|
- bin/packer build packer.json
|
|
- gzip -k -f rootfs.tar
|
|
artifacts:
|
|
paths:
|
|
- rootfs.tar
|
|
expire_in: 2 weeks
|
|
cache:
|
|
key: binaries
|
|
paths:
|
|
- bin
|
|
policy: pull
|
|
only:
|
|
- /ci/
|
|
|
|
mktorrent:
|
|
stage: torrent
|
|
dependencies:
|
|
- packer
|
|
variables:
|
|
ANNOUNCE: udp://tracker.sbruder.de:6969/announce
|
|
WEBSEED: http://10.2.2.1:8081/rootfs.tar.gz
|
|
script:
|
|
- mktorrent -a "$ANNOUNCE" -o rootfs.torrent -l 22 -w "$WEBSEED" rootfs.tar.gz
|
|
artifacts:
|
|
paths:
|
|
- rootfs.torrent
|
|
expire_in: 2 weeks
|
|
cache:
|
|
key: binaries
|
|
paths:
|
|
- bin
|
|
policy: pull
|
|
only:
|
|
- /ci/
|
|
|