Skip to content

Commit

Permalink
Merge pull request #206 from plone/new-structure
Browse files Browse the repository at this point in the history
New structure
  • Loading branch information
gforcada committed Jul 22, 2017
2 parents 1b277c4 + 3a2409d commit 4d1b0a7
Show file tree
Hide file tree
Showing 50 changed files with 43 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jenkins.ini
secrets.yml
jobs/config.ini
ansible/secrets.yml
auth.py
/develop-eggs
/eggs
Expand Down Expand Up @@ -28,4 +28,4 @@ docs/Makefile
docs/make.bat
docs/doctrees
docs/html
roles/
ansible/roles/
8 changes: 4 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Vagrant.configure("2") do |config|
master.vm.network "private_network", ip: "192.168.50.2"

master.vm.provision "ansible" do |ansible|
ansible.inventory_path = "inventory-local.txt"
ansible.playbook = "jenkins_local.yml"
ansible.inventory_path = "ansible/vagrant/inventory.txt"
ansible.playbook = "ansible/vagrant/playbook.yml"
ansible.limit = "master"
end
end
Expand All @@ -18,8 +18,8 @@ Vagrant.configure("2") do |config|
node.vm.network "private_network", ip: "192.168.50.10"

node.vm.provision "ansible" do |ansible|
ansible.inventory_path = "inventory-local.txt"
ansible.playbook = "jenkins_local.yml"
ansible.inventory_path = "ansible/vagrant/inventory.txt"
ansible.playbook = "ansible/vagrant/playbook.yml"
ansible.limit = "node"
end
end
Expand Down
4 changes: 2 additions & 2 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[defaults]
roles_path = roles
hostfile = inventory.txt
roles_path = ansible/roles
hostfile = ansible/inventory.txt
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion jenkins_server.yml → ansible/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- plone.jenkins_server
vars:
admin_email: gil.gnome@gmail.com
simple_theme_css_url: https://rawgit.com/plone/jenkins.plone.org/master/jenkins.plone.org.css
simple_theme_css_url: https://rawgit.com/plone/jenkins.plone.org/master/files/jenkins.plone.org.css
simple_theme_js_url: https://cdnjs.cloudflare.com/ajax/libs/doony/2.1/js/doony.min.js
jenkins_admins:
- tisto
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions jenkins_local.yml → ansible/vagrant/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
pillow: true
lxml: true
vars_files:
- secrets.yml
- ../secrets.yml

tasks:
# most probably this vagrant box will not have a public Internet IP
Expand All @@ -40,23 +40,23 @@
- name: 'Override node configuration'
become: yes
copy:
src=etc/node.xml
src=files/node.xml
dest=/var/lib/jenkins/nodes/node/config.xml
owner=jenkins
group=jenkins

- name: 'Add dummy private key'
become: yes
copy:
src=etc/vagrant.priv
src=files/key.priv
dest=/var/lib/jenkins/private_key
owner=jenkins
group=jenkins

- name: 'Add credentials.xml'
become: yes
copy:
src=etc/jenkins_credentials.xml
src=files/credentials.xml
dest=/var/lib/jenkins/credentials.xml
owner=jenkins
group=jenkins
Expand All @@ -73,4 +73,4 @@
become: yes
authorized_key:
user=jenkins
key="{{ lookup('file', 'etc/vagrant.pub') }}"
key="{{ lookup('file', 'files/key.pub') }}"
29 changes: 21 additions & 8 deletions docs/source/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,23 @@ Install all the tools needed (ansible, ansible roles and jenkins-job-builder):
.. code-block:: shell
$ pip install -r requirements.txt
$ ansible-galaxy install -r roles.yml
$ ansible-galaxy install -r ansible/roles.yml
$ git submodule update --init
Check inventory.txt and make sure that you can connect to the machines listed there.
.. note::
For the roles that are downloaded from checkouts,
plone.jenkins_server and plone.jenkins_node,
you will need to remove them and clone them manually if you want to make changes on them.

