Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
dec8ff69
Commit
dec8ff69
authored
Feb 21, 2017
by
Michael Roytman
Committed by
GitHub
Feb 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3690 from edx/mroytman/update-dockerfile
Mroytman/update dockerfile
parents
73f1aa1f
07b20395
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
52 deletions
+95
-52
docker/build/tools_jenkins/Dockerfile
+3
-1
playbooks/edx-east/tools_jenkins.yml
+0
-0
playbooks/roles/jenkins_master/handlers/main.yml
+9
-0
playbooks/roles/jenkins_master/tasks/main.yml
+81
-12
playbooks/roles/tools_jenkins/handlers/main.yml
+0
-6
playbooks/roles/tools_jenkins/meta/main.yml
+1
-0
playbooks/roles/tools_jenkins/tasks/main.yml
+0
-32
util/parsefiles.py
+1
-1
No files found.
docker/build/tools_jenkins/Dockerfile
View file @
dec8ff69
...
@@ -7,4 +7,6 @@ RUN apt-get update
...
@@ -7,4 +7,6 @@ RUN apt-get update
ADD
. /edx/app/edx_ansible/edx_ansible
ADD
. /edx/app/edx_ansible/edx_ansible
WORKDIR
/edx/app/edx_ansible/edx_ansible/docker/plays
WORKDIR
/edx/app/edx_ansible/edx_ansible/docker/plays
COPY
docker/build/tools_jenkins/ansible_overrides.yml /
COPY
docker/build/tools_jenkins/ansible_overrides.yml /
RUN
PYTHONUNBUFFERED
=
1 /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook
-v
jenkins_tools.yml
-i
'127.0.0.1,'
-c
local
-e
@/ansible_overrides.yml
-vv
RUN
PYTHONUNBUFFERED
=
1 /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook
-v
jenkins_tools.yml
-i
'127.0.0.1,'
-c
local
-e
@/ansible_overrides.yml
-vv
-t
'install'
CMD
/bin/su -l jenkins --shell=/bin/bash -c "/usr/bin/daemon -f --name=jenkins --inherit --env=JENKINS_HOME=/edx/var/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid -- /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1"
playbooks/edx-east/
jenkins_tool
s.yml
→
playbooks/edx-east/
tools_jenkin
s.yml
View file @
dec8ff69
File moved
playbooks/roles/jenkins_master/handlers/main.yml
View file @
dec8ff69
...
@@ -3,13 +3,22 @@
...
@@ -3,13 +3,22 @@
service
:
service
:
name
:
jenkins
name
:
jenkins
state
:
restarted
state
:
restarted
tags
:
-
manage
-
manage:start
-
name
:
start nginx
-
name
:
start nginx
service
:
service
:
name
:
nginx
name
:
nginx
state
:
started
state
:
started
tags
:
-
manage
-
manage:start
-
name
:
reload nginx
-
name
:
reload nginx
service
:
service
:
name
:
nginx
name
:
nginx
state
:
reloaded
state
:
reloaded
tags
:
-
manage
-
manage:start
playbooks/roles/jenkins_master/tasks/main.yml
View file @
dec8ff69
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
with_items
:
"
{{
jenkins_debian_pkgs
}}"
with_items
:
"
{{
jenkins_debian_pkgs
}}"
tags
:
tags
:
-
jenkins
-
jenkins
-
install
-
install:system-requirements
-
name
:
Install jenkins extra system packages
-
name
:
Install jenkins extra system packages
apt
:
apt
:
...
@@ -16,17 +18,25 @@
...
@@ -16,17 +18,25 @@
with_items
:
"
{{
JENKINS_EXTRA_PKGS
}}"
with_items
:
"
{{
JENKINS_EXTRA_PKGS
}}"
tags
:
tags
:
-
jenkins
-
jenkins
-
install
-
install:system-requirements
-
name
:
Create jenkins group
-
name
:
Create jenkins group
group
:
group
:
name
:
"
{{
jenkins_group
}}"
name
:
"
{{
jenkins_group
}}"
state
:
present
state
:
present
tags
:
-
install
-
install:system-requirements
-
name
:
Add the jenkins user to the group
-
name
:
Add the jenkins user to the group
user
:
user
:
name
:
"
{{
jenkins_user
}}"
name
:
"
{{
jenkins_user
}}"
append
:
yes
append
:
yes
groups
:
"
{{
jenkins_group
}}"
groups
:
"
{{
jenkins_group
}}"
tags
:
-
install
-
install:system-requirements
# Should be resolved in the next release, but until then we need to do this
# Should be resolved in the next release, but until then we need to do this
# https://issues.jenkins-ci.org/browse/JENKINS-20407
# https://issues.jenkins-ci.org/browse/JENKINS-20407
...
@@ -36,19 +46,31 @@
...
@@ -36,19 +46,31 @@
state
:
directory
state
:
directory
owner
:
"
{{
jenkins_user
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
group
:
"
{{
jenkins_group
}}"
tags
:
-
install
-
install:system-requirements
# TODO in Ansible 2.1 we can do apt: deb="{{ jenkins_deb_url }}"
# TODO in Ansible 2.1 we can do apt: deb="{{ jenkins_deb_url }}"
-
name
:
download Jenkins package
-
name
:
download Jenkins package
get_url
:
url="{{ jenkins_deb_url }}" dest="/tmp/{{ jenkins_deb }}"
get_url
:
url="{{ jenkins_deb_url }}" dest="/tmp/{{ jenkins_deb }}"
tags
:
-
install
-
install:app-requirements
-
name
:
install Jenkins package
-
name
:
install Jenkins package
apt
:
apt
:
deb
:
"
/tmp/{{
jenkins_deb
}}"
deb
:
"
/tmp/{{
jenkins_deb
}}"
tags
:
-
install
-
install:app-requirements
-
name
:
Stop Jenkins
-
name
:
Stop Jenkins
service
:
service
:
name
:
jenkins
name
:
jenkins
state
:
stopped
state
:
stopped
tags
:
-
manage
-
manage:stop
-
name
:
Set jvm args
-
name
:
Set jvm args
lineinfile
:
lineinfile
:
...
@@ -56,11 +78,11 @@
...
@@ -56,11 +78,11 @@
dest
:
/etc/default/jenkins
dest
:
/etc/default/jenkins
regexp
:
'
^JAVA_ARGS='
regexp
:
'
^JAVA_ARGS='
line
:
'
JAVA_ARGS="{{
jenkins_jvm_args
}}"'
line
:
'
JAVA_ARGS="{{
jenkins_jvm_args
}}"'
notify
:
-
restart Jenkins
tags
:
tags
:
-
java
-
java
-
jenkins
-
jenkins
-
install
-
install:app-configuration
-
name
:
Set jenkins home
-
name
:
Set jenkins home
lineinfile
:
lineinfile
:
...
@@ -68,17 +90,20 @@
...
@@ -68,17 +90,20 @@
dest
:
/etc/default/jenkins
dest
:
/etc/default/jenkins
regexp
:
'
^JENKINS_HOME='
regexp
:
'
^JENKINS_HOME='
line
:
'
JENKINS_HOME="{{
jenkins_home
}}"'
line
:
'
JENKINS_HOME="{{
jenkins_home
}}"'
notify
:
-
restart Jenkins
tags
:
tags
:
-
java
-
java
-
jenkins
-
jenkins
-
install
-
install:app-configuration
# Move /var/lib/jenkins to Jenkins home (on the EBS)
# Move /var/lib/jenkins to Jenkins home (on the EBS)
-
name
:
Move /var/lib/jenkins
-
name
:
Move /var/lib/jenkins
command
:
"
mv
/var/lib/jenkins
{{
jenkins_home
}}"
command
:
"
mv
/var/lib/jenkins
{{
jenkins_home
}}"
args
:
args
:
creates
:
"
{{
jenkins_home
}}"
creates
:
"
{{
jenkins_home
}}"
tags
:
-
install
-
install:base
-
name
:
Set owner for Jenkins home
-
name
:
Set owner for Jenkins home
file
:
file
:
...
@@ -87,6 +112,9 @@
...
@@ -87,6 +112,9 @@
state
:
directory
state
:
directory
owner
:
"
{{
jenkins_user
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
group
:
"
{{
jenkins_group
}}"
tags
:
-
install
-
install:app-requirements
# Symlink /var/lib/jenkins to {{ COMMON_DATA_DIR }}/jenkins
# Symlink /var/lib/jenkins to {{ COMMON_DATA_DIR }}/jenkins
# since Jenkins will expect its files to be in /var/lib/jenkins
# since Jenkins will expect its files to be in /var/lib/jenkins
...
@@ -97,13 +125,17 @@
...
@@ -97,13 +125,17 @@
state
:
link
state
:
link
owner
:
"
{{
jenkins_user
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
group
:
"
{{
jenkins_group
}}"
notify
:
tags
:
-
restart Jenkins
-
install
-
install:base
# Using this instead of the user module because the user module
# Using this instead of the user module because the user module
# fails if the directory exists.
# fails if the directory exists.
-
name
:
Set home directory for jenkins user
-
name
:
Set home directory for jenkins user
shell
:
"
usermod
-d
{{
jenkins_home
}}
{{
jenkins_user
}}"
shell
:
"
usermod
-d
{{
jenkins_home
}}
{{
jenkins_user
}}"
tags
:
-
install
-
install:base
-
name
:
Make plugins directory
-
name
:
Make plugins directory
file
:
file
:
...
@@ -111,6 +143,9 @@
...
@@ -111,6 +143,9 @@
state
:
directory
state
:
directory
owner
:
"
{{
jenkins_user
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
group
:
"
{{
jenkins_group
}}"
tags
:
-
install
-
install:base
# We first download the plugins to a temp directory and include
# We first download the plugins to a temp directory and include
# the version in the file name. That way, if we increment
# the version in the file name. That way, if we increment
...
@@ -121,11 +156,17 @@
...
@@ -121,11 +156,17 @@
dest
:
"
/tmp/{{
item.name
}}_{{
item.version
}}"
dest
:
"
/tmp/{{
item.name
}}_{{
item.version
}}"
with_items
:
"
{{
jenkins_plugins
}}"
with_items
:
"
{{
jenkins_plugins
}}"
register
:
jenkins_plugin_downloads
register
:
jenkins_plugin_downloads
tags
:
-
install
-
install:base
-
name
:
Install Jenkins plugins
-
name
:
Install Jenkins plugins
command
:
"
cp
{{
item.dest
}}
{{
jenkins_home
}}/plugins/{{
item.item.name
}}.hpi"
command
:
"
cp
{{
item.dest
}}
{{
jenkins_home
}}/plugins/{{
item.item.name
}}.hpi"
with_items
:
"
{{
jenkins_plugin_downloads.results
}}"
with_items
:
"
{{
jenkins_plugin_downloads.results
}}"
when
:
item.changed
when
:
item.changed
tags
:
-
install
-
install:base
-
name
:
Set Jenkins plugin permissions
-
name
:
Set Jenkins plugin permissions
file
:
file
:
...
@@ -135,8 +176,9 @@
...
@@ -135,8 +176,9 @@
mode
:
"
0644"
mode
:
"
0644"
with_items
:
"
{{
jenkins_plugin_downloads.results
}}"
with_items
:
"
{{
jenkins_plugin_downloads.results
}}"
when
:
item.changed
when
:
item.changed
notify
:
tags
:
-
restart Jenkins
-
install
-
install:base
# We had to fork some plugins to workaround
# We had to fork some plugins to workaround
# certain issues. If these changes get merged
# certain issues. If these changes get merged
...
@@ -150,6 +192,9 @@
...
@@ -150,6 +192,9 @@
accept_hostkey
:
yes
accept_hostkey
:
yes
with_items
:
"
{{
jenkins_custom_plugins
}}"
with_items
:
"
{{
jenkins_custom_plugins
}}"
register
:
jenkins_custom_plugins_checkout
register
:
jenkins_custom_plugins_checkout
tags
:
-
install
-
install:base
-
name
:
Compile custom plugins
-
name
:
Compile custom plugins
command
:
"
mvn
-Dmaven.test.skip=true
install"
command
:
"
mvn
-Dmaven.test.skip=true
install"
...
@@ -157,14 +202,18 @@
...
@@ -157,14 +202,18 @@
chdir
:
"
/tmp/{{
item.item.repo_name
}}"
chdir
:
"
/tmp/{{
item.item.repo_name
}}"
with_items
:
"
{{
jenkins_custom_plugins_checkout.results
}}"
with_items
:
"
{{
jenkins_custom_plugins_checkout.results
}}"
when
:
item.changed
when
:
item.changed
tags
:
-
install
-
install:base
-
name
:
Install custom plugins
-
name
:
Install custom plugins
command
:
mv /tmp/{{ item.item.repo_name }}/target/{{ item.item.package }}
command
:
mv /tmp/{{ item.item.repo_name }}/target/{{ item.item.package }}
{{ jenkins_home }}/plugins/{{ item.item.package }}
{{ jenkins_home }}/plugins/{{ item.item.package }}
with_items
:
"
{{
jenkins_custom_plugins_checkout.results
}}"
with_items
:
"
{{
jenkins_custom_plugins_checkout.results
}}"
when
:
item.changed
when
:
item.changed
notify
:
tags
:
-
restart Jenkins
-
install
-
install:base
-
name
:
Set custom plugin permissions
-
name
:
Set custom plugin permissions
file
:
file
:
...
@@ -174,6 +223,9 @@
...
@@ -174,6 +223,9 @@
mode
:
"
0700"
mode
:
"
0700"
with_items
:
"
{{
jenkins_custom_plugins_checkout.results
}}"
with_items
:
"
{{
jenkins_custom_plugins_checkout.results
}}"
when
:
item.changed
when
:
item.changed
tags
:
-
install
-
install:base
# Plugins that are bundled with Jenkins are "pinned".
# Plugins that are bundled with Jenkins are "pinned".
# Jenkins will overwrite updated plugins with its built-in version
# Jenkins will overwrite updated plugins with its built-in version
...
@@ -184,21 +236,38 @@
...
@@ -184,21 +236,38 @@
args
:
args
:
creates
:
"
{{
jenkins_home
}}/plugins/{{
item
}}.jpi.pinned"
creates
:
"
{{
jenkins_home
}}/plugins/{{
item
}}.jpi.pinned"
with_items
:
"
{{
jenkins_bundled_plugins
}}"
with_items
:
"
{{
jenkins_bundled_plugins
}}"
tags
:
-
install
-
install:base
-
name
:
Setup nginix vhost
-
name
:
Setup nginix vhost
template
:
template
:
src
:
"
etc/nginx/sites-available/jenkins.j2"
src
:
"
etc/nginx/sites-available/jenkins.j2"
dest
:
"
/etc/nginx/sites-available/jenkins"
dest
:
"
/etc/nginx/sites-available/jenkins"
tags
:
-
install
-
install:vhosts
-
name
:
Enable jenkins vhost
-
name
:
Enable jenkins vhost
file
:
file
:
src
:
"
/etc/nginx/sites-available/jenkins"
src
:
"
/etc/nginx/sites-available/jenkins"
dest
:
"
/etc/nginx/sites-enabled/jenkins"
dest
:
"
/etc/nginx/sites-enabled/jenkins"
state
:
link
state
:
link
notify
:
tags
:
-
start nginx
-
install
-
install:vhosts
-
include
:
datadog.yml
-
include
:
datadog.yml
when
:
COMMON_ENABLE_DATADOG
when
:
COMMON_ENABLE_DATADOG
tags
:
tags
:
-
datadog
-
datadog
-
install
-
install:base
-
name
:
restart Jenkinks
service
:
name
:
jenkins
state
:
restarted
tags
:
-
manage
-
manage:start
playbooks/roles/tools_jenkins/handlers/main.yml
deleted
100644 → 0
View file @
73f1aa1f
---
-
name
:
restart Jenkins
service
:
name
:
jenkins
state
:
restarted
\ No newline at end of file
playbooks/roles/tools_jenkins/meta/main.yml
View file @
dec8ff69
...
@@ -7,3 +7,4 @@ dependencies:
...
@@ -7,3 +7,4 @@ dependencies:
jenkins_plugins
:
"
{{
jenkins_tools_plugins
}}"
jenkins_plugins
:
"
{{
jenkins_tools_plugins
}}"
jenkins_version
:
"
{{
jenkins_tools_version
}}"
jenkins_version
:
"
{{
jenkins_tools_version
}}"
jenkins_deb_url
:
"
http://pkg.jenkins-ci.org/debian-stable/binary/jenkins_{{
jenkins_version
}}_all.deb"
jenkins_deb_url
:
"
http://pkg.jenkins-ci.org/debian-stable/binary/jenkins_{{
jenkins_version
}}_all.deb"
jenkins_custom_plugins
:
[]
playbooks/roles/tools_jenkins/tasks/main.yml
View file @
dec8ff69
---
---
-
name
:
Get the list of hpi files
shell
:
"
ls
{{
jenkins_home
}}/plugins/*.hpi"
register
:
hpi_files
ignore_errors
:
true
-
name
:
Set the permission on hpi files
file
:
path
:
"
{{
item
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
mode
:
0644
with_items
:
"
{{
hpi_files.stdout_lines
}}"
when
:
hpi_files
notify
:
-
restart Jenkins
-
name
:
Get the list of jpi files
shell
:
"
ls
{{
jenkins_home
}}/plugins/*.jpi"
register
:
jpi_files
ignore_errors
:
true
-
name
:
Set the permission on jpi files
file
:
path
:
"
{{
item
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
mode
:
0644
with_items
:
"
{{
jpi_files.stdout_lines
}}"
when
:
jpi_files
notify
:
-
restart Jenkins
# The deadsnakes PPA is required to install python3.5 on Precise and Trusty.
# The deadsnakes PPA is required to install python3.5 on Precise and Trusty.
# Xenial comes with python3.5 installed.
# Xenial comes with python3.5 installed.
-
name
:
add deadsnakes repository
-
name
:
add deadsnakes repository
...
...
util/parsefiles.py
View file @
dec8ff69
...
@@ -207,7 +207,7 @@ def get_plays(files, git_dir, playbooks_dirs):
...
@@ -207,7 +207,7 @@ def get_plays(files, git_dir, playbooks_dirs):
# if the change set file is in the set of playbook files
# if the change set file is in the set of playbook files
if
file_path
in
candidate_files
:
if
file_path
in
candidate_files
:
plays
.
add
(
_get_playbok_name_from_file
(
file_path
))
plays
.
add
(
_get_playbo
o
k_name_from_file
(
file_path
))
return
plays
return
plays
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment