Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 1 | #!/bin/bash -xe |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 2 | |
azvyagintsev | 41bc80d | 2018-07-12 13:46:56 +0300 | [diff] [blame] | 3 | SALT_OPTS="-l debug -t 10 --retcode-passthrough --no-color" |
| 4 | |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 5 | #aptly |
azvyagintsev | 9e0e68b | 2018-10-31 12:21:14 +0200 | [diff] [blame] | 6 | # Drop auto-generated by aptly itself certs |
| 7 | rm -rfv /srv/volumes/aptly/{.gnupg,gpg_batch,public/public.gpg} |
azvyagintsev | 0955f72 | 2018-07-13 21:01:19 +0300 | [diff] [blame] | 8 | salt-call ${SALT_OPTS} state.sls aptly.server |
azvyagintsev | 9e0e68b | 2018-10-31 12:21:14 +0200 | [diff] [blame] | 9 | sleep 10 |
azvyagintsev | 41bc80d | 2018-07-12 13:46:56 +0300 | [diff] [blame] | 10 | salt-call ${SALT_OPTS} state.sls aptly.publisher |
azvyagintsev | 9e0e68b | 2018-10-31 12:21:14 +0200 | [diff] [blame] | 11 | sleep 10 |
azvyagintsev | 0955f72 | 2018-07-13 21:01:19 +0300 | [diff] [blame] | 12 | salt-call ${SALT_OPTS} state.sls aptly |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 13 | aptly_mirror_update.sh -sv |
azvyagintsev | 29410ee | 2018-07-12 20:02:30 +0300 | [diff] [blame] | 14 | aptly-publisher --url http://10.99.0.1:18084 --timeout=1200 publish -v -d -c /etc/aptly/publisher.yaml --architectures amd64 --recreate --force-overwrite |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 15 | |
| 16 | #docker registry |
azvyagintsev | 41bc80d | 2018-07-12 13:46:56 +0300 | [diff] [blame] | 17 | salt-call ${SALT_OPTS} state.sls docker.client.registry |
| 18 | docker system prune --all --force || true |
Richard Felkl | 4775790 | 2018-03-02 22:44:43 +0100 | [diff] [blame] | 19 | |
| 20 | #debmirror |
azvyagintsev | 41bc80d | 2018-07-12 13:46:56 +0300 | [diff] [blame] | 21 | salt-call ${SALT_OPTS} state.sls debmirror |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 22 | |
Richard Felkl | d59c565 | 2018-02-08 13:14:05 +0100 | [diff] [blame] | 23 | #git |
azvyagintsev | 41bc80d | 2018-07-12 13:46:56 +0300 | [diff] [blame] | 24 | salt-call ${SALT_OPTS} state.sls git.server |
azvyagintsev | 8b5ea0b | 2018-10-30 19:48:19 +0200 | [diff] [blame] | 25 | # Enable 'update' hook. |
| 26 | # Those would prevent failures for 2018q3+ model releases, where |
| 27 | # 'system.linux.system.repo.mcp.apt_mirantis.update.xxx' enabled by default |
| 28 | pushd /srv/volumes/aptly/public/ |
Ivan Berezovskiy | bd80ff4 | 2018-11-30 14:38:02 +0400 | [diff] [blame^] | 29 | CUR_V=$(salt-call pillar.get _param:mcp_version --out text | awk '{print $2}') |
azvyagintsev | 8b5ea0b | 2018-10-30 19:48:19 +0200 | [diff] [blame] | 30 | mkdir -p update |
| 31 | ln -s ../${CUR_V} update/${CUR_V} || true |
| 32 | popd |