The end of one long README
Apparently we've reached the limit of GitHub rendering (512K). Time to change the structure accordingly - exercises and questions will move to sub-directories in the exercises directory. This is the first patch in performing this transition.
This commit is contained in:
		
							
								
								
									
										45
									
								
								exercises/cicd/solutions/deploy_to_kubernetes/Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								exercises/cicd/solutions/deploy_to_kubernetes/Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
pipeline {
 | 
			
		||||
 | 
			
		||||
  agent any
 | 
			
		||||
 | 
			
		||||
  stages {
 | 
			
		||||
 | 
			
		||||
    stage('Checkout Source') {
 | 
			
		||||
      steps {
 | 
			
		||||
        git url:'https://github.com/<GITHUB_USERNAME>/<YOUR_WEB_APP_REPO>.git',
 | 
			
		||||
        // credentialsId: 'creds_github',
 | 
			
		||||
        branch:'master'
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
      stage("Build image") {
 | 
			
		||||
            steps {
 | 
			
		||||
                script {
 | 
			
		||||
                    myapp = docker.build("<YOUR_DOCKER_USERNAME>/helloworld:${env.BUILD_ID}")
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    
 | 
			
		||||
      stage("Push image") {
 | 
			
		||||
            steps {
 | 
			
		||||
                script {
 | 
			
		||||
                    docker.withRegistry('https://registry.hub.docker.com', 'dockerhub') {
 | 
			
		||||
                            myapp.push("latest")
 | 
			
		||||
                            myapp.push("${env.BUILD_ID}")
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    stage('Deploy App') {
 | 
			
		||||
      steps {
 | 
			
		||||
        script {
 | 
			
		||||
          sh 'ansible-playbook deploy.yml'
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user