forked from NOAA-EPIC/ufs-containers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
103 lines (89 loc) · 3.02 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
pipeline {
agent {
label 'docker'
}
environment {
DOCKER_HUB = credentials('DockerHubNOAAEPIC')
UBUNTU_GNU_IMAGE_NAME = 'ubuntu20.04-gnu9.3'
UBUNTU_GNU_IMAGE_VERSION = '0.1'
UBUNTU_GNU_IMAGE_TAG = "${env.DOCKER_HUB_USR}/${env.UBUNTU_GNU_IMAGE_NAME}:${env.UBUNTU_GNU_IMAGE_VERSION}"
UBUNTU_GNU_HPCSTACK_IMAGE_NAME = "${env.UBUNTU_GNU_IMAGE_NAME}-hpc-stack"
UBUNTU_GNU_HPCSTACK_IMAGE_VERSION = '0.1'
UBUNTU_GNU_HPCSTACK_IMAGE_TAG = "${env.DOCKER_HUB_USR}/${env.UBUNTU_GNU_HPCSTACK_IMAGE_NAME}:${env.UBUNTU_GNU_HPCSTACK_IMAGE_VERSION}"
UBUNTU_GNU_SRW_IMAGE_NAME = "${env.UBUNTU_GNU_IMAGE_NAME}-ufs-srwapp"
UBUNTU_GNU_SRW_IMAGE_VERSION = '0.1'
UBUNTU_GNU_SRW_IMAGE_TAG = "${env.DOCKER_HUB_USR}/${env.UBUNTU_GNU_SRW_IMAGE_NAME}:${env.UBUNTU_GNU_SRW_IMAGE_VERSION}"
}
stages {
stage('Prepare Environment') {
steps {
echo 'Preparing the environment'
sh 'docker image prune --all'
sh 'docker login --username "${DOCKER_HUB_USR}" --password "${DOCKER_HUB_PSW}"'
}
}
stage('Build Ubuntu GNU') {
steps {
echo "Building ${env.UBUNTU_GNU_IMAGE_TAG}"
sh 'docker build --tag "${UBUNTU_GNU_IMAGE_TAG}" --file "${WORKSPACE}/Docker/Dockerfile.${UBUNTU_GNU_IMAGE_NAME}" "${WORKSPACE}"'
}
}
stage('Test Ubuntu GNU') {
steps {
echo "Testing ${env.UBUNTU_GNU_IMAGE_TAG}"
sh 'docker run "${UBUNTU_GNU_IMAGE_TAG}" gfortran --version'
}
}
stage('Release Ubuntu GNU') {
when {
branch 'main'
}
steps {
echo "Releasing ${env.UBUNTU_GNU_IMAGE_TAG}"
sh 'docker push "${UBUNTU_GNU_IMAGE_TAG}"'
}
}
stage('Build Ubuntu GNU HPC Stack') {
steps {
echo "Building ${env.UBUNTU_GNU_HPCSTACK_IMAGE_TAG}"
//sh 'docker build --tag "${UBUNTU_GNU_HPCSTACK_IMAGE_TAG}" --file "${WORKSPACE}/Docker/Dockerfile.${UBUNTU_GNU_HPCSTACK_IMAGE_NAME}" "${WORKSPACE}"'
}
}
stage('Test Ubuntu GNU HPC Stack') {
steps {
echo "Testing ${env.UBUNTU_GNU_HPCSTACK_IMAGE_TAG}"
//sh 'docker run "${UBUNTU_GNU_HPCSTACK_IMAGE_TAG}"'
}
}
stage('Release Ubuntu GNU HPC Stack') {
when {
branch 'main'
}
steps {
echo "Releasing ${env.UBUNTU_GNU_HPCSTACK_IMAGE_TAG}"
//sh 'docker push "${UBUNTU_GNU_HPCSTACK_IMAGE_TAG}"'
}
}
stage('Build Ubuntu GNU SRW') {
steps {
echo "Building ${env.UBUNTU_GNU_SRW_IMAGE_TAG}"
//sh 'docker build --tag "${UBUNTU_GNU_SRW_IMAGE_TAG}" --file "${WORKSPACE}/Docker/Dockerfile.${UBUNTU_GNU_SRW_IMAGE_NAME}" "${WORKSPACE}"'
}
}
stage('Test Ubuntu GNU SRW') {
steps {
echo "Testing ${env.UBUNTU_GNU_SRW_IMAGE_TAG}"
//sh 'docker run "${UBUNTU_GNU_SRW_IMAGE_TAG}"'
}
}
stage('Release Ubuntu GNU SRW') {
when {
branch 'main'
}
steps {
echo "Releasing ${env.UBUNTU_GNU_SRW_IMAGE_TAG}"
//sh 'docker push "${UBUNTU_GNU_SRW_IMAGE_TAG}"'
}
}
}
}