blob: bdf686e9fba1191b44df91f51b359a721be21be1 [file] [log] [blame]
Richard Felkld59c5652018-02-08 13:14:05 +01001#!/bin/bash -xe
Richard Felkld59c5652018-02-08 13:14:05 +01002
azvyagintsev41bc80d2018-07-12 13:46:56 +03003SALT_OPTS="-l debug -t 10 --retcode-passthrough --no-color"
4
Richard Felkld59c5652018-02-08 13:14:05 +01005#aptly
azvyagintsev9e0e68b2018-10-31 12:21:14 +02006# Drop auto-generated by aptly itself certs
7rm -rfv /srv/volumes/aptly/{.gnupg,gpg_batch,public/public.gpg}
azvyagintsev0955f722018-07-13 21:01:19 +03008salt-call ${SALT_OPTS} state.sls aptly.server
azvyagintsev9e0e68b2018-10-31 12:21:14 +02009sleep 10
azvyagintsev41bc80d2018-07-12 13:46:56 +030010salt-call ${SALT_OPTS} state.sls aptly.publisher
azvyagintsev9e0e68b2018-10-31 12:21:14 +020011sleep 10
azvyagintsev0955f722018-07-13 21:01:19 +030012salt-call ${SALT_OPTS} state.sls aptly
Richard Felkl47757902018-03-02 22:44:43 +010013aptly_mirror_update.sh -sv
azvyagintsev29410ee2018-07-12 20:02:30 +030014aptly-publisher --url http://10.99.0.1:18084 --timeout=1200 publish -v -d -c /etc/aptly/publisher.yaml --architectures amd64 --recreate --force-overwrite
Richard Felkl47757902018-03-02 22:44:43 +010015
16#docker registry
azvyagintsev41bc80d2018-07-12 13:46:56 +030017salt-call ${SALT_OPTS} state.sls docker.client.registry
18docker system prune --all --force || true
Richard Felkl47757902018-03-02 22:44:43 +010019
20#debmirror
azvyagintsev41bc80d2018-07-12 13:46:56 +030021salt-call ${SALT_OPTS} state.sls debmirror
Richard Felkld59c5652018-02-08 13:14:05 +010022
Richard Felkld59c5652018-02-08 13:14:05 +010023#git
azvyagintsev41bc80d2018-07-12 13:46:56 +030024salt-call ${SALT_OPTS} state.sls git.server
azvyagintsev8b5ea0b2018-10-30 19:48:19 +020025# 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
28pushd /srv/volumes/aptly/public/
Ivan Berezovskiybd80ff42018-11-30 14:38:02 +040029 CUR_V=$(salt-call pillar.get _param:mcp_version --out text | awk '{print $2}')
azvyagintsev8b5ea0b2018-10-30 19:48:19 +020030 mkdir -p update
31 ln -s ../${CUR_V} update/${CUR_V} || true
32popd