blob: 109d986f206f61abf217df7c9cf8e1b3a79f17ad [file] [log] [blame]
Denis Egorenko70baa0f2018-09-14 15:47:51 +04001/**
2 * Check new Reclass version against current model.
3 *
4 * Expected parameters:
5 * SALT_MASTER_CREDENTIALS Credentials to the Salt API.
6 * SALT_MASTER_URL Full Salt API address [http://10.10.10.1:8000].
7 * DISTRIB_REVISION Mirror version to use
8 * EXTRA_REPO_PREDEFINED Use mcp extra repo defined on host
9 * EXTRA_REPO Extra repo to use in format (for example, deb [arch=amd64] http://apt.mirantis.com/xenial/ nightly extra)
10 * EXTRA_REPO_GPG_KEY_URL GPG key URL for extra repo
11 * TARGET_NODES Target specification, e.g. 'I@openssh:server'
12**/
13
14def common = new com.mirantis.mk.Common()
15def salt = new com.mirantis.mk.Salt()
16def saltModel = new com.mirantis.mk.SaltModelTesting()
17def python = new com.mirantis.mk.Python()
18
19def env = "env"
20def extraRepo = env.EXTRA_REPO
21def extraRepoKey = env.EXTRA_REPO_GPG_KEY_URL
22def targetNodes = env.TARGET_NODES
23def distribRevision = env.DISTRIB_REVISION
24def usePredefinedExtra = env.EXTRA_REPO_PREDEFINED
25node('cfg') {
26
27 stage('Setup virtualenv for Pepper') {
28 python.setupPepperVirtualenv(env, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
29 }
30
31 def minions = salt.getMinionsSorted(env, targetNodes)
32 if (usePredefinedExtra) {
33 def mcp_extra = salt.getPillar(env, 'I@salt:master', "linux:system:repo:mcp_extra").get("return")[0].values()[0]
34 extraRepoKey = mcp_extra['key_url']
35 extraRepo = mcp_extra['source']
36 }
37 def config = [
38 'distribRevision': distribRevision,
39 'targetNodes': minions,
40 'extraRepo': extraRepo,
41 'extraRepoKey': extraRepoKey,
42 'venv': env
43 ]
44 saltModel.compareReclassVersions(config)
45}