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') { stage('image build') {
// environment { environment {
// sha = sh(script: 'git rev-parse --short HEAD', returnStdout: true) sha = sh(script: 'git rev-parse --short HEAD', returnStdout: true)
// } }
//
// steps { steps {
// acrQuickTask azureCredentialsId: "jenkins-sp", acrQuickTask azureCredentialsId: "jenkins-sp",
// registryName: "jenkinsdemosacr", registryName: "jenkinsdemosacr",
// resourceGroupName: "demo-aks", resourceGroupName: "demo-aks",
// local: "", local: "",
// dockerfile: "Dockerfile", dockerfile: "Dockerfile",
// imageNames: [[image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-${sha}"]] imageNames: [[image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-${sha}"]]
// } }
// } }
stage('update staging config') { stage('update staging config') {
environment { 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: metadata:
labels: labels:
app: pet-clinic app: pet-clinic
version: master-xxxxxxx version: master-507549c
spec: spec:
containers: containers:
- name: pet-clinic - name: pet-clinic
image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-xxxxxxx" image: "jenkinsdemosacr.azurecr.io/pet-clinic:master-507549c"
ports: ports:
- containerPort: 8080 - containerPort: 8080
imagePullSecrets: imagePullSecrets:

View file

@ -4,11 +4,11 @@ metadata:
name: pet-clinic name: pet-clinic
namespace: staging namespace: staging
labels: labels:
version: master-xxxxxxx version: master-507549c
spec: spec:
selector: selector:
app: auth-service app: auth-service
version: master-xxxxxxx version: master-507549c
ports: ports:
- port: 80 - port: 80
targetPort: 8080 targetPort: 8080