Skip to content

Commit 5cdb84f

Browse files
committed
Merge pull request #1 from fontanon/master
Download and deploy directly from gitorious
2 parents 86f2b82 + 0e998da commit 5cdb84f

File tree

3 files changed

+14
-35
lines changed

3 files changed

+14
-35
lines changed

Vagrantfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
6161
override.ssh.private_key_path = '~/.ssh/id_rsa'
6262
#override.vm.box = 'digital_ocean'
6363
#override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
64-
provider.client_id = 'e2198de55f612d89a062b47145b1a7ea'
65-
provider.api_key = '3e31f3349f03295ff863a1b649213f24'
64+
provider.client_id = ''
65+
provider.api_key = ''
6666
end
6767

6868
# Enable provisioning with chef server:

cookbooks/ocax/attributes/default.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# WARNING: Make sure this ip is correctly set on Vagrantfile private network param too!
33
default[:ocax][:host_ip] = "192.168.56.101"
44

5-
# Default hostname. You should set this on your host machine /etc/hosts file
5+
# Default hostname. You should set this on your host machine /etc/hosts file too.
66
default[:ocax][:host_name] = "ocax.dev"
77

8-
# OCAx source files, installation path, virtualhostname ...
8+
# OCAx virtualhostname.
99
default[:ocax][:virtualhost_name] = "node"
10-
default[:ocax][:download_cache] = "/tmp/ocax-1.1.2.tar.gz"
11-
default[:ocax][:download_url] = "http://ocax.net/download/ocax-1.1.2.tar.gz"
12-
default[:ocax][:download_checksum] = "0f8f132fc274ccfe061ebd5796a094fed90456f1c954084aa022e6f4fc9d2eda" # SHA256
10+
11+
# OCAx download and install paths
12+
default[:ocax][:gitrepo_uri] = "https://git.gitorious.org/ocax/ocax.git"
1313
default[:ocax][:installpath] = "/var/www/ocax"
1414

1515
# Yii framework (OCAx dependency)
@@ -31,4 +31,4 @@
3131
# Default OCAx admin credentials
3232
default[:ocax][:adminaccount_username] = "admin"
3333
default[:ocax][:adminaccount_password] = "admin"
34-
default[:ocax][:adminaccount_email] = "[email protected]"
34+
default[:ocax][:adminaccount_email] = "[email protected]"

cookbooks/ocax/recipes/default.rb

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,12 @@
4040
package("php5-gd")
4141
package("unzip")
4242

43-
# Create installation directory
44-
directory node["ocax"]["installpath"] do
45-
owner "root"
46-
group "root"
47-
mode "0755"
48-
action :create
49-
recursive true
50-
end
51-
52-
# Download and call unpack, only on the first provision
53-
remote_file node[:ocax][:download_cache] do
54-
source node[:ocax][:download_url]
55-
mode 00644
56-
checksum node[:ocax][:download_checksum]
57-
notifies :run, "execute[Unpack ocax]", :immediately
58-
end
59-
60-
# Unpack OCAx
61-
execute "Unpack ocax" do
62-
cwd node["ocax"]["installpath"]
63-
command "tar --strip-components 1 -xzf #{node[:ocax][:download_cache]}"
64-
action :nothing
43+
# Download the project (or sync last changes)
44+
package('git-core')
45+
git "#{node[:ocax][:installpath]}" do
46+
repository "#{node[:ocax][:gitrepo_uri]}"
47+
reference "master"
48+
action :sync
6549
end
6650

6751
# Download Yii framework latest (ocax dependency)
@@ -131,11 +115,6 @@
131115
sql { ::File.open("#{node[:ocax][:spanishbudget_download_cache]}").read }
132116
end
133117

134-
#execute "Import spanish budget" do
135-
# command "mysql -u#{node[:ocax][:mysql_user]} -p#{node[:ocax][:mysql_password]} #{node[:ocax][:mysql_dbname]} < }"
136-
# action :nothing
137-
#end
138-
139118
# Create config file
140119
template "#{node[:ocax][:installpath]}/protected/config/main.php" do
141120
source "ocax_main.php"

0 commit comments

Comments
 (0)