-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJenkins
39 lines (36 loc) · 1.02 KB
/
Jenkins
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
pipeline {
agent any
options {
ansiColor('xterm')
}
environment {
DB_USERNAME = "dbuser"
DB_PASSWORD = "dbpassword"
DB_CONNECTION_STRING = "jdbc:oracle:oci:@myhost:1521:orcl"
}
stages {
stage('Stage 1') {
steps {
script {
sh """#!/bin/bash -xe
docker build -t web-app/devops:latest -t 725496895483.dkr.ecr.ap-southeast-2.amazonaws.com/web-app/devops:latest master/
"""
}
}
}
stage('Stage 2'){
steps {
script {
sh """#!/bin/bash -xe
docker run -e DB_CONNECTION_STRING=${env.DB_CONNECTION_STRING} -e DB_USERNAME=${env.DB_USERNAME} -e DB_PASSWORD=${env.DB_PASSWORD} web-app/devops:latest
"""
}
}
}
}
post {
always {
cleanWs()
}
}
}