mno-enterprise 2.0.9 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +274 -11
  3. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 008ad4187ab05a27daf2109322a89fce704ffc37
4
- data.tar.gz: 85cf01be4ae9af85fd43d91007227029fedc5ece
3
+ metadata.gz: b1c9ee072c828333593ecaf937167f8782215411
4
+ data.tar.gz: e473a347f6a3a126767133749d49abc3b51dd01e
5
5
  SHA512:
6
- metadata.gz: f31fda64d58d2b045230866e714b7059634946ac20a11d1b85232eca927697c64bff440943ab6af5dedf8837f8983f1df00d2065d9f743616bb9dd1b08bcce69
7
- data.tar.gz: e9af197408cf79bf430cf217db59ae00fe8916e02c4d3a9e3c5b9b0149c46b5dde2a923ca69f854bb6b1bb7379d6149100e5b7d27a4bf5ee0d5d9d41d677393c
6
+ metadata.gz: 90207df0a4bcb7e166e79d89b42a0739f1a9c4a6257399d72464e7c30edd17d6da224350bab914382d0c51797ad4485613de744d76daf46763a7fa8519813573
7
+ data.tar.gz: b9fc298122dceeca57591753cedcb82222ca9647a10032503110452b743e78baff2ddf6e6f39aebdd54ad2c7c5bd44d3e3b6f99f114fc49f75d87904cb53059d
data/README.md CHANGED
@@ -1,20 +1,118 @@
1
- # mno-enterprise
2
- Maestrano Enterprise Engine
1
+ <p align="center">
2
+ <img src="https://raw.github.com/maestrano/maestrano-ruby/master/maestrano.png" alt="Maestrano Logo">
3
+ <br/>
4
+ <br/>
5
+ </p>
6
+
7
+ The Maestrano Enterprise Engine can be included in a Rails project to bootstrap an instance of Maestrano Enterprise Express.
8
+
9
+ The goal of this engine is to provide a base that you can easily extend with custom style or logic.
10
+
11
+ - - -
12
+
13
+ 1. [Install](#install)
14
+ 2. [Building the Frontend](#building-the-frontend)
15
+ 3. [Modifying the style - Theme Previewer](#modifying-the-style---theme-previewer)
16
+ 4. [Extending the Frontend](#extending-the-frontend)
17
+ 5. [Replacing the Frontend](#replacing-the-frontend)
18
+ 6. [Generating a database extension](#generating-a-database-extension)
19
+ 7. [Deploying](#deploying)
20
+ 1. [Deploy a Puma stack on EC2 via Webistrano/Capistrano](#deploy-a-puma-stack-on-ec2-via-webistranocapistrano)
21
+ 2. [Sample nginx config for I18n](#sample-nginx-config-for-i18n)
22
+ 3. [Health Checks](#health-checks)
23
+ 8. [Migrating from v2 to v3](#migrating-from-v2-to-v3)
24
+ 9. [Contributing](#contributing)
25
+
26
+ - - -
3
27
 
4
28
  ## Install
5
29
 
30
+ Create a new rails project:
31
+ ```ruby
32
+ rails new name-enterprise
33
+ ```
34
+
6
35
  Add mno-enterprise to your Gemfile. A 'mno-enterprise-deployer-token' (Github oauth token) must have been generated by the 'mno-enterprise-deployer' github account.
7
36
  ```ruby
8
37
  # Maestrano Enterprise Engine
9
- gem 'mno-enterprise', git: 'https://<mno-enterprise-deployer-token>:x-oauth-basic@github.com/maestrano/mno-enterprise.git'
38
+ gem 'mno-enterprise', git: 'https://<mno-enterprise-deployer-token>:x-oauth-basic@github.com/maestrano/mno-enterprise.git', branch: '3.0-dev'
10
39
  ```
11
40
 
12
41
  Run the install script
13
42
  ```bash
14
- $ rails g mno_enterprise:install
43
+ rails g mno_enterprise:install
44
+ ```
45
+
46
+ The install script will perform three things:
47
+ - Propose popular gems to install (e.g. Rspec)
48
+ - Generate an initializer for Maestrano Enterprise (config/initializers/mno_enterprise.rb)
49
+ - Install and build the mno-enterprise-angular frontend
50
+ - Install and build the admin dashboard frontend
51
+ - Create a /frontend directory in your application for all frontend customisations/overrides
52
+
53
+ **Manual Node setup (optional):**
54
+ Building the frontend requires you to have nodejs and gulp install. While the rake task will attempt to install these dependencies, you may want to install these manually prior to running the install task. See the [nodejs website](https://nodejs.org/en/) for intructions on how to install node on your machine.
55
+
56
+ Once node is installed, you can run the following commands to ensure that all dependencies are installed:
57
+ ```bash
58
+ npm install -g bower gulp gulp-util gulp-load-plugins del gulp-git phantomjs
15
59
  ```
16
60
 
17
- ## Generate a database extension
61
+ ## Building the frontend
62
+ The Maestrano Enterprise frontend is a Single Page Application (SPA) that is separate from the Rails project. The source code for this frontend can be found on the [mno-enterprise-angular Github repository](https://github.com/maestrano/mno-enterprise-angular)
63
+
64
+ Build the frontend by running the following command:
65
+ ```bash
66
+ bundle exec rake mnoe:frontend:dist
67
+ ```
68
+ This will create a "dashboard" directory under the /public folder with the compiled frontend.
69
+
70
+ Building the frontend is only required if you modify the CSS and/or JavaScripts files under /frontend.
71
+
72
+ ## Modifying the style - Theme Previewer
73
+ The Maestrano Enterprise Express frontend is bundled with a Theme Previewer allowing you to easily modify and save the style of an Express instance without reloading the page.
74
+
75
+ The Theme Previewer is available by accessing the following path: /dashboard/theme-previewer.html
76
+ ```
77
+ e.g.: http://localhost:7000/dashboard/theme-previewer.html
78
+ ```
79
+
80
+ Under the hood this Theme Previewer will modify the LESS files located under the /frontend directory.
81
+
82
+ Two types of "save" actions are available in the Theme Previewer.
83
+
84
+ **Save:**
85
+ This action will temporarily save the current style in /frontend/src/app/stylesheets/theme-previewer-tmp.less so as to keep it across page reloads on the Theme Previewer only. This action will NOT publish the style, meaning that it will NOT apply the style to the /dashboard/index.html page.
86
+
87
+ **Publish:**
88
+ This action will save the current style in /frontend/src/app/stylesheets/theme-previewer-published.less and rebuild the whole frontend. This action WILL publish the style, meaning that it WILL apply the style to the /dashboard/index.html page.
89
+
90
+ ## Extending the Frontend
91
+ You can easily override or extend the Frontend by adding files to the /frontend directory. All files in this directory will be taken into account during the frontend build and will override the base files of the mno-enterprise-angular project.
92
+
93
+ Files in this folder MUST follow the [mno-enterprise-angular](https://github.com/maestrano/mno-enterprise-angular) directory structure. For example, you can override the application layout by creating /frontend/src/app/views/layout.html in your project - it will override the original src/app/views/layout.yml file of the mno-enterprise-angular project.
94
+
95
+ You can also add new files to this directory such as adding new views. This allows you to easily extend the current frontend to suit your needs.
96
+
97
+ While extending the frontend, you can run this command to start the frontend using gulp serve and automatically override the original files with the ones in the frontend folder:
98
+ ```bash
99
+ foreman start -f Procfile.dev
100
+ ```
101
+
102
+ This will accelerate your development as the gulp serve task use BrowserSync to reload the browser any time a file is changed.
103
+
104
+ ## Replacing the Frontend
105
+
106
+ In some cases you may decide that the current [mno-enterprise-angular](https://github.com/maestrano/mno-enterprise-angular) frontend is not appropriate at all.
107
+
108
+ In this case we recommend cloning or copying the [mno-enterprise-angular](https://github.com/maestrano/mno-enterprise-angular) repository in a new repository so as to keep the directory structure and build (Gulp) process. From there you can completely change the frontend appearance to fit your needs.
109
+
110
+ Once done you can replace the frontend source by specifying your frontend github repository in the /bower.json file. You can then build it by running the usual:
111
+ ```bash
112
+ bundle exec rake mnoe:frontend:dist
113
+ ```
114
+
115
+ ## Generating a database extension
18
116
 
19
117
  If you want to add fields to existing models, you can create a database extension for it.
20
118
 
@@ -28,8 +126,12 @@ eg:
28
126
  rails g mno_enterprise:database_extension Organization growth_type:string
29
127
  ```
30
128
 
129
+ ## Deploying
130
+
131
+ ### Deploy a Puma stack on EC2 via Webistrano/Capistrano
132
+
133
+ **IMPORTANT NOTE:** These are legacy instructions. They will soon be replaced by Docker instructions.
31
134
 
32
- ## Deploy a Puma stack on EC2 via Webistrano/Capistrano
33
135
  First, prepare your server. You will find a pre-made AMI on our AWS accounts called "AppServer" or "Rails Stack" that you can use.
34
136
 
35
137
  Then, setup your new project via webistrano/capistrano.
@@ -52,9 +154,170 @@ This script will setup a bunch of symlinks for nginx, upstart and monit pointing
52
154
 
53
155
  That's it. You should be done!
54
156
 
55
- ## Loader gif Reference
56
- **bg-main** - mno_enterprise/loader-32x32-bg-main.gif
57
- http://spiffygif.com/?color=ebe5ff&lines=8&bgColor=aeb5bf&length=4&radius=7&width=4&halo=false
157
+ ### Sample nginx config for I18n
158
+
159
+ We need to accept URIs like `/en/dashboard` and serve `public/dashboard/index.html`.
160
+ A simple combination of location regex and try_files does the trick.
161
+
162
+ ```
163
+ server {
164
+ listen 80;
165
+ server_name mnoe.mno.local;
166
+
167
+ root /apps/<%= app_name %>/current/public;
168
+ index index.html index.htm;
169
+
170
+ location ~* "^/[A-Za-z]{2}/dashboard(.*)" {
171
+ try_files /dashboard$1/index.html /dashboard$1.html /dashboard$1 @backend;
172
+ }
173
+
174
+ try_files $uri/index.html $uri.html $uri @backend;
175
+ ```
176
+
177
+ ### Health Checks
178
+
179
+ There are various endpoints to perform health checks:
180
+
181
+ `/mnoe/ping`: A simple check to see that the app is up. Returns `{status: 'Ok'}`
182
+
183
+ `/mnoe/version`: Version check. It will returns the version of the different components (app & mnoe gem):
184
+ ```json
185
+ {
186
+ "app-version": "9061048-6811c4a",
187
+ "mno-enterprise-version": "0.0.1",
188
+ "env": "test"
189
+ }
190
+ ```
191
+
192
+ `/mnoe/health_check` & `/mnoe/health_check/full`: Complete health check (cache, smtp, database, ...). See [health_check](https://github.com/ianheggie/health_check)
193
+
194
+ ## Migrating from v2 to v3
195
+
196
+ ### a) Upgrade the gem
197
+ First switch to a new branch such as v2-to-v3.
198
+ ```bash
199
+ git co -b v2-to-v3
200
+ ```
201
+
202
+ Open your Gemfile and ensure that your project points to the v3.0-dev of Maestrano Enterprise. You gemfile should look like this:
203
+ ```ruby
204
+ gem 'mno-enterprise', git: 'https://some-token:x-oauth-basic@github.com/alachaum/mno-enterprise.git', branch: 'v3.0-dev'
205
+ ```
206
+
207
+ Then update the gem by running
208
+ ```bash
209
+ bundle update mno-enterprise
210
+ ```
211
+
212
+ Ensure you've got node installed on your system. Some googling will surely provide you with the steps required to install Node on your machine.
213
+
214
+ Rerun the Maestrano Enterprise task in your project. This task will download and compile the enterprise angular frontend.
215
+ ```bash
216
+ bundle exec rake mno_enterprise:install
217
+ ```
218
+
219
+ After running this task a new "/frontend" directory will have appeared in the root of your project. This folder will contain any customization you want to make the frontend. It should already contain a few LESS files with a default theme.
220
+
221
+ ### b) Reapply your style
222
+
223
+ The way styling and frontend customisations are handled by the platform has changed. Everything is now located under the "/frontend" directory.
224
+
225
+ In order to migrate your style, follow these instructions:
226
+
227
+ - Copy the content of your /app/assets/stylesheets/theme.less.erb into /frontend/src/app/stylesheets/theme.less. Replace any ERB variable by the actual LESS value
228
+ - Delete /app/assets/stylesheets/theme.less.erb
229
+ - Copy the content of your /app/assets/stylesheets/variables.less into /frontend/src/app/stylesheets/variables.less.
230
+ - Delete /app/assets/stylesheets/variables.less
231
+ - Create the file: /app/assets/stylesheets/main.less and copy the following content to it:
232
+ ```less
233
+ /*-----------------------------------------------------------------------*/
234
+ /* Import Core LESS Framework */
235
+ /*-----------------------------------------------------------------------*/
236
+ // Import Core LESS Framework
237
+ @import "mno_enterprise/main";
238
+
239
+ /*-----------------------------------------------------------------------*/
240
+ /* Customization */
241
+ /*-----------------------------------------------------------------------*/
242
+
243
+ // Import theme colors
244
+ //--------------------------------------------
245
+ @import "../../../frontend/src/app/stylesheets/theme";
246
+
247
+ // Import custom variables
248
+ //--------------------------------------------
249
+ @import "../../../frontend/src/app/stylesheets/variables";
250
+
251
+ // Import theme published by Theme Previewer
252
+ //--------------------------------------------
253
+ // @import "../../../frontend/src/app/stylesheets/theme-previewer-published.less";
254
+
255
+ // Import any custom less file below
256
+ //--------------------------------------------
257
+ // @import 'homepage'
258
+ ```
259
+ - Copy any CSS customization you have made in main.less.erb to main.less
260
+ - Rebuild the frontend with your style
261
+ ```bash
262
+ rake mnoe:frontend:dist
263
+ ```
264
+ - Copy your logo in /app/assets/images/mno_enterprise/main-logo.png to /public/dashboard/images/main-logo.png
265
+
266
+ Launch your application, your style should now be reapplied.
267
+
268
+ ### c) Caveat: Impac! endpoint
269
+
270
+ The v3 is currently being finalised. There are some minor configuration options that still need to be implemented such as the "impact endpoint urls".
271
+
272
+ If deploying to UAT, the Impac! URLs need to be manually replaced. Search the "/public" directory for "http://localhost:4000" and replace by "https://api-impac-uat.maestrano.io". Save the files and deploy.
273
+
274
+ ## Contributing
275
+
276
+ # Contributing to MnoEnterprise
277
+
278
+ We love pull requests from everyone. Here are some ways *you* can contribute:
279
+
280
+ * by using alpha, beta, and prerelease versions
281
+ * by reporting bugs
282
+ * by suggesting new features
283
+ * by writing or editing documentation
284
+ * by writing specifications
285
+ * by writing code ( **no patch is too small** : fix typos, add comments, clean up inconsistent whitespace )
286
+ * by refactoring code
287
+ * by closing [issues][]
288
+ * by reviewing patches
289
+
290
+ [issues]: https://github.com/maestrano/mno-enterprise/issues
291
+
292
+ ## Submitting an Issue
293
+ We use the [GitHub issue tracker][issues] to track bugs and features. Before
294
+ submitting a bug report or feature request, check to make sure it hasn't
295
+ already been submitted. When submitting a bug report, please include a [Gist][]
296
+ that includes a stack trace and any details that may be necessary to reproduce
297
+ the bug, including your gem version, Ruby version, and operating system.
298
+ Ideally, a bug report should include a pull request with failing specs.
299
+
300
+ [gist]: https://gist.github.com/
301
+
302
+ ## Submitting a Pull Request
303
+ 1. [Fork][fork] the [official repository][repo].
304
+ 2. [Create a topic branch.][branch]
305
+ 3. Write tests for your feature/bug.
306
+ 3. Implement your feature or bug fix.
307
+ 4. Run the specs with:
308
+ ```bash
309
+ bundle exec rake test
310
+ ```
311
+ 4. Add, commit, and push your changes.
312
+ 5. [Submit a pull request.][pr]
313
+
314
+ ## Notes
315
+ * Please add tests if you changed code. Contributions without tests won't be accepted.
316
+ * Please don't update the Gem version.
317
+
318
+ [repo]: https://github.com/maestrano/mno-enterprise/tree/master
319
+ [fork]: https://help.github.com/articles/fork-a-repo/
320
+ [branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
321
+ [pr]: https://help.github.com/articles/using-pull-requests/
58
322
 
59
- **bg-inverse** - mno_enterprise/loader-32x32-bg-inverse.gif
60
- http://spiffygif.com/?color=977bf0&lines=8&length=4&radius=7&width=4&halo=false
323
+ Inspired by https://github.com/thoughtbot/factory_girl/blob/master/CONTRIBUTING.md
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mno-enterprise
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-05 00:00:00.000000000 Z
12
+ date: 2016-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mno-enterprise-core
@@ -17,42 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 2.0.9
20
+ version: 3.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 2.0.9
27
+ version: 3.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mno-enterprise-api
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 2.0.9
34
+ version: 3.0.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 2.0.9
41
+ version: 3.0.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: mno-enterprise-frontend
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 2.0.9
48
+ version: 3.0.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 2.0.9
55
+ version: 3.0.0
56
56
  description: Maestrano Enterprise is your application marketplace, out of the box.
57
57
  email:
58
58
  - developers@maestrano.com
@@ -66,7 +66,7 @@ files:
66
66
  - lib/mno_enterprise/all.rb
67
67
  homepage: https://maestrano.com
68
68
  licenses:
69
- - Apache-2.0
69
+ - Maestrano Enterprise License V1
70
70
  metadata: {}
71
71
  post_install_message:
72
72
  rdoc_options: []
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.4.8
87
+ rubygems_version: 2.2.2
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Maestrano Enterprise