blob: c7bc7f14af035d81a60870edcf56a044c49d0bb9 [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
20# will not be needed with new maas formula
21apt-get install simplestreams -y
22sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg http://images.maas.io/ephemeral-v3/daily/ /var/www/html/maas/images/ephemeral-v3/daily 'arch=amd64' 'release~(xenial)' --max=1
23
24salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master
25sleep 60
26salt-call -t 5 --no-color state.sls jenkins.client.plugin
27systemctl restart jenkins
28sleep 60
29# Jenkins Mirantis theme
30git clone https://github.com/Mirantis/docker-jenkins.git
31cp -r docker-jenkins/theme /var/lib/jenkins/userContent
32chown -R jenkins:jenkins /var/lib/jenkins/userContent/*
33# finish Jenkins setup
34salt-call -t 5 --no-color state.sls jenkins.client.plugin
35systemctl restart jenkins
36sleep 60
37salt-call -t 5 --no-color state.sls jenkins.client
38systemctl restart jenkins
39sleep 60
40salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.client
41