23 lines
		
	
	
		
			535 B
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			535 B
		
	
	
	
		
			Groovy
		
	
	
	
	
	
| pipeline {
 | |
|     options {
 | |
|         timeout(time: 1, unit: 'HOURS')
 | |
|     }
 | |
|     agent {
 | |
|         label 'ubuntu-1804 && amd64 && docker'
 | |
|     }
 | |
|     stages {
 | |
|         stage('build and push') {
 | |
|             when {
 | |
|                 branch 'master'
 | |
|             }
 | |
|             sh "docker build -t docker/getting-started ."
 | |
| 
 | |
|             steps {
 | |
|                 withDockerRegistry([url: "", credentialsId: "dockerbuildbot-index.docker.io"]) {
 | |
|                     sh("docker push docker/getting-started")
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |