File me tickets or star the repo.
- For better security, only registered user can login
- For better security, Jenkins listen on port 18080, instead of 8080
- When Jenkins is down, get alerts
Quiz:
- Once I have enabled Jenkins security, how my chef update will work?
- Install bundle
apt-get install ruby-dev
ruby --version
# https://github.com/bundler/bundler/issues/4065
sudo gem install bundler -n /usr/local/bin
bundle --version
- Install gem depenencies
cd cookbooks/jenkins-demo
bundle install
- Run kitchen test
# https://github.com/test-kitchen/kitchen-docker
kitchen converge
kitchen list
kitchen verify
kitchen destroy
# https://github.com/test-kitchen/kitchen-digitalocean
cd cookbooks/jenkins-demo
export KITCHEN_YAML=".kitchen_digitalocean.yml"
# Customize this with your credential
export DIGITALOCEAN_ACCESS_TOKEN="1234"
export DIGITALOCEAN_SSH_KEY_IDS="1234, 5678"
kitchen converge
kitchen list
kitchen verify
kitchen destroy
- TODO: how does the ssh key work? With which OS user, and where the key is?
- Install AWS cli and configure aws credential
# http://docs.aws.amazon.com/cli/latest/userguide/installing.html
pip install awscli
aws configure
# Customize this
export KEY_USER="denny-kitchen-test"
aws ec2 create-key-pair --key-name $KEY_USER | ruby -e "require 'json'; puts JSON.parse(STDIN.read)['KeyMaterial']" > ~/.ssh/$KEY_USER
chmod 600 ~/.ssh/$KEY_USER
export AWS_SSH_KEY_ID="$KEY_USER"
- Install and run kitchen-ec2
# https://github.com/test-kitchen/kitchen-ec2
# https://github.com/test-kitchen/kitchen-ec2/blob/master/lib/kitchen/driver/ec2.rb
# http://kg4giy.com/2015/12/11/test-kitchen-to-support-amazon-web-service-aws-amis/
cd cookbooks/jenkins-demo
export KITCHEN_YAML=".kitchen_ec2.yml"
# TODO: customize this
export AWS_SSH_KEY_ID="$KEY_USER"
# Update bundle: https://github.com/chef/chef-provisioning/issues/151
bundle update
kitchen converge
kitchen list
kitchen verify
kitchen destroy
# https://github.com/test-kitchen/kitchen-vagrant
cd cookbooks/jenkins-demo
export KITCHEN_YAML=".kitchen_vagrant.yml"
bundle install
kitchen converge
kitchen list
kitchen verify
kitchen destroy
-
TODO: security improvement for the built-in chef user: attributes/default.rb
-
Critical Info
CentOS Jenkins conf: /etc/sysconfig/jenkins