forked from theteam/vagrant-django-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More working with pip and virtualenv.
- Loading branch information
Showing
6 changed files
with
73 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
define deployment::development::setup ($project_path="") { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
define deployment::production::setup ($project_path="") { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Adapted from https://github.com/uggedal/puppet-module-python | ||
# Thanks to Eivind Uggedal. | ||
define python2::pip::requirements($venv, $owner=undef, $group=undef) { | ||
$requirements = $name | ||
$checksum = "$venv/requirements.checksum" | ||
|
||
file { $requirements: | ||
ensure => present, | ||
replace => false, | ||
owner => $owner, | ||
group => $group, | ||
} | ||
|
||
# We create a sha1 checksum of the requirements file so that | ||
# we can detect when it changes: | ||
exec { "create new checksum of $name requirements": | ||
command => "sha1sum $requirements > $checksum", | ||
unless => "sha1sum -c $checksum", | ||
path => "/usr/local/bin:/usr/bin:/bin", | ||
require => File[$requirements], | ||
} | ||
|
||
exec { "update $name requirements": | ||
command => "$venv/bin/pip install -Ur $requirements", | ||
cwd => $venv, | ||
subscribe => Exec["create new checksum of $name requirements"], | ||
refreshonly => true, | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters