-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
44 lines (44 loc) · 1.41 KB
/
Jenkinsfile
File metadata and controls
44 lines (44 loc) · 1.41 KB
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
pipeline {
environment {
registry = "20.29.193.150:8085/react-image"
dockerImage = ''
registryCredential = 'NEXUS_ID'
}
agent any
stages {
stage('clone repo') {
steps {
git credentialsId: 'GITHUB_ID', url: 'https://github.com/Amulya625/react_sampleapp.git'
}
}
stage('Building image') {
steps{
script {
dockerImage = docker.build registry + ":$BUILD_NUMBER"
}
}
}
stage('Login to Nexus Repository'){
steps{
script {
sh 'docker login -u admin -p Ammu@2506 20.29.193.150:8085/react-image'
dockerImage.push()
}
}
}
stage('Deploy using SSH steps') {
steps {
script {
def remote = [:]
remote.name = "minikube"
remote.host = "20.118.166.214"
remote.user = "azureuser"
remote.password = "Amulya@9703006654"
remote.allowAnyHosts = true
sshPut remote: remote, from: 'deployment.yaml', into: '.'
sshCommand remote: remote,command: "kubectl apply -f deployment.yaml"
}
}
}
}
}