Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | |
Jiri Broulik | ddd5526 | 2018-04-11 14:52:43 +0200 | [diff] [blame] | 3 | FORMULA_VERSION=${FORMULA_VERSION:-2018.3.1} |
Jiri Broulik | 05c5b60 | 2018-04-11 13:52:37 +0200 | [diff] [blame] | 4 | APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"} |
| 5 | |
Jiri Broulik | aa400a0 | 2018-04-12 00:18:47 +0200 | [diff] [blame] | 6 | salt-call -t 5 --retcode-passthrough reclass.validate_pillar |
| 7 | |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 8 | echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list |
| 9 | apt-get update |
| 10 | apt-get install salt-formula* -y |
| 11 | salt-call saltutil.refresh_pillar |
| 12 | salt-call saltutil.sync_all |
| 13 | salt-call -t 5 --retcode-passthrough --no-color state.sls salt |
Jiri Broulik | aa400a0 | 2018-04-12 00:18:47 +0200 | [diff] [blame] | 14 | salt-call -t 5 --retcode-passthrough --no-color state.sls linux.system.repo,linux.system.package,linux.system.user,linux.system.directory,linux.system.config |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 15 | salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network |
Jiri Broulik | aa400a0 | 2018-04-12 00:18:47 +0200 | [diff] [blame] | 16 | salt-call -t 5 --retcode-passthrough --no-color state.sls openssh |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 17 | salt-call -t 5 --retcode-passthrough --no-color state.sls git.server |
| 18 | salt-call -t 5 --retcode-passthrough --no-color state.sls postgresql |
| 19 | salt-call -t 5 --no-color state.sls maas |
Jiri Broulik | 3ffb745 | 2018-04-12 10:37:07 +0200 | [diff] [blame^] | 20 | # linux.system.file only for backwards compatibility of jenkins - mcp-common-scripts |
| 21 | salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master,linux.system.file |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 22 | sleep 60 |
| 23 | salt-call -t 5 --no-color state.sls jenkins.client.plugin |
| 24 | systemctl restart jenkins |
| 25 | sleep 60 |
| 26 | # Jenkins Mirantis theme |
| 27 | git clone https://github.com/Mirantis/docker-jenkins.git |
| 28 | cp -r docker-jenkins/theme /var/lib/jenkins/userContent |
| 29 | chown -R jenkins:jenkins /var/lib/jenkins/userContent/* |
| 30 | # finish Jenkins setup |
| 31 | salt-call -t 5 --no-color state.sls jenkins.client.plugin |
| 32 | systemctl restart jenkins |
| 33 | sleep 60 |
| 34 | salt-call -t 5 --no-color state.sls jenkins.client |
| 35 | systemctl restart jenkins |
| 36 | sleep 60 |
| 37 | salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.client |
| 38 | |