blob: 16bafc82dcc1a5b8f8d7c4fe8dd39c0738672237 [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001#!/bin/bash -xe
2
Jiri Broulikddd55262018-04-11 14:52:43 +02003FORMULA_VERSION=${FORMULA_VERSION:-2018.3.1}
Jiri Broulik05c5b602018-04-11 13:52:37 +02004APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
5
Jiri Broulikaa400a02018-04-12 00:18:47 +02006salt-call -t 5 --retcode-passthrough reclass.validate_pillar
7
Jiri Broulik4ea221c2018-04-10 13:48:06 +02008echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list
9apt-get update
10apt-get install salt-formula* -y
11salt-call saltutil.refresh_pillar
12salt-call saltutil.sync_all
13salt-call -t 5 --retcode-passthrough --no-color state.sls salt
Jiri Broulikaa400a02018-04-12 00:18:47 +020014salt-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 Broulik4ea221c2018-04-10 13:48:06 +020015salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network
Jiri Broulikaa400a02018-04-12 00:18:47 +020016salt-call -t 5 --retcode-passthrough --no-color state.sls openssh
Jiri Broulik4ea221c2018-04-10 13:48:06 +020017salt-call -t 5 --retcode-passthrough --no-color state.sls git.server
18salt-call -t 5 --retcode-passthrough --no-color state.sls postgresql
19salt-call -t 5 --no-color state.sls maas
Jiri Broulik3ffb7452018-04-12 10:37:07 +020020# linux.system.file only for backwards compatibility of jenkins - mcp-common-scripts
21salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master,linux.system.file
Jiri Broulik4ea221c2018-04-10 13:48:06 +020022sleep 60
23salt-call -t 5 --no-color state.sls jenkins.client.plugin
24systemctl restart jenkins
25sleep 60
26# Jenkins Mirantis theme
27git clone https://github.com/Mirantis/docker-jenkins.git
28cp -r docker-jenkins/theme /var/lib/jenkins/userContent
29chown -R jenkins:jenkins /var/lib/jenkins/userContent/*
30# finish Jenkins setup
31salt-call -t 5 --no-color state.sls jenkins.client.plugin
32systemctl restart jenkins
33sleep 60
34salt-call -t 5 --no-color state.sls jenkins.client
35systemctl restart jenkins
36sleep 60
37salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.client
38