-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version. Hardcoded. Download then extract not yet working fully.
- Loading branch information
Showing
2 changed files
with
68 additions
and
4 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,19 @@ | ||
#!/bin/bash | ||
if [ -z "$1" ]; then | ||
echo "Usage: extract-magento.sh TARGET_MAGENTO_ROOT" | ||
exit 1 | ||
fi | ||
TARGET_MAGENTO_ROOT="$1" | ||
|
||
if [ -d "$TARGET_MAGENTO_ROOT" ]; then | ||
echo "Error: ${TARGET_MAGENTO_ROOT} folder already exists" | ||
exit 1 | ||
fi | ||
|
||
echo "Extracting Magento to: ${TARGET_MAGENTO_ROOT}" | ||
[ -d $HOME/tmp ] || mkdir -v $HOME/tmp | ||
[ ! -d $HOME/tmp/magento ] || rm -r $HOME/tmp/magento | ||
tar -C $HOME/tmp -xzf $HOME/dist/magento-bippo-1.6.2.0_1.tar.gz | ||
# Workaround | ||
chmod -c +x $HOME/tmp/magento/mage | ||
mv -v $HOME/tmp/magento "${TARGET_MAGENTO_ROOT}" |
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 |
---|---|---|
|
@@ -17,22 +17,57 @@ | |
|
||
$root = '/home/magento/sites/berbatik' | ||
$mysql_host = 'localhost' | ||
$mysql_user = 'berbatik_magento' | ||
$mysql_user = 'berbatik' | ||
$mysql_password = 'bippo' | ||
$mysql_dbname = 'berbatik_magento' | ||
$url = 'http://www.berbatik.com.vm/' | ||
$use_rewrites = 'yes' | ||
$secure_url = 'http://www.berbatik.com.vm/' | ||
$admin_firstname = 'Berbatik' | ||
$admin_lastname = 'Sysadmin' | ||
$admin_email = '[email protected]' | ||
$admin_email = '[email protected]' # [email protected] is not valid email, WTF? | ||
$admin_username = 'sysadmin' | ||
$admin_password = 'admin123' | ||
|
||
file { '/home/magento/scripts/extract-magento.sh': | ||
ensure => file, | ||
source => 'puppet:///modules/magento/extract-magento.sh', | ||
owner => magento, | ||
group => magento, | ||
mode => 0755, | ||
} | ||
|
||
if $install { | ||
|
||
# TODO: No download or install is need if Magento is already setup | ||
file { magento-dist: | ||
name => '/home/magento/dist', | ||
ensure => directory, | ||
owner => magento, | ||
group => magento, | ||
} | ||
exec { download-magento: | ||
cwd => '/home/magento/dist', | ||
creates => '/home/magento/dist/magento-bippo-1.6.2.0_1.tar.gz', | ||
command => 'wget http://192.168.66.17:8080/nexus/service/local/repositories/releases/content/id/co/bippo/commerce/magento-bippo/1.6.2.0_1/magento-bippo-1.6.2.0_1.tar.gz', | ||
path => ['/usr/local/bin', '/usr/bin'], | ||
logoutput => true, | ||
user => 'magento', | ||
require => File['magento-dist'], | ||
} | ||
exec { extract-magento: | ||
creates => '/home/magento/sites/berbatik', | ||
command => '/home/magento/scripts/extract-magento.sh /home/magento/sites/berbatik', | ||
logoutput => true, | ||
user => 'magento', | ||
environment => ['HOME=/home/magento'], | ||
require => [ Exec['download-magento'], File['/home/magento/scripts/extract-magento.sh'] ], | ||
} | ||
|
||
exec { install-magento: | ||
cwd => $root, | ||
creates => "${root}/app/etc/local.xml", | ||
path => '/usr/bin', | ||
path => ['/usr/local/bin', '/usr/bin'], | ||
command => "php -f install.php -- \ | ||
--license_agreement_accepted \"yes\" \ | ||
--locale \"id_ID\" \ | ||
|
@@ -55,8 +90,18 @@ | |
--admin_password \"${admin_password}\"", | ||
logoutput => true, | ||
user => 'magento', | ||
require => [Exec["setting-permissions"], Exec["create-magentodb-db"]], | ||
require => [ Exec['extract-magento'] ], | ||
#require => [Exec["setting-permissions"], Exec["create-magentodb-db"]], | ||
} | ||
|
||
file { '/home/magento/sites/berbatik/app/etc/local.xml': | ||
ensure => file, | ||
owner => magento, | ||
group => magento, | ||
mode => 0400, | ||
require => Exec['install-magento'], | ||
} | ||
|
||
} | ||
|
||
} |