Update staging file with 507549c commit

This commit is contained in:
Jenkins 2019-10-21 06:50:56 +00:00 committed by gavinfish
parent 507549cac3
commit 829376afd9
6 changed files with 69 additions and 18 deletions

28
Jenkinsfile vendored
View file

@ -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 {

View 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
View 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'
}
}
}
}
}

View file

@ -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

View file

@ -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:

View file

@ -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