• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • cloudformation-plugin
    • None

      Several users would like to build an AMI and the end of the build/test process, so that they can quickly launch AMIs in the test environment. To do this, we need to install all the necessary dependencies and build artifacts on the right instance type (64-bit or 32-bit) and call the create image (EBS-backed) command. Tag the image with the right version number using server tagging feature and output the new AmiID to the user for further integration (with CF templates)

          [JENKINS-11833] Add a Post-build action to create AMI

          Josh Mesilane added a comment - - edited

          You can already do this using an "Execute Shell" script. You need to use the Cloudformation outputs to spit out the InstanceID and the Region. I'm doing this using the following

          export AWS_ACCESS_KEY_ID=xxx
          export AWS_SECRET_ACCESS_KEY=xxx
          aws ec2 create-image --instance-id $amibuilder_InstanceID --name some_ami_`date +%y%m%d-%H%M` --description "Some AMI Image `date +%y%m%d-%H%M`" --region $amibuilder_AWSRegion --debug
          

          Josh Mesilane added a comment - - edited You can already do this using an "Execute Shell" script. You need to use the Cloudformation outputs to spit out the InstanceID and the Region. I'm doing this using the following export AWS_ACCESS_KEY_ID=xxx export AWS_SECRET_ACCESS_KEY=xxx aws ec2 create-image --instance-id $amibuilder_InstanceID --name some_ami_`date +%y%m%d-%H%M` --description "Some AMI Image `date +%y%m%d-%H%M`" --region $amibuilder_AWSRegion --debug

            edovale edovale
            jineshvaria jinesh varia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: