-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
56 lines (53 loc) · 1.51 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
library identifier: 'jenkins-shared-library@main', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: '[email protected]:devops-dimension/jenkins-sared-library.git',
credentialsId: 'aws-jenkins'
]
)
properties([disableConcurrentBuilds(), pipelineTriggers([githubPush()])])
pipeline {
agent any
triggers { pollSCM('* * * * *') }
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
timestamps()
}
stages {
/* checkout repo */
stage('Checkout SCM') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: 'master']],
userRemoteConfigs: [[
url: '[email protected]:dimension-hub/docker-lamp.git',
credentialsId: 'aws-jenkins',
]]
])
}
}
stage('build app') {
steps {
script {
buildapp()
}
}
}
stage('build and push image') {
steps {
script {
buildImage "dimenssion/build:$BUILD_NUMBER"
dockerLogin()
dockerPush "dimenssion/build:$BUILD_NUMBER"
}
}
}
stage('clean docker images') {
steps {
script {
dockerCleanImage()
}
}
}
}
}