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-main-202.yml

README.md

LinkedIn slack Github

File me tickets or star the repo.

Table of Contents

Requirements

  1. Finish Scenario-201, create a jenkins user by code.
  2. Create a dedicated VPC for the jenkins. And allow selective source IP to access.
  3. Anonymous user can't open the jenkins. Only login user can.
  4. Make sure Jenkins GUI changes can be seamlessly tracked in git repo.

Procedures

Launch

  • Use CF to setup the env
export STACK_NAME="aws-jenkins"
export TMP_FILE="file://cf-jenkins-main-202.yml"

# Test jenkins username and password
export JENKINS_USER="jenkins123"
export JENKINS_PASSWORD="password123"
[ -n "$JENKINS_PORT" ] || export JENKINS_PORT='8081'
# The IP address range that can be used to Access Jenkins URL
[ -n "$JENKINS_LOCATION" ] || export JENKINS_LOCATION="0.0.0.0/0"
# 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"
aws cloudformation create-stack --template-body "$TMP_FILE" \
    --stack-name "$STACK_NAME" --parameters \
    ParameterKey=JenkinsUser,ParameterValue=$JENKINS_USER \
    ParameterKey=JenkinsPassword,ParameterValue=$JENKINS_PASSWORD \
    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://$server_ip:8080

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