|  | @@ -0,0 +1,33 @@
 | 
	
		
			
				|  |  | +node {
 | 
	
		
			
				|  |  | +  try {
 | 
	
		
			
				|  |  | +    stage('Checkout') {
 | 
	
		
			
				|  |  | +      checkout scm
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    stage('Environment') {
 | 
	
		
			
				|  |  | +      sh 'git --version'
 | 
	
		
			
				|  |  | +      echo "Branch: master"
 | 
	
		
			
				|  |  | +      sh 'docker -v'
 | 
	
		
			
				|  |  | +      sh 'printenv'
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    stage('Build Docker test'){
 | 
	
		
			
				|  |  | +     sh 'docker build -t ptb-fe -f Dockerfile .'
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    stage('Docker test'){
 | 
	
		
			
				|  |  | +      sh 'docker run --rm ptb/fe'
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    stage('Clean Docker test'){
 | 
	
		
			
				|  |  | +      sh 'docker rmi ptb/fe'
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    stage('Deploy'){
 | 
	
		
			
				|  |  | +      if(env.BRANCH_NAME == 'master'){
 | 
	
		
			
				|  |  | +        sh 'docker build -t ptb-fe .'
 | 
	
		
			
				|  |  | +        sh 'docker tag ptb-fe localhost:50006/ptb-fe'
 | 
	
		
			
				|  |  | +        sh 'docker push localhost:50006/ptb-fe'
 | 
	
		
			
				|  |  | +        sh 'docker rmi -f ptb-fe localhost:50006/ptb-fe'
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  catch (err) {
 | 
	
		
			
				|  |  | +    throw err
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 |