blob: d810cb19c6440643a78d244e09a1bf2fc588a7a9 [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001#!/bin/bash -xe
2
Jiri Broulik05c5b602018-04-11 13:52:37 +02003FORMULA_VERSION=${FORMULA_VERSION:-testing}
4APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
5
Jiri Broulik4ea221c2018-04-10 13:48:06 +02006echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list
7apt-get update
8apt-get install salt-formula* -y
9salt-call saltutil.refresh_pillar
10salt-call saltutil.sync_all
11salt-call -t 5 --retcode-passthrough --no-color state.sls salt
12salt-call -t 5 --retcode-passthrough --no-color state.sls linux.system.repo,linux.system.package,linux.system.directory,linux.system.config
13salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network
14salt-call -t 5 --retcode-passthrough --no-color state.sls git.server
15salt-call -t 5 --retcode-passthrough --no-color state.sls postgresql
16salt-call -t 5 --no-color state.sls maas
17# will not be needed with new maas formula
18apt-get install simplestreams -y
19sstream-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
20
21salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master
22sleep 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