stakater / ami-baker

Build custom AMI (Amazon Machine Image) on top of CoreOS
http://www.stakater.com
Apache License 2.0
12 stars 3 forks source link

Add Jenkinsfile to build AMI #5

Open rasheedamir opened 7 years ago

rasheedamir commented 7 years ago

Add Jenkinsfile to build AMI

rasheedamir commented 7 years ago

We build in dockerfile

sudo docker run -d --name packer_${GO_PIPELINE_NAME} -v $AMI_BAKER_LOCATION:/usr/src/app stakater/packer
sudo docker exec packer_${GO_PIPELINE_NAME} /bin/bash -c "./bake-ami.sh -r $aws_region -v $vpc_id -s $subnet_id -b $build_uuid -n ${APP_NAME}_${ENVIRONMENT}_${APP_IMAGE_BUILD_VERSION} -c ${CLOUD_CONFIG_TMPL_PATH} -y '${EXTRA_CLOUDCONFIG_UNITS}' -d \"${APP_DOCKER_IMAGE}\" -o \"${APP_DOCKER_OPTS}\" -g \"$docker_registry_path\" -e \"${DATA_EBS_DEVICE_NAME}\" -z \"${DATA_EBS_VOL_SIZE}\" -l \"${LOGS_EBS_DEVICE_NAME}\" -x \"${LOGS_EBS_VOL_SIZE}\" -i \"${BAKER_INSTANCE_TYPE}\""