... | ... | @@ -6,9 +6,9 @@ To transition your app to the OOD infrastructure, your app must be compatible wi |
|
|
|
|
|
To upgrade to the AweSim appkit v1.0, please see the [guide](Port-an-existing-app-to-AppKit-1.0).
|
|
|
|
|
|
#### Update Rails
|
|
|
#### Update Rails 4.0.13 and other gems to work with Ruby 2.2
|
|
|
|
|
|
Due to changes in the OOD gems, OOD applications will need to have a _minimum_ Rails version of **`4.1.15`**, you can also update to the latest version of Rails **`4.2`**. Rails 5.0 is not yet supported.
|
|
|
Due to changes in the OOD gems, OOD applications will need to have a _minimum_ Rails version of **`4.0.13`**, you can also update to the latest version of Rails **`4.2`**. Rails 5.0 is not yet supported.
|
|
|
|
|
|
We will be replacing the `awesim_rails` gem with the `ood_appkit` gem, and updating the rest of the OOD dependencies to work with the latest version of OodAppkit.
|
|
|
|
... | ... | @@ -20,82 +20,77 @@ Do this through the dashboard web UI or via the shell on apps-test.awesim.org. |
|
|
|
|
|
#### 2. Update the `Gemfile`
|
|
|
|
|
|
##### Update Rails
|
|
|
|
|
|
Make these changes to your Gemfile (ignore `osc-vnc` and `redcarpet` if they are not in your Gemfile already):
|
|
|
|
|
|
```diff
|
|
|
-gem 'rails', '4.0.0'
|
|
|
+gem 'rails', '4.1.15' # Use the latest patch version
|
|
|
```
|
|
|
+gem 'rails', '4.0.13'
|
|
|
|
|
|
* **TODO: what happens if we run `bin/rake rails:update`**
|
|
|
-gem 'sass-rails', '~> 4.0.0'
|
|
|
+gem 'sass-rails', '4.0.2'
|
|
|
-gem 'bootstrap-sass', '~> 3.3.1'
|
|
|
+gem 'bootstrap-sass', '3.3.1.0'
|
|
|
|
|
|
For details, see:
|
|
|
-gem 'osc-machete', '~> 1.0.0'
|
|
|
-gem 'osc_machete_rails', '~> 1.0.0'
|
|
|
-gem 'osc-vnc', '~> 1.0.0'
|
|
|
+gem 'osc-machete', '~> 1.2.0'
|
|
|
+gem 'osc_machete_rails', '~> 1.2.0'
|
|
|
+gem 'osc-vnc', '~> 1.1.0'
|
|
|
|
|
|
* http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-4-0-to-rails-4-1
|
|
|
-gem 'redcarpet', '~> 3.2.2'
|
|
|
+gem 'redcarpet', '~> 3.3.0'
|
|
|
|
|
|
##### Update `sass-rails`
|
|
|
-gem 'dotenv-rails', '~> 2.0.0'
|
|
|
+gem 'dotenv-rails', '~> 2.1', require: 'dotenv/rails-now'
|
|
|
|
|
|
```diff
|
|
|
-gem 'sass-rails', '4.0.2'
|
|
|
+gem 'sass-rails', '~> 5.0'
|
|
|
-gem 'awesim_rails', '~> 1.0.0'
|
|
|
-# gem 'awesim_rails', path: '/nfs/17/efranz/dev/awesim_rails'
|
|
|
-gem 'awesim_rails_logging', '~> 1.0.0'
|
|
|
+gem 'awesim_branding', :git => 'git@github.com:AweSim-OSC/awesim_branding.git', :tag => 'v1.0.0'
|
|
|
```
|
|
|
|
|
|
##### Update `bootstrap-sass`
|
|
|
* make sure to include `require: 'dotenv/rails-now` for the `dotenv` gem so that environment variables are set properly when running rake tasks; this is now important for app sharing as we include RAILS_RELATIVE_URL_ROOT in the dotenv file
|
|
|
* the osc-machete and osc_machete_rails gems are now on rubygems.org
|
|
|
* [awesim_branding](https://github.com/AweSim-OSC/awesim_branding) is a replacement for awesim_rails and adds [ood_appkit](https://github.com/OSC/ood_appkit/) as a dependency
|
|
|
* we remove `awesim_rails` and `awesim_rails_logging` gems, these are not supported on OOD
|
|
|
|
|
|
```diff
|
|
|
-gem 'bootstrap-sass', '3.3.1.0'
|
|
|
+gem 'bootstrap-sass', '~> 3.3'
|
|
|
```
|
|
|
|
|
|
##### Update `redcarpet`
|
|
|
#### 3. Replace references to `AwesimRails` with `OodAppkit`
|
|
|
|
|
|
OodAppkit dependency.
|
|
|
i.e. `AwesimRails.dataroot` is replaced by `OodAppkit.dataroot`. The easy way to do this is run these two commands and the do a git status to review the changes:
|
|
|
|
|
|
```diff
|
|
|
-gem 'redcarpet', '~> 3.2.2'
|
|
|
+gem 'redcarpet', '~> 3.3'
|
|
|
```
|
|
|
grep AwesimRails app -Rl | xargs sed -i 's/AwesimRails/OodAppkit/g'
|
|
|
grep AwesimRails config -Rl | xargs sed -i 's/AwesimRails/OodAppkit/g'
|
|
|
|
|
|
##### Use `require: 'dotenv/rails-now`
|
|
|
In Container Fill Sim, here is an example commit: https://github.com/AweSim-OSC/containerfillsim/pull/64/commits/5ee2a9f9289eccdc89782fa2d2cbd93dfa5d2bdd
|
|
|
|
|
|
OodAppkit requires environment variables to be set before Rails loads. Modify or add your 'dotenv-rails' gem as follows:
|
|
|
#### 4. Update documentation if you have it to use /wiki instead of /docs
|
|
|
|
|
|
```diff
|
|
|
+gem 'dotenv-rails', '~> 2.1', require: 'dotenv/rails-now'
|
|
|
```
|
|
|
1. Clone the docs to /wiki
|
|
|
|
|
|
##### Update OSC gems
|
|
|
# i.e. in Container Fill Sim our documentation is stored on the wiki on GitHub so we do
|
|
|
git clone git@github.com:AweSim-OSC/containerfillsim.git wiki
|
|
|
|
|
|
```diff
|
|
|
-gem 'osc-machete', '~> 1.0.0', :git => 'git@github.com:OSC/osc-machete.git', :tag => 'v1.0.1'
|
|
|
+gem 'osc-machete', '~> 1.2'
|
|
|
-gem 'osc_machete_rails', '~> 1.0.0', :git => 'git@github.com:OSC/osc_machete_rails.git', :tag => 'v1.0.1'
|
|
|
+gem 'osc_machete_rails', '~> 1.2'
|
|
|
-gem 'osc-vnc', '~> 1.0.0', :git => 'git@github.com:OSC/osc-vnc.git', :tag => 'v1.0.8'
|
|
|
+gem 'osc-vnc', '~> 1.1'
|
|
|
```
|
|
|
2. change the gitignore to hide /wiki
|
|
|
|
|
|
##### Add `ood_appkit` and `awesim_branding` gems
|
|
|
sed -i 's/\/docs/\/wiki/g' .gitignore
|
|
|
|
|
|
For details, see:
|
|
|
3. change the places in the app where we link to docs_path to link to wiki_path
|
|
|
|
|
|
* [ood_appkit](https://github.com/OSC/ood_appkit/) package of utility functions and engines for applications running on the Open OnDemand platform
|
|
|
grep docs_path app -Rl | xargs sed -i 's/docs_path/wiki_path/g'
|
|
|
|
|
|
* [awesim_branding](https://github.com/AweSim-OSC/awesim_branding) (optional) Replaces some AwesimRails helpers
|
|
|
|
|
|
```diff
|
|
|
+gem 'ood_appkit', '~> 0.3.0'
|
|
|
+gem 'awesim_branding', :git => 'git@github.com:AweSim-OSC/awesim_branding.git', :tag => 'v1.0.0'
|
|
|
```
|
|
|
In Container Fill Sim, here is an example commit: https://github.com/AweSim-OSC/containerfillsim/pull/64/commits/e48f1bfcb4f1af5e4f97e05843523e14789f236b
|
|
|
|
|
|
Note: if you do not wish to add the `awesim_branding` gem, you will need to update your application to use the application features in OodAppkit. See the [Diff Guide to removing the awesim_branding gem](https://github.com/AweSim-OSC/documentation/wiki/Port-an-existing-app-to-OOD#diff-guide-to-removing-the-awesim_branding-gem)
|
|
|
|
|
|
##### Remove `awesim_rails` and `awesim_rails_logging` gems, these are not supported on OOD
|
|
|
|
|
|
```diff
|
|
|
-gem 'awesim_rails', '~> 1.0.0', :git => 'git@github.com:AweSim-OSC/awesim_rails.git', :tag => 'v1.0.0'
|
|
|
-gem 'awesim_rails_logging', '~> 1.0.0', :git => 'git@github.com:AweSim-OSC/awesim_rails_logging.git', :tag => 'v1.0.0'
|
|
|
```
|
|
|
|
|
|
|
|
|
Note: if you do not wish to add the `awesim_branding` gem, you will need to update your application to use the application features in OodAppkit. See the [Diff Guide to removing the awesim_branding gem](https://github.com/AweSim-OSC/documentation/wiki/Port-an-existing-app-to-OOD#diff-guide-to-removing-the-awesim_branding-gem)
|
|
|
|
|
|
``
|
|
|
|
|
|
#### 3. Find all references to `AwesimRails` in the app code and modify to `OodAppkit`
|
|
|
|
... | ... | |