| #!/bin/bash -xe |
| |
| SALT_OPTS="-l debug -t 10 --retcode-passthrough --no-color" |
| |
| #aptly |
| # Drop auto-generated by aptly itself certs |
| rm -rfv /srv/volumes/aptly/{.gnupg,gpg_batch,public/public.gpg} |
| salt-call ${SALT_OPTS} state.sls aptly.server |
| sleep 10 |
| salt-call ${SALT_OPTS} state.sls aptly.publisher |
| sleep 10 |
| salt-call ${SALT_OPTS} state.sls aptly |
| aptly_mirror_update.sh -sv |
| aptly-publisher --url http://10.99.0.1:18084 --timeout=1200 publish -v -d -c /etc/aptly/publisher.yaml --architectures amd64 --recreate --force-overwrite |
| |
| #docker registry |
| salt-call ${SALT_OPTS} state.sls docker.client.registry |
| docker system prune --all --force || true |
| |
| #debmirror |
| salt-call ${SALT_OPTS} state.sls debmirror |
| |
| #git |
| salt-call ${SALT_OPTS} state.sls git.server |
| # Enable 'update' hook. |
| # Those would prevent failures for 2018q3+ model releases, where |
| # 'system.linux.system.repo.mcp.apt_mirantis.update.xxx' enabled by default |
| pushd /srv/volumes/aptly/public/ |
| CUR_V=$(salt-call pillar.get _param:apt_mk_version --out text | awk '{print $2}') |
| mkdir -p update |
| ln -s ../${CUR_V} update/${CUR_V} || true |
| popd |