forked from ianychoi/openstack-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_site.sh
More file actions
executable file
·36 lines (36 loc) · 1.28 KB
/
init_site.sh
File metadata and controls
executable file
·36 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
sudo apt-get update;
sudo apt-get install -y nodejs;
sudo rm -R vendor;
sudo rm -R node_modules;
sudo rm -R themes/openstack/bower_assets;
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === 'fd26ce67e3b237fffd5e5544b45b0d92c41a4afe3e3f778e942e43ce6be197b9cdc7c251dcde6e2a52297ea269370680') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); }"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo npm install -g n;
sudo n latest;
echo "installing webpack ...";
sudo npm install -g webpack;
echo "installing bower ...";
sudo npm install -g bower;
echo "installing composer dependencies ...";
php composer.phar install --prefer-dist
php composer.phar dump-autoload --optimize
mkdir -p assets
sudo chmod 775 assets;
mkdir -p silverstripe-cache
sudo chmod 775 silverstripe-cache;
ln -sfn $PWD/private-assets/themes/openstack/images $PWD/themes/openstack/images;
if [ -f "package.json" ]; then
sudo npm install;
fi
if [ -f "bower.json" ]; then
bower install --allow-root --config.interactive=false
fi
if [ -f "webpack.config.js" ]; then
webpack;
fi
sudo ./framework/sake installsake;
sake dev/build;
sake dev/tasks/DBMigrateTask;