@@ -40,43 +40,22 @@ Before we can start you need to match some prerequirements on your host machine.
40
40
41
41
1 . Please create this script somewhere in your path, it's just a wrapper
42
42
around our mkcloud script that will be mentioned later on again. We place
43
- it in general at /usr/local/bin/mkcloud6
43
+ it in general at /usr/local/bin/mkcloud7
44
44
45
45
``` bash
46
46
#! /usr/bin/env bash
47
47
48
- export pre_do_installcrowbar=$( base64 --wrap=0 << 'EOS '
49
- zypper ar -f http://dist.suse.de/install/SLP/SLE-12-SP1-SDK-LATEST/x86_64/DVD1/ sle12-sp1-sdk
50
- zypper -n in -l gcc ruby2.1-devel sqlite3-devel libxml2-devel;
51
-
52
- mkdir -p /opt/crowbar/crowbar_framework/db /opt/crowbar/barclamps;
53
-
54
- ln -sf /opt/dell/crowbar_framework/db/production.sqlite3 /opt/crowbar/crowbar_framework/db/development.sqlite3;
55
- EOS
56
- )
57
-
58
- export SHAREDVG=1
59
- export TESTHEAD=1
60
- export cloudsource=develcloud6
61
- export virtualcloud=l6
62
- export cloud=cloud6
63
- export net_fixed=192.168.116
64
- export net_public=192.168.96
65
- export net_admin=192.168.106
66
- export cephvolumenumber=0
48
+ export cloudsource=develcloud7
67
49
export nodenumber=2
68
- export vcpus=4
69
- export cloudvg=system
70
50
export user_keyfile=~ ${SUDO_USER} /.ssh/id_rsa.pub
71
- export adminvcpus=2
72
- export want_sles12=1
73
51
74
52
/usr/local/bin/mkcloud $@
75
53
```
76
54
77
55
2. At first you need a running mkcloud setup. For more information about this
78
56
read the [mkcloud](https://git.io/vYO2E) documentation. Please use the
79
- wrapper script created above to install Crowbar, e.g. `sudo mkcloud6 plain`.
57
+ wrapper script created above to install Crowbar, e.g. ` sudo mkcloud7 plain devsetup` .
58
+ the ` ` ` devsetup` ` ` step for ` ` ` mkcloud` ` ` is necessary to install the dependencies
80
59
81
60
3. You need some ruby environment on you workstation in order to execute some
82
61
rake tasks, so please install ` ` ` ruby` ` ` and ` ` ` bundler` ` ` first.
@@ -85,44 +64,71 @@ Before we can start you need to match some prerequirements on your host machine.
85
64
cloning, forking and updating all required repositories. Make sure to get
86
65
all the dependencies with ` ` ` bundle install` ` ` and use ` ` ` rake -T` ` ` to get
87
66
an overview about the rake tasks.
67
+ For the ` ` ` rake` ` ` tasks talk to the GitHub API you need to have a ` ` ` ~/.netrc` ` ` file
68
+ which looks like:
69
+
70
+ ```
71
+ machine api.github.com
72
+ login < GITHUB USERNAME>
73
+ password < API TOKEN>
74
+ ```
75
+
76
+ The GitHub API Token can be obtained from your GitHub settings in the Browser.
88
77
89
78
1. ` ` ` rake crowbar:init` ` ` will fork, clone and add the required remotes to the
90
79
required repositories defined within our [configuration](../config/barclamps.yml)
91
80
within [barclamps/](../barclamps/)
92
81
2. ` ` ` rake crowbar:update` ` ` will update the clones, this should be performed from time
93
82
to time to get the latest changes into your cloned repositories.
94
83
95
- 5. Now run Guard to sync your local git repos with the server, please execute
96
- ```GUARD_SYNC_HOST=192.168.106.10 bundle exec guard``` in a seperate
97
- terminal window as this process will stay in the foreground.
84
+ 5. Now run Guard to sync your local git repos with the server, please place this script in
85
+ ` /usr/local/bin/crowbar_guard`
98
86
99
- 6. Now ssh to the admin node and follow the steps below:
87
+ ` ` ` bash
88
+ #! /bin/bash
100
89
101
- 1. Change to ```/opt/crowbar/crowbar_framework```.
90
+ cloud=$1
91
+ target_folder=$2
92
+ guard_sync_port=$3
93
+
94
+ if [[ -z $1 ]] || [[ -z $2 ]] || [[ -z $3 ]]
95
+ then
96
+ echo " usage ./crowbar_guard cloudname targetfolder sshport"
97
+ echo " example: ./crowbar_guard crowbarc1 /opt/crowbar 22"
98
+ exit 1
99
+ fi
100
+
101
+ export GUARD_SYNC_PORT=$guard_sync_port
102
+ export GUARD_SYNC_HOST=$cloud
103
+ export GUARD_TREE_TARGET=$target_folder
104
+ export GUARD_SCRIPT_TARGET=$target_folder /bin
105
+
106
+ bundle exec guard --no-notify
107
+ ` ` `
102
108
103
- 2. Set a dedicated GEM_HOME for the dev environment to avoid clobbering the
104
- admin node's system gems:
109
+ and run it in a seperate terminal window as this process will stay in the foreground.
105
110
106
- ```
107
- export GEM_HOME=/tmp/crowbar-dev-gems
108
- ```
111
+ ** NOTE** : you have to run the script ** from the ` crowbar/crowbar` git clone** where the ` Guardfile` is located
109
112
110
- You will need to ensure this environment variable is set each time
111
- you run the Rails server (step 5). You can also omit this step entirely,
112
- but without it the development environment is likely to break the admin
113
- node's regular crowbar setup. Likewise, you need to make sure that
114
- `GEM_HOME` is unset if you wish to use your system's regular gems again.
113
+ 6. Now place the following script in ` /usr/local/bin/crowbar_rails`
115
114
116
- 3. Run ```bundle install```
115
+ ` ` ` bash
116
+ #! /bin/bash
117
117
118
- 4. Install all barclamps with this snippet
118
+ cloud=$1
119
+ port=$2
120
+ targetdir=$3
119
121
120
- ```bash
121
- COMPONENTS=$(find /opt/crowbar/barclamps -mindepth 1 -maxdepth 1 -type d)
122
- CROWBAR_DIR=/opt/crowbar RAILS_ENV=development bundle exec /opt/crowbar/bin/barclamp_install.rb $COMPONENTS
123
- ```
122
+ if [[ -z $1 ]] || [[ -z $2 ]] || [[ -z $3 ]]
123
+ then
124
+ echo " usage ./crowbar_rails cloudname targetdir"
125
+ echo " example: ./crowbar_rails crowbarc1 5000 /opt/crowbar"
126
+ exit 1
127
+ fi
124
128
125
- 5. Run the Rails server ```bundle exec bin/rails s -b 0.0.0.0 -p 5000```
129
+ ssh -t root@${cloud} " $targetdir /crowbar_framework/bin/rails s -b 0.0.0.0 -p $port "
130
+ ` ` `
126
131
132
+ and run it in a seperate terminal window as this process will stay in the foreground.
127
133
128
- 7. Now you can access you crowbar development setup via ```http://192.168.106.10 :5000```
134
+ 7. Now you can access you crowbar development setup via ` ` ` http://your.crowbar.instance :5000` ` `
0 commit comments