forked from mturley/miqdev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·134 lines (107 loc) · 4.02 KB
/
setup
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/env bash
# Available options:
# --no-v2v-plugin (V2V dev repo is now installed by default)
# --mturley-remote (add the remote for mturley's v2v fork)
WD=`pwd`; SCRIPT=`realpath $0`; cd `dirname $SCRIPT`
echo "Checking for homebrew upgrades..."
brew upgrade
echo "Checking/installing homebrew dependencies..."
brew install git pkg-config memcached postgresql@10 cmake yarn gpg
echo 'export PATH="/usr/local/opt/postgresql@10/bin:$PATH"' >> ~/.bash_profile
# If using fish shell:
# echo 'set -x PATH $PATH /usr/local/opt/postgresql@10/bin/' >> ~/.config/fish/config.fish
# TODO install node and npm and setup webpack properly!!!!!!
# TODO use rbenv instead of rvm!
echo "Unlinking homebrew's xz if present to prevent conflicts with system xz libraries..."
brew unlink xz
echo "Checking/installing bundler..."
gem install bundler
echo "Checking/installing foreman..."
gem install foreman
echo "Updating npm..."
sudo npm install -g npm
echo "Checking/installing npm dependencies..."
sudo npm install -g bower yarn gulp-cli webpack webpack-dev-server
echo "Enabling PostgreSQL on boot..."
brew services start postgresql@10
echo "Creating the ManageIQ superuser..."
psql -d postgres -c "CREATE ROLE root SUPERUSER LOGIN PASSWORD 'smartvm'"
echo "Enabling Memcached on boot..."
ln -sfv /usr/local/opt/memcached/homebrew.mxcl.memcached.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist
printf "\n\n"
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
echo " That's it for non-npm dependencies. Here comes git! "
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -"
printf "\n"
echo "Cloning the manageiq and manageiq-ui-classic repositories..."
cd ..
git clone https://github.com/ManageIQ/manageiq.git
mkdir -p manageiq/plugins
cd manageiq/plugins
git clone https://github.com/ManageIQ/manageiq-ui-classic
if [ "$1" != "--no-v2v-plugin" ] ; then
echo "Cloning the manageiq-v2v repository..."
git clone https://github.com/ManageIQ/manageiq-v2v
echo "Setting up manageiq-v2v..."
cd manageiq-v2v
if [ "$1" = "--mturley-remote" ] ; then
git remote rename origin upstream
git remote add origin [email protected]:mturley/manageiq-v2v.git
git fetch origin
fi
# Note: this is where you'd want to switch branches if not using master.
# git checkout mikes-awesome-feature
yarn install
cd ../
fi
cd ../../ # plugins -> manageiq -> (parent)
echo "Creating/replacing manageiq/Procfile..."
cp -v miq_mac_dev/Procfile.example manageiq/Procfile
echo "Creating/replacing manageiq/bundler.d/Gemfile.dev.rb..."
mkdir -p manageiq/bundler.d
cp -v miq_mac_dev/Gemfile.dev.rb.example manageiq/bundler.d/Gemfile.dev.rb
echo "Setting up manageiq..."
cd manageiq
bundle config specific_platform true
bundle install
bin/setup
bin/update
cd ..
echo "Creating a symbolic link to local manageiq in manageiq-ui-classic/spec/manageiq..."
ln -sv ../../../ manageiq/plugins/manageiq-ui-classic/spec/manageiq
echo "Setting up manageiq-ui-classic..."
cd manageiq/plugins/manageiq-ui-classic
yarn install
bundle install
bin/setup
bin/update
bundle exec rake update:ui
echo "DONE! But don't forget to import your database, if you haven't already."
echo
echo "To start the manageiq rails server directly (foreground option 1):"
echo " miq_mac_dev/rails"
echo "or:"
echo " cd manageiq"
echo " bundle exec rails s"
echo
echo "To start manageiq with foreman (foreground option 2):"
echo " miq_mac_dev/foreman"
echo "or:"
echo " cd manageiq"
echo " foreman start -p 3000"
echo
echo "To start manageiq with evm (background option):"
echo " miq_mac_dev/evm"
echo "or:"
echo " cd manageiq"
echo " bundle exec rake evm:start"
echo
echo "Then navigate a browser to http://localhost:3000/ and log in with admin/smartvm."
echo
echo "For hot reloading, you'll need webpack. To start manageiq-ui-classic with webpack:"
echo " miq_mac_dev/webpack"
echo "or:"
echo " cd manageiq/plugins/manageiq-ui-classic"
echo " NODE_ENV=development ./node_modules/.bin/webpack-dev-server --config config/webpack/development.js"
cd $WD