-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.groovy
30 lines (24 loc) · 935 Bytes
/
script.groovy
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
def buildJar() {
echo "gv building the app jar..."
sh "mvn clean package"
}
def deployApp() {
echo 'gv deploying the app...'
}
def buildImageDocker(String imageName) {
echo "building the docker image..."
withCredentials([usernamePassword(credentialsId: 'dockerhub-private-repo', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "docker build -t $imageName ."
sh "echo $PASS | docker login -u $USER --password-stdin"
sh 'docker push miltosdev/my-private-repo:jda-1.0.0'
}
}
def buildImageNexus(String imageName) {
echo "building the nexus image..."
withCredentials([usernamePassword(credentialsId: 'nx-cont-docker-repo', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "docker build -t $imageName ."
sh "echo $PASS | docker login 164.92.250.242:8083 -u $USER --password-stdin"
sh "docker push $imageName"
}
}
return this