-
Notifications
You must be signed in to change notification settings - Fork 1
/
k8s-ucs-bm-jenkinsfile
52 lines (50 loc) · 1.42 KB
/
k8s-ucs-bm-jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//Authored by Jeff Comer
def nodeLabel = 'pod-builder-agent'
pipeline {
environment {
BRANCH_NAME = "${GIT_BRANCH}"
varPath = "vars/" + "${BRANCH_NAME}"
repoVars = "${varPath}" + "/terraform/" + "create_repos.tfvars"
osVars = "${varPath}" + "/terraform/" + "os_install.tfvars"
APIC_CREDS = credentials('apic-creds')
vcsaHostName = "vcsa-" + "${BRANCH_NAME}" + ".thor.iws.navy.mil"
}
agent {
kubernetes {
yamlFile 'jnlp-ubuntu-tfe.yaml'
}
}
stages{
stage('Stat k8s Nodes') {
steps {
container('ubuntu-tfe') {
//Check health state of k8s nodes in target cluster
sh 'cp -r .kube /root/'
sh 'python3 k8s/clusterHealth.py'
}
}
}
stage('Add OS Install SCU and Image to repos') {
steps {
container('ubuntu-tfe') {
//kick off terraform osInstall
dir('tfe/intersight/osInstall/create_repos') {
sh 'terraform init'
sh 'terraform apply -var-file=../../../../$repoVars -auto-approve'
}
}
}
}
stage('Initial Bare-Metal OS Installs') {
steps {
container('ubuntu-tfe') {
//kick policy and profile create
dir('tfe/intersight/osInstall/os_install') {
sh 'terraform init'
sh 'terraform apply -var-file=../../../../$osVars -auto-approve'
}
}
}
}
}
}