.. code-block:: shell
$ cd ansible/roles
$ rm -rf plone.jenkins_server
$ rm -rf plone.jenkins_node
$ git clone git@github.com:plone/plone.jenkins_server
$ git clone git@github.com:plone/plone.jenkins_node
Check ansible/inventory.txt and make sure that you can connect to the machines listed there.

Copy your public ssh key to all servers:

Expand Down Expand Up @@ -71,27 +84,27 @@ Test the jobs are properly setup:

.. code-block:: shell
$ jenkins-jobs --conf jenkins.ini.in test jobs.yml -o output
$ jenkins-jobs --conf jobs/config.ini.in test jobs/jobs.yml -o output
.. note::
A folder named ``output`` should contain one file per each jenkins job
configured on jobs.yml

Create your own ``jenkins.ini`` by copying it from ``jenkins.ini.in``:
Create your own ``jobs/config.ini`` by copying it from ``jobs/config.ini.in``:

.. code-block:: shell
$ cp jenkins.ini.in jenkins.ini
$ cp jobs/config.ini.in jobs/config.ini
Add your own credentials to jenkins.ini.
Add your own credentials to jobs/config.ini.
You can find them when you log into Jenkins and copy your API token
(e.g. http://jenkins.plone.org/user/tisto/configure).

Create your own ``secrets.yml`` by copying it from ``secrets.yml.in``:
Create your own ``ansible/secrets.yml`` by copying it from ``ansible/secrets.yml.in``:

.. code-block:: shell
$ cp secrets.yml.in secrets.yml
$ cp ansible/secrets.yml.in ansible/secrets.yml
Add github API secrets that are needed for the github login functionality on jenkins.plone.org.
You can find those settings on plone organization in github:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/vagrant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ Finally, to run ``jenkins-job-builder`` on it, run:

.. code-block:: shell
jenkins-jobs --conf jenkins.ini.in update jobs.yml
jenkins-jobs --conf jobs/config.ini.in update jobs/jobs.yml
*Enjoy!*
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions etc/sponsors/sponsors.html → files/sponsors/sponsors.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div style="text-align: center; width: 32%; margin-right: 2%; float: left;">
<a href="http://www.iskra.cat">
<img src="https://cdn.rawgit.com/plone/jenkins.plone.org/master/etc/sponsors/iskra.png" alt="Iskra" />
<img src="https://cdn.rawgit.com/plone/jenkins.plone.org/master/files/sponsors/iskra.png" alt="Iskra" />
</a>
</div>
<div style="text-align: center; width: 32%; margin-right: 2%; float: left;">
<a href="http://www.kitconcept.com">
<img src="https://cdn.rawgit.com/plone/jenkins.plone.org/master/etc/sponsors/kitconcept.png" alt="kitconcept" />
<img src="https://cdn.rawgit.com/plone/jenkins.plone.org/master/files/sponsors/kitconcept.png" alt="kitconcept" />
</a>
</div>
<div style="text-align: center; width: 32%; float: left;">
<a href="http://www.rackspace.com">
<img src="https://cdn.rawgit.com/plone/jenkins.plone.org/master/etc/sponsors/rackspace.jpg" alt="Rackspace" />
<img src="https://cdn.rawgit.com/plone/jenkins.plone.org/master/files/sponsors/rackspace.jpg" alt="Rackspace" />
</a>
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion update_jobs.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
jenkins-jobs --conf jenkins.ini update jobs.yml
jenkins-jobs --conf jobs/config.ini update jobs/jobs.yml
2 changes: 1 addition & 1 deletion update_master.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
ansible-playbook --limit jenkins_server -i inventory.txt jenkins_server.yml
ansible-playbook --limit jenkins_server -i ansible/inventory.txt ansible/server.yml
2 changes: 1 addition & 1 deletion update_nodes.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
ansible-playbook --limit jenkins_nodes -i inventory.txt jenkins_node.yml
ansible-playbook --limit jenkins_nodes -i ansible/inventory.txt ansible/node.yml

0 comments on commit 4d1b0a7

Please sign in to comment.