Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29245

Jenkins pipeline to build image

$
0
0

I am writing a Jenkins pipeline groovy script to build image.I want to build one image and run some docker commands inside EC2 using this Jenkins pipeline. I have written below pipeline

 pipeline {
   agent none
   stages {
     stage ('image-build')
       steps{
         withAWS(region: 'us-east-1', roleAccount: 9441982XX , role: 
                'Jenkins')
         {
           sh """
             mkdir jenkins
             ls -a

            """
   }
   }      
  }
  }

But i am getting below errors

 WorkflowScript: 4: Expected a stage @ line 4, column 5.
   stage ('image-build')
   ^

 WorkflowScript: 5: Expected a stage @ line 5, column 8.
      steps{
      ^

 WorkflowScript: 3: No stages specified @ line 3, column 5.
   stages {
   ^

  3 errors

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
a

Viewing all articles
Browse latest Browse all 29245

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>