Permalink
Browse files

Fix some wrong variable and add link to package_client into README.md

  • Loading branch information...
EHER committed Apr 25, 2014
1 parent fee7dca commit 457180cd0c066b0501792b56047d113141e22c8b
Showing with 15 additions and 14 deletions.
  1. +9 −8 README.md
  2. +6 −6 templates/pack.sh.j2
View
@@ -7,7 +7,8 @@ A role to pack projects from git repositories into deb packages, and make then a
- eher_package_server_build_path - path used to build projects
- eher_package_server_name - name of the generated deb package
- eher_package_server_git_repo - git repository that have the project to be packed
- eher_package_build_command - command that will be executed on project root, before pack it
- eher_package_server_build_command - command that will be executed on project root, before pack it
- eher_package_server_destination_prefix - path to where the project will be extracted on package installation (default is /usr/local/<eher_package_server_name>)
## how it works?
@@ -28,12 +29,12 @@ Then you can configure some packages. A definition of a package is git repositor
sudo: yes
tags: package_server
roles:
- role: package_server
eher_package_name: 'queroservoluntario'
eher_package_git_repo: '/home/git/queroservoluntario.git'
eher_package_git_branch: 'Eher'
eher_package_build_command: 'make install'
eher_package_destination_prefix: '/var/www/queroservoluntario'
- role: EHER.package_server
eher_package_server_name: 'queroservoluntario'
eher_package_server_git_repo: '/home/git/queroservoluntario.git'
eher_package_server_git_branch: 'Eher'
eher_package_server_build_command: 'make install'
eher_package_server_destination_prefix: '/var/www/queroservoluntario'
```
Before run the role will be available a command to pack the project. In the example will be pack_queroservoluntario.sh, because the eher_package_name set.
@@ -50,5 +51,5 @@ sudo apt-get update
sudo apt-get install queroservoluntario
```
You can also use the package_client role and make it simpler.
You can also use the [package_client](https://github.com/EHER/ansible-package_client) role and make it simpler.
View
@@ -1,16 +1,16 @@
#!/bin/sh
git clone {{ eher_package_git_repo }} {{ eher_package_build_path }}/{{ eher_package_name }}
cd {{ eher_package_build_path }}/{{ eher_package_name }}
git clone {{ eher_package_server_git_repo }} {{ eher_package_server_build_path }}/{{ eher_package_server_name }}
cd {{ eher_package_server_build_path }}/{{ eher_package_server_name }}
git checkout {{ eher_package_git_branch|default('master') }}
git checkout {{ eher_package_server_git_branch|default('master') }}
{{ eher_package_build_command|default('') }}
{{ eher_package_server_build_command|default('') }}
fpm -s dir -t deb -n {{ eher_package_name }} --prefix {{ eher_package_destination_prefix|default('/usr/local/' + eher_package_name) }} -v 1.0 --iteration $(date +"%Y%m%d%H%M%S") .
fpm -s dir -t deb -n {{ eher_package_server_name }} --prefix {{ eher_package_server_destination_prefix|default('/usr/local/' + eher_package_server_name) }} -v 1.0 --iteration $(date +"%Y%m%d%H%M%S") .
mv *.deb /var/www/packages
cd /var/www/packages
dpkg-scanpackages -m . /dev/null | gzip -9c > Packages.gz
rm -rf {{ eher_package_build_path }}/{{ eher_package_name }}
rm -rf {{ eher_package_server_build_path }}/{{ eher_package_server_name }}

0 comments on commit 457180c

Please sign in to comment.