mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 08:15:49 +00:00
added spc
This commit is contained in:
parent
7d7a91b258
commit
28911a7b95
2 changed files with 9 additions and 16 deletions
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
|
@ -1,25 +1,18 @@
|
|||
pipeline{
|
||||
agent{label 'dotnet-7'}
|
||||
agent{label 'java-17'}
|
||||
stages{
|
||||
stage('VCS'){
|
||||
steps{
|
||||
git credentialsId: 'GIT_HUB_CREDENTIALS',
|
||||
url: 'https://github.com/Cloud-and-devops-notes/spring-petclinic-jenkins.git',
|
||||
branch: 'tera'
|
||||
branch: 'main'
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
stage('artifact build'){
|
||||
steps{
|
||||
sh 'sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B53DC80D13EDEF05'
|
||||
sh 'sudo apt upgrade dotnet-sdk-7.0 -y'
|
||||
sh 'dotnet restore src/NopCommerce.sln'
|
||||
sh 'dotnet build -c Release src/NopCommerce.sln'
|
||||
sh 'dotnet publish -c Release src/Presentation/Nop.Web/Nop.Web.csproj -o publish'
|
||||
sh 'sudo apt install zip -y'
|
||||
sh 'zip -r nopCommerce.zip publish'
|
||||
archive '**/nopCommerce.zip'
|
||||
sh 'docker build . -t sridhar006/spc-jenkins:${BUILD_ID}'
|
||||
sh 'docker image list'
|
||||
}
|
||||
}
|
||||
|
@ -33,9 +26,9 @@ pipeline{
|
|||
}
|
||||
stage('docker push image '){
|
||||
steps{
|
||||
sh 'docker image build -t nop123 .'
|
||||
sh 'docker image tag nop123 sridhar006/nopaugest:${BUILD_ID}'
|
||||
sh 'docker push sridhar006/nopaugest:${BUILD_ID}'
|
||||
sh 'docker image build -t spc123 .'
|
||||
sh 'docker image tag spc123 sridhar006/spc-jenkins:${BUILD_ID}'
|
||||
sh 'docker push sridhar006/spc-jenkins:${BUILD_ID}'
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,9 +25,9 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: nop
|
||||
image: sridhar006/nopaugest:26
|
||||
image: sridhar006/spc-jenkins:${BUILD_ID}
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
- containerPort: 8080
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
|
@ -42,5 +42,5 @@ spec:
|
|||
- protocol: TCP
|
||||
name: nop
|
||||
port: 80
|
||||
targetPort: 5000
|
||||
targetPort: 8080
|
||||
type: LoadBalancer
|
Loading…
Reference in a new issue