Created
July 1, 2020 15:04
-
-
Save velotiotech/c5372679bbc8555ca1bd747603030b31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
// Mark the code checkout 'stage'.... | |
stage('Checkout the dockefile from GitHub') { | |
git branch: 'docker-file', credentialsId: 'git_credentials', url: 'https://gitlab.com/demo.git' | |
} | |
// Build and Deploy to ACR 'stage'... | |
stage('Build the Image and Push to Azure Container Registry') { | |
app = docker.build('testacr.azurecr.io/demo') | |
withDockerRegistry([credentialsId: 'acr_credentials', url: 'https://testacr.azurecr.io']) { | |
app.push("${env.BUILD_NUMBER}") | |
app.push('latest') | |
} | |
} | |
stage('Build the Kubernetes YAML Files for New App') { | |
<The code here will differ depending on the YAMLs used for the application> | |
} | |
stage('Delpoying the App on Azure Kubernetes Service') { | |
app = docker.image('testacr.azurecr.io/demo:latest') | |
withDockerRegistry([credentialsId: 'acr_credentials', url: 'https://testacr.azurecr.io']) { | |
app.pull() | |
sh "kubectl create -f ." | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment