blob: bed99ff33b69c81a93a6db87de9bb9d80850bce0 [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
azvyagintsevebe18912018-12-29 21:37:43 +020023# maas
24salt-call ${SALT_OPTS} state.sls maas.mirror
25
Richard Felkld59c5652018-02-08 13:14:05 +010026#git
azvyagintsev41bc80d2018-07-12 13:46:56 +030027salt-call ${SALT_OPTS} state.sls git.server
Denis Egorenkocae5b3e2019-12-13 15:03:44 +040028
29CUR_V=$(salt-call pillar.get _param:mcp_version --out text | awk '{print $2}')
30# get tagged mcp_version for current latest MU 2019.2.x
Denis Egorenko31879652019-12-16 13:48:52 +040031CUR_T=$(salt-call pillar.get _param:mcp_tagged_version --out text | awk '{print $2}')
azvyagintsev8b5ea0b2018-10-30 19:48:19 +020032# Enable 'update' hook.
33# Those would prevent failures for 2018q3+ model releases, where
34# 'system.linux.system.repo.mcp.apt_mirantis.update.xxx' enabled by default
35pushd /srv/volumes/aptly/public/
azvyagintsev8b5ea0b2018-10-30 19:48:19 +020036 mkdir -p update
37 ln -s ../${CUR_V} update/${CUR_V} || true
Denis Egorenkocae5b3e2019-12-13 15:03:44 +040038 if [[ -n "${CUR_T}" ]]; then
39 ln -s ${CUR_V} ${CUR_T}
Denis Egorenko31879652019-12-16 13:48:52 +040040 # usually should be just ln -s ../update/${CUR_V} update/${CUR_T} - but need to specify dir in case of proposed testing
Denis Egorenkocae5b3e2019-12-13 15:03:44 +040041 UPDATE_DIR=$(salt-call pillar.get _param:debmirror_mirrors_update_target_dir --out text | awk '{print $2}')
Denis Egorenko31879652019-12-16 13:48:52 +040042 ln -s ../update/$(basename ${UPDATE_DIR}) update/${CUR_T}
Denis Egorenkocae5b3e2019-12-13 15:03:44 +040043 fi
Vladimir Khlyunev96d10ca2021-03-01 18:49:24 +040044 # fixing permission for nginx access
45 find . ! -perm -o+r -exec chmod o+r {} \;
azvyagintsev8b5ea0b2018-10-30 19:48:19 +020046popd
Denis Egorenkocae5b3e2019-12-13 15:03:44 +040047if [[ -n "${CUR_T}" ]]; then
48 ln -s /srv/http/${CUR_V} /srv/http/${CUR_T}
49fi