mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 06:45:49 +00:00
Update staging file with 507549c
commit
This commit is contained in:
parent
507549cac3
commit
829376afd9
6 changed files with 69 additions and 18 deletions
28
Jenkinsfile
vendored
28
Jenkinsfile
vendored
|
@ -20,20 +20,20 @@ pipeline {
|
|||
}
|
||||
|
||||
|
||||
// stage('image build') {
|
||||
// environment {
|
||||
// sha = sh(script: 'git rev-parse --short HEAD', returnStdout: true)
|
||||
// }
|
||||
//
|
||||
// steps {
|
||||
// acrQuickTask azureCredentialsId: "jenkins-sp",
|
||||
// registryName: "jenkinsdemosacr",
|
||||
// resourceGroupName: "demo-aks",
|
||||
// local: "",
|
||||
// dockerfile: "Dockerfile",
|
||||
// imageNames: [[image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-${sha}"]]
|
||||
// }
|
||||
// }
|
||||
stage('image build') {
|
||||
environment {
|
||||
sha = sh(script: 'git rev-parse --short HEAD', returnStdout: true)
|
||||
}
|
||||
|
||||
steps {
|
||||
acrQuickTask azureCredentialsId: "jenkins-sp",
|
||||
registryName: "jenkinsdemosacr",
|
||||
resourceGroupName: "demo-aks",
|
||||
local: "",
|
||||
dockerfile: "Dockerfile",
|
||||
imageNames: [[image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-${sha}"]]
|
||||
}
|
||||
}
|
||||
|
||||
stage('update staging config') {
|
||||
environment {
|
||||
|
|
14
infra/ansible/staging/main.yaml
Normal file
14
infra/ansible/staging/main.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
- name: deploy staging environment
|
||||
hosts: localhost
|
||||
connection: local
|
||||
vars:
|
||||
resource_group: azure-k8stest
|
||||
tasks:
|
||||
- name: apply deployment
|
||||
k8s:
|
||||
state: present
|
||||
src: ../../kube/workloads/staging/deployment.yaml
|
||||
- name: apply service
|
||||
k8s:
|
||||
state: present
|
||||
src: ../../kube/workloads/staging/service.yaml
|
23
infra/kube/Jenkinsfile
vendored
Normal file
23
infra/kube/Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
|
||||
stage('deploy') {
|
||||
environment {
|
||||
sha = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
||||
}
|
||||
|
||||
steps {
|
||||
withCredentials([azureServicePrincipal(credentialsId: 'jenkins-sp',
|
||||
subscriptionIdVariable: 'AZURE_SUBSCRIPTION_ID',
|
||||
clientIdVariable: 'AZURE_CLIENT_ID',
|
||||
clientSecretVariable: 'AZURE_SECRET',
|
||||
tenantIdVariable: 'AZURE_TENANT')]) {
|
||||
ansiblePlaybook installation: 'ansible',
|
||||
playbook: 'infra/ansible/staging/main.yaml'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: pet-clinic
|
||||
namespace: production
|
||||
labels:
|
||||
version: master-507549c
|
||||
spec:
|
||||
selector:
|
||||
app: auth-service
|
||||
version: master-507549c
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
|
@ -12,12 +12,12 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
app: pet-clinic
|
||||
version: master-xxxxxxx
|
||||
version: master-507549c
|
||||
|
||||
spec:
|
||||
containers:
|
||||
- name: pet-clinic
|
||||
image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-xxxxxxx"
|
||||
image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-507549c"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
imagePullSecrets:
|
||||
|
|
|
@ -4,11 +4,11 @@ metadata:
|
|||
name: pet-clinic
|
||||
namespace: staging
|
||||
labels:
|
||||
version: master-xxxxxxx
|
||||
version: master-507549c
|
||||
spec:
|
||||
selector:
|
||||
app: auth-service
|
||||
version: master-xxxxxxx
|
||||
version: master-507549c
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
||||
|
|
Loading…
Reference in a new issue