Commit f14ab1e2 by Will Daly

Updated list of Jenkins plugins to install

Removed unused config-backup.yml playbook

Added correct rbenv configuration

Updated plugin list
Removed ssh key for Jenkins

Added JSCover dependency

Changed build directory to /opt/jenkins
parent bc2ed726
# Configure a Jenkins master instance
# This has the Jenkins Java app, but none of the requirements
# to run the tests.
- name: Configure instance(s)
hosts: jenkins_master
sudo: True
gather_facts: True
roles:
- jenkins_master
# Configure a Jenkins worker instance
# This has all the requirements to run test jobs,
# but not the Jenkins Java app.
- name: Configure instance(s)
hosts: jenkins
hosts: jenkins_worker
sudo: True
gather_facts: True
roles:
......@@ -9,4 +13,4 @@
rbenv_user: "{{ jenkins_user }}"
rbenv_user_home: "{{ jenkins_user_home }}"
rbenv_ruby_version: "{{ jenkins_ruby_version }}"
- jenkins
- jenkins_worker
---
- name: Make backup directory
sudo_user: jenkins
shell: mkdir {{ jenkins_home }}/backup
- name: Git clone
sudo_user: jenkins
action: git repo=https://github.com/lapentab/jenkinsconfig.git dest={{jenkins_home}}/backup
---
- name: jenkins | Add the jenkins user to the edx group
user: name=jenkins append=yes groups="edx"
- name: jenkins | install jenkins specific system packages
apt: pkg={{','.join(jenkins_debian_pkgs)}} state=present
- name: jenkins | Install gcli
sudo_user: jenkins
shell: /home/jenkins/.rbenv/bin/rbenv exec gem install github_cli
# This is done so that it will not report back to github while testing
- name: jenkins | TEMPORARILY DISABLE gcli
shell: echo "#!/bin/bash\necho gcli" > /usr/local/bin/gcli
- name: jenkins | Install Jenkins
shell: wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
- name: jenkins | Install Jenkins 2
shell: sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
- name: jenkins | Install Jenkins 3
shell: apt-get update
- name: jenkins | install jenkins 4
apt: pkg=jenkins state=present
- name: jenkins | Make plugins directory
sudo_user: jenkins
shell: mkdir -p {{ jenkins_home }}/plugins
- name: jenkins | Make virtualenv directory
shell: mkdir -p /mnt/virtualenvs
- name: jenkins | Chown virtualenv directory
file: path=/mnt/virtualenvs/ state=directory owner=jenkins recurse=yes
- name: jenkins | Make pip-cache directory
shell: mkdir -p /mnt/pip-cache
- name: jenkins | Chown pip-cache directory
file: path=/mnt/pip-cache/ state=directory owner=jenkins recurse=yes
- name: jenkins | Allow /usr/local/bin to be executable
shell: chmod -R go+x /usr/local/bin
- name: jenkins | Install Jenkins plugins
sudo_user: jenkins
get_url: url=http://updates.jenkins-ci.org/latest/${item}
dest={{ jenkins_home }}/plugins/${item}
with_items: "{{ jenkins_plugins }}"
#- timestamper.hpi
#- maven-plugin.hpi
notify:
- restart Jenkins
- name: jenkins | install ssh key for private git repos
copy: >
src="{{jenkins_git_identity_path}}"
dest="{{jenkins_user_home}}/.ssh/id_rsa"
force=yes
owner="{{jenkins_user}}"
group="{{jenkins_user}}"
mode=600
when: c_install_ssh_key is defined
---
- include: jenkins.yml
- include: xvfb.yml
- include: browsers.yml
- include: python-pkgs.yml
---
- name: python packages | Symbolic link site packages
file: src=/usr/local/lib/python2.7/site-packages dest=/usr/local/lib/python2.7/dist-packages state=link
ignore_errors: yes
- name: python packages | install numpy
shell: pip install numpy==1.6.2
- name: python packages | install scipy
shell: pip install scipy==0.11.0
---
jenkins_home: /var/lib/jenkins
jenkins_phantomjs_url: https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
jenkins_phantomjs_archive: phantomjs-1.9.1-linux-x86_64.tar.bz2
jenkins_phantomjs_folder: phantomjs-1.9.1-linux-x86_64
jenkins_user: "jenkins"
jenkins_user_home: /home/jenkins
jenkins_ruby_version: "1.9.3-p448"
jenkins_git_identity_path: "{{secure_dir}}/files/git-identity"
jenkins_debian_pkgs:
- ruby-bundler
- rubygems
- rbenv
- npm
- libgraphviz-dev
- gfortran
- libopenblas-dev
- liblapack-dev
- libxml2-dev
- libgeos-dev
- python-dev
- libmysqlclient-dev
- build-essential
- pkg-config
- libxslt1-dev
- rake
jenkins_plugins:
- ant.hpi
- backup.hpi
- build-name-setter.hpi
- build-timeout.hpi
- cobertura.hpi
- credentials.hpi
- cvs.hpi
- dashboard-view.hpi
- external-monitor-job.hpi
- ghprb.hpi
- git.hpi
- github.hpi
- git-client.hpi
- github-api.hpi
- github-oauth.hpi
- git-notes.hpi
- htmlpublisher.hpi
- javadoc.hpi
- jobConfigHistory.hpi
- ldap.hpi
- mailer.hpi
- mercurial.hpi
- nested-view.hpi
- next-build-number.hpi
- notification.hpi
- pam-auth.hpi
- parameterized-trigger.hpi
- postbuild-task.hpi
- rbenv.hpi
- ruby-runtime.hpi
- shiningpanda.hpi
- ssh-credentials.hpi
- ssh-slaves.hpi
- subversion.hpi
- thinBackup.hpi
- tmpcleaner.hpi
- token-macro.hpi
- translation.hpi
- violations.hpi
- multiple-scms.hpi
- timestamper.hpi
---
- name: start xvfb
service: name=xvfb state=started
- name: restart Jenkins
service: name=jenkins state=restarted
---
- name: common | Create jenkins group
group: name={{ jenkins_group }} state=present
- name: jenkins | Add the jenkins user to the group
user: name={{ jenkins_user }} append=yes groups={{ jenkins_group }}
- name: jenkins | Install Jenkins
shell: wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
- name: jenkins | Install Jenkins 2
shell: sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
- name: jenkins | Install Jenkins 3
shell: apt-get update
- name: jenkins | Install jenkins 4
apt: pkg=jenkins state=present
- name: jenkins | Make plugins directory
sudo_user: jenkins
shell: mkdir -p {{ jenkins_home }}/plugins
- name: jenkins | Install Jenkins plugins
sudo_user: jenkins
get_url: url=http://updates.jenkins-ci.org/download/plugins/${item.name}/${item.version}/${item.name}.hpi
dest={{ jenkins_home }}/plugins/${item.name}.hpi
with_items: "{{ jenkins_plugins }}"
notify:
- restart Jenkins
- name: Install git
apt: pkg=git state=present
jenkins_home: /var/lib/jenkins
jenkins_user: "jenkins"
jenkins_group: "edx"
jenkins_plugins:
- { name: "build-name-setter", version: "1.3" }
- { name: "build-timeout", version: "1.11" }
- { name: "build-flow-plugin", version: "0.10" }
- { name: "buildgraph-view", version: "1.1" }
- { name: "cobertura", version: "1.9.2" }
- { name: "credentials", version: "1.4" }
- { name: "dashboard-view", version: "2.9.1" }
- { name: "ec2", version: "1.18" }
- { name: "git", version: "1.5.0" }
- { name: "github", version: "1.8" }
- { name: "git-client", version: "1.1.2" }
- { name: "github-api", version: "1.44" }
- { name: "github-oauth", version: "0.14" }
- { name: "htmlpublisher", version: "1.2" }
- { name: "jobConfigHistory", version: "2.4" }
- { name: "nested-view", version: "1.10" }
- { name: "next-build-number", version: "1.0" }
- { name: "notification", version: "1.5" }
- { name: "pam-auth", version: "1.0" }
- { name: "parameterized-trigger", version: "2.20" }
- { name: "postbuild-task", version: "1.8" }
- { name: "s3", version: "0.5" }
- { name: "scm-sync-configuration", version: "0.0.7.3" }
- { name: "ssh-credentials", version: "0.3" }
- { name: "ssh-slaves", version: "0.25" }
- { name: "tmpcleaner", version: "1.1" }
- { name: "token-macro", version: "1.8.1" }
- { name: "translation", version: "1.10" }
- { name: "violations", version: "0.7.11" }
- { name: "multiple-scms", version: "0.2" }
- { name: "timestamper", version: "1.5.7" }
---
- name: start xvfb
service: name=xvfb state=started
......@@ -2,6 +2,9 @@
- name: browsers | Install Firefox
apt: pkg=firefox
- name: browsers | Install dbus-x11 (FF requirement)
apt: pkg=dbus-x11
- name: browsers | Download PhantomJS
get_url: url={{ jenkins_phantomjs_url }}
dest=/var/tmp/{{ jenkins_phantomjs_archive }}
......@@ -17,12 +20,9 @@
- name: browsers | Set PhantomJS permissions
file: path=/usr/local/bin/phantomjs mode=0755 state=directory
- name: browsers | Install chrome dependencies
- name: browsers | Install Chrome dependencies
apt: pkg=libgconf2-4,libxss1,libnss3-1d,libcurl3,xdg-utils
- name: browsers | Install unzip O_o
apt: pkg=unzip
- name: browsers | Install Google Chrome
get_url: url=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb dest=/var/tmp/google-chrome-stable_current_amd64.deb
......@@ -43,4 +43,3 @@
- name: browsers | Install Chromedriver 4
file: path=/usr/local/bin/chromedriver mode=0755
---
- name: JSCover | Install Java
apt: pkg=openjdk-7-jre-headless state=present
- name: JSCover | Download JSCover
get_url: url={{ jscover_url }} dest=/var/tmp/jscover.zip
- name: JSCover | Unzip JSCover
shell: unzip /var/tmp/jscover.zip -d /var/tmp/jscover
creates=/var/tmp/jscover
- name: JSCover | Install JSCover JAR
command: cp /var/tmp/jscover/target/dist/JSCover-all.jar /usr/local/bin/JSCover-all.jar
creates=/usr/local/bin/JSCover-all.jar
- name: JSCover | Set JSCover permissions
command: chmod go+rx /usr/local/bin/JSCover-all.jar
- name: JSCover | Add bash script
template: src=jscover.sh.j2 dest={{ jenkins_user_home }}/jscover
owner={{ jenkins_user }} group={{ jenkins_group }} mode=0755
- name: JSCover | Add source of jscover.sh to .bashrc
lineinfile:
dest="{{ jenkins_user_home }}/.bashrc"
regexp=". {{ jenkins_user_home }}/jscover"
line=". {{ jenkins_user_home }}/jscover"
---
# jenkins
#
# Provision a Jenkins instance.
#
# Parameters:
# `jenkins_user`: jenkins
# `jenkins_home`: /var/lib/jenkins
# `jenkins_user_home`: /home/jenkins
# `jenkins_debian_pkgs`: List of Jenkins-specific Debian packages to install
- include: system.yml
- include: xvfb.yml
- include: browsers.yml
- include: jscover.yml
---
- name: common | Create jenkins group
group: name={{ jenkins_group }} state=present
- name: jenkins | Add the jenkins user to the group
user: name={{ jenkins_user }} append=yes groups={{ jenkins_group }}
- name: jenkins | Create .ssh directory
file: path={{ jenkins_user_home }}/.ssh state=directory
owner={{ jenkins_user }} group={{ jenkins_group }}
# Because of a bug in the latest release of the EC2 plugin
# we need to use a key generated by Amazon (not imported)
# To satisfy this, we allow users to log in as Jenkins
# using the same keypair the instance was started with.
- name: jenkins | Copy ssh keys for jenkins
command: cp /home/ubuntu/.ssh/authorized_keys /home/{{ jenkins_user }}/.ssh/authorized_keys
- name: jenkins | Set key permissions
file: path={{ jenkins_user_home }}/.ssh/authorized_keys
owner={{ jenkins_user }} group={{ jenkins_group }}
mode=600
- name: jenkins | Create directory for builds
file: path={{ jenkins_workspace }}
owner={{ jenkins_user }} group={{ jenkins_group }}
state=directory
- name: jenkins | Install system packages
apt: pkg=${item}
with_items:
- npm
- graphviz
- npm
- libgraphviz-dev
- gfortran
- libopenblas-dev
- liblapack-dev
- libxml2-dev
- libgeos-dev
- libmysqlclient-dev
- build-essential
- pkg-config
- libxslt1-dev
tags:
- system_pkgs
......@@ -10,4 +10,4 @@
- name: xvfb | start xvfb
shell: start xvfb
ignore_errors: yes
\ No newline at end of file
ignore_errors: yes
export JSCOVER_JAR=/usr/local/bin/JSCover-all.jar
---
jenkins_workspace: /opt/jenkins
jenkins_phantomjs_url: https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
jenkins_phantomjs_archive: phantomjs-1.9.1-linux-x86_64.tar.bz2
jenkins_phantomjs_folder: phantomjs-1.9.1-linux-x86_64
jenkins_user: "jenkins"
jenkins_group: "jenkins"
jenkins_user_home: /home/jenkins
jenkins_ruby_version: "1.9.3-p374"
# Ruby Specific Vars
ruby_base: "{{ jenkins_user_home }}"
rbenv_root: "{{ ruby_base }}/.rbenv"
ruby_version: "{{ jenkins_ruby_version }}"
gem_home: "{{ ruby_base }}/.gem"
# JSCover direct download URL
jscover_url: "http://superb-dca2.dl.sourceforge.net/project/jscover/JSCover-1.0.2.zip"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment