Docker Jenkins is doing rounds
- docker
- jq
- aws cli installed and configured
export JENKINS_USER='myuser'
export JENKINS_PASS='mypass'
export GITHUB_USER='myuser'
export GITHUB_TOKEN='mytoken'
export GITHUB_EMAIL='[email protected]'
export AWS_PROFILE='myprofile'
export AWS_DEFAULT_REGION='myregion'
export AWS_ACCOUNT='12345566'
docker build -t "${AWS_ACCOUNT}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/hss/jenkins-master" -f ./Dockerfile .
docker-compose up --build -d
docker-compose down -v
docker-compose down -v
docker-compose up --build -d
./docker-login.sh
docker push ${AWS_ACCOUNT}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/hss/jenkins-master:latest
This cloudformation template assumes the following resources exist:
- Application Load Balancer with security group
- EFS with security group
- S3 bucket for cloudformation template storage
- custom VPC created with multiple public subnets
- EC2 key pair
- ECR repository for jenkins image
s3://hss-dev-cf-templates/hss-ecs-jenkins-efs.yml
aws cloudformation create-stack \
--cli-input-json file://params-hss-ecs-jenkins-efs.json \
--capabilities CAPABILITY_NAMED_IAM