blob: 224ebe7c19cb745af8df7a4d8c6f99ccff3c9cb6 [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
azvyagintsev41bc80d2018-07-12 13:46:56 +03006# FIXME: remove duplicate run after fix: PROD-21387
7# RC: aptly may fail to import gpg key's randomly(most probably,nw issue), so lets run it twice
azvyagintsev0955f722018-07-13 21:01:19 +03008salt-call ${SALT_OPTS} state.sls aptly.server || true
9sleep 5
10salt-call ${SALT_OPTS} state.sls aptly.server
azvyagintsev41bc80d2018-07-12 13:46:56 +030011salt-call ${SALT_OPTS} state.sls aptly.publisher
azvyagintsev0955f722018-07-13 21:01:19 +030012salt-call ${SALT_OPTS} state.sls aptly || true
13sleep 5
14salt-call ${SALT_OPTS} state.sls aptly
Richard Felkl47757902018-03-02 22:44:43 +010015aptly_mirror_update.sh -sv
azvyagintsev29410ee2018-07-12 20:02:30 +030016aptly-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 +010017
18#docker registry
azvyagintsev41bc80d2018-07-12 13:46:56 +030019salt-call ${SALT_OPTS} state.sls docker.client.registry
20docker system prune --all --force || true
Richard Felkl47757902018-03-02 22:44:43 +010021
22#debmirror
azvyagintsev41bc80d2018-07-12 13:46:56 +030023salt-call ${SALT_OPTS} state.sls debmirror
Richard Felkld59c5652018-02-08 13:14:05 +010024
Richard Felkld59c5652018-02-08 13:14:05 +010025#git
azvyagintsev41bc80d2018-07-12 13:46:56 +030026salt-call ${SALT_OPTS} state.sls git.server
azvyagintsev8b5ea0b2018-10-30 19:48:19 +020027# Enable 'update' hook.
28# Those would prevent failures for 2018q3+ model releases, where
29# 'system.linux.system.repo.mcp.apt_mirantis.update.xxx' enabled by default
30pushd /srv/volumes/aptly/public/
31 CUR_V=$(salt-call pillar.get _param:apt_mk_version --out text | awk '{print $2}')
32 mkdir -p update
33 ln -s ../${CUR_V} update/${CUR_V} || true
34popd