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
OpenEdx
configuration
Commits
01503e09
Commit
01503e09
authored
Sep 18, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install Python packages to the system
parent
0f60191f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
0 deletions
+61
-0
playbooks/roles/jenkins_worker/files/install_python_pkgs.sh
+36
-0
playbooks/roles/jenkins_worker/tasks/system.yml
+16
-0
playbooks/roles/jenkins_worker/templates/python_pkgs.conf.j2
+6
-0
playbooks/roles/jenkins_worker/vars/main.yml
+3
-0
No files found.
playbooks/roles/jenkins_worker/files/install_python_pkgs.sh
0 → 100644
View file @
01503e09
#!/usr/bin/env bash
set
-e
#####################################################
#
# python_pkgs.sh
#
# Use easy_install to download packages from
# an S3 bucket and install them in the system.
#
# Usage:
#
# python_pkgs.sh S3_URL
#
# where `S3_URL` is the URL of an S3 bucket
# containing .egg files
#
######################################################
if
[
$#
-ne
1
]
;
then
echo
"Usage:
$0
S3_URL"
exit
1
fi
S3_URL
=
$1
# Retrieve the list of files in the bucket
echo
"Downloading Python packages from S3..."
curl
$S3_URL
| xml_grep
'Key'
--text_only
>
/tmp/python_pkgs.txt
# Install each package into the virtualenv
# If an error occurs, print stderr but do not abort
echo
"Installing Python packages..."
while
read
package
;
do
easy_install
$S3_URL
/
$package
||
true
done
< /tmp/python_pkgs.txt
playbooks/roles/jenkins_worker/tasks/system.yml
View file @
01503e09
...
...
@@ -49,6 +49,8 @@
-
unzip
-
xml-twig-tools
# Configure Mongo to use /mnt so we don't
# run out of disk space
-
name
:
jenkins | Stop mongo service
service
:
name=mongodb state=stopped
...
...
@@ -66,3 +68,17 @@
-
name
:
jenkins | Start the mongo service
service
:
name=mongodb state=stopped
# Install scripts to load Python packages from S3 on startup
-
name
:
jenkins | Install Python packages script
copy
:
src="install_python_pkgs.sh" dest="/usr/local/bin/install_python_pkgs.sh"
force=yes
-
name
:
jenkins | Make Python packages script executable
file
:
path="/usr/local/bin/install_python_pkgs.sh"
owner=root group=root
mode=755
-
name
:
jenkins | Install Python packages upstart script
template
:
src="python_pkgs.conf.j2" dest="/etc/init/python_pkgs.conf"
playbooks/roles/jenkins_worker/templates/python_pkgs.conf.j2
0 → 100644
View file @
01503e09
# Pre-install Python packages from S3
start on runlevel [2345]
task
exec install_python_pkgs.sh {{ PYTHON_PKG_URL }}
playbooks/roles/jenkins_worker/vars/main.yml
View file @
01503e09
...
...
@@ -20,3 +20,6 @@ jscover_url: "http://superb-dca2.dl.sourceforge.net/project/jscover/JSCover-1.0.
# Mongo config
MONGO_DIR
:
"
/mnt/mongodb"
MONGO_LOG_DIR
:
"
/mnt/logs/mongodb"
# URL of S3 bucket containing pre-compiled Python packages
PYTHON_PKG_URL
:
"
https://s3.amazonaws.com/jenkins.python_pkgs"
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