diff --git a/Jenkinsfile b/Jenkinsfile index e250af996..4640d2027 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,6 +23,10 @@ pipeline { } stage('build') { + when { + changeset "src/*" + } + steps { sh ''' ./mvnw clean package @@ -33,6 +37,10 @@ pipeline { stage('image build') { + when { + changeset "src/*" + } + steps { acrQuickTask azureCredentialsId: "jenkins-sp", registryName: "jenkinsdemosacr", @@ -45,6 +53,7 @@ pipeline { stage('update staging config') { when { + changeset "src/*" environment name: "DEPLOY_TO", value: 'staging' } steps { @@ -62,6 +71,7 @@ pipeline { stage('update production config') { when { + changeset "src/*" environment name: "DEPLOY_TO", value: 'production' } steps { diff --git a/infra/kube/workloads/staging/deployment.yaml b/infra/kube/workloads/staging/deployment.yaml index 8e824f439..8d02e2d2f 100644 --- a/infra/kube/workloads/staging/deployment.yaml +++ b/infra/kube/workloads/staging/deployment.yaml @@ -12,12 +12,12 @@ spec: metadata: labels: app: pet-clinic - version: pc-e4876bb + version: pc-baa4676 spec: containers: - name: pet-clinic - image: "jenkinsdemosacr.azurecr.io/pet-clinic:pc-e4876bb" + image: "jenkinsdemosacr.azurecr.io/pet-clinic:pc-baa4676" ports: - containerPort: 8080 imagePullSecrets: diff --git a/infra/kube/workloads/staging/service.yaml b/infra/kube/workloads/staging/service.yaml index 100bb1353..0699f750b 100644 --- a/infra/kube/workloads/staging/service.yaml +++ b/infra/kube/workloads/staging/service.yaml @@ -4,11 +4,13 @@ metadata: name: pet-clinic namespace: staging labels: - version: pc-e4876bb + version: pc-baa4676 spec: + type: LoadBalancer selector: - app: auth-service - version: pc-e4876bb + app: pet-clinic + version: pc-baa4676 ports: - port: 80 + protocol: TCP targetPort: 8080