Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
cf-jenkins-elb-301.yml
cf-jenkins-main-301.yml
cf-jenkins-vpc-301.yml

README.md

LinkedIn slack Github

File me tickets or star the repo.

Table of Contents

Requirements

  1. Use CF to create ASG and ELB. And monitor ELB
  2. Start Jenkins master by ELB. Configure instance count to 1

Procedures

Launch

  • Use CF to setup the env

Here we use nested CF, to organize code in small modules.

export STACK_NAME="aws-jenkins"

# The IP address range that can be used to Access Jenkins URL
[ -n "$JENKINS_LOCATION" ] || export JENKINS_LOCATION="0.0.0.0/0"
# Test jenkins username and password
export JENKINS_USER="jenkins123"
export JENKINS_PASSWD="password123"
[ -n "$JENKINS_PORT" ] || export JENKINS_PORT='8081'

# Slack Token for Jenkins jobs. If empty, no slack notifications
[ -n "$SLACK_TOKEN" ] || export SLACK_TOKEN='CUSTOMIZETHIS'
# ssh key name to access EC2 instance
[ -n "$SSH_KEY_NAME" ] || export SSH_KEY_NAME="YOUR_SSH_KEYNAME_CUSTOMIZE"
export TMP_FILE="file://cf-jenkins-main-301.yml"
aws cloudformation create-stack --template-body "$TMP_FILE" \
    --stack-name "$STACK_NAME" --parameters \
    ParameterKey=StackName,ParameterValue=$STACK_NAME \
    ParameterKey=JenkinsTestUser,ParameterValue=$JENKINS_USER \
    ParameterKey=JenkinsTestPasswd,ParameterValue=$JENKINS_PASSWD \
    ParameterKey=SlackAuthToken,ParameterValue=$SLACK_TOKEN \
    ParameterKey=JenkinsLocation,ParameterValue=$JENKINS_LOCATION \
    ParameterKey=JenkinsPort,ParameterValue=$JENKINS_PORT \
    ParameterKey=KeyName,ParameterValue=$SSH_KEY_NAME
aws cloudformation delete-stack --stack-name "$STACK_NAME"

  • Verify Jenkins curl -I http://$dns_name:80

Highlights

  • Provision Loadbalancer would take minutes
  • TODO: enable ThinBackup for config changes
  • TODO: remove two jenkins warnings
Allowing Jenkins CLI to work in -remoting mode is considered
dangerous and usually unnecessary. You are advised to disable this
mode. Please refer to the CLI documentation for details.

Agent to master security subsystem is currently off. Please read the
documentation and consider turning it on
  • Useful Commands
s3cmd put "cf-jenkins-elb-301.yml" s3://aws.dennyzhang.com/
  • Cloudformation Wizard