Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
feat(Deploy): pass backend URL to grunt dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Dec 21, 2015
1 parent b075741 commit 9664d0b
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 41 deletions.
110 changes: 73 additions & 37 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,15 @@ module.exports = (grunt) ->
force: true
recursive: true

replace:
root_url:
src: ['build/js/services/wallet.service.js'],
overwrite: true,
replacements: [{
from: 'setRootURL("/")'
to: () =>
'setRootURL("' + @rootUrl + '")'
}]

grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks('grunt-contrib-concat')
Expand All @@ -435,6 +444,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks('git-changelog')
grunt.loadNpmTasks('grunt-babel')
grunt.loadNpmTasks('grunt-karma-coveralls')
grunt.loadNpmTasks('grunt-text-replace')

grunt.registerTask "compile", ["coffee"]

Expand All @@ -457,43 +467,69 @@ module.exports = (grunt) ->
]

# Default task(s).
grunt.registerTask "dist", [
"shell:clean_bower_and_npm_cache"
"clean"
"shell:npm_install_dependencies"
"build"
"shell:check_dependencies"
"shell:npm_install_dependencies"
"shell:bower_install_dependencies"
"shell:check_pgp_signatures"
"concat:application_dependencies"
"uglify:application_dependencies"
"concat:application"
"concat_css:app"
"jade"
"preprocess"
"copy:main"
"rename:assets"
"rename:html"
"git_changelog"
]

grunt.registerTask "dist_unsafe", [
"shell:clean_bower_and_npm_cache"
"clean"
"shell:npm_install_dependencies"
"build"
"shell:skip_check_dependencies"
"concat:application_dependencies"
"uglify:application_dependencies"
"concat:application"
"concat_css:app"
"jade"
"preprocess"
"copy:main"
"rename:assets"
"rename:html"
]
grunt.registerTask "dist", (rootUrl) =>
grunt.task.run [
"shell:clean_bower_and_npm_cache"
"clean"
"shell:npm_install_dependencies"
"build"
]

if rootUrl
@rootUrl = rootUrl

console.log("Custom root URL: " + @rootUrl)

grunt.task.run [
"replace:root_url"
]

grunt.task.run [
"shell:check_dependencies"
"shell:npm_install_dependencies"
"shell:bower_install_dependencies"
"shell:check_pgp_signatures"
"concat:application_dependencies"
"uglify:application_dependencies"
"concat:application"
"concat_css:app"
"jade"
"preprocess"
"copy:main"
"rename:assets"
"rename:html"
"git_changelog"
]

grunt.registerTask "dist_unsafe", (rootUrl) =>
grunt.task.run [
"shell:clean_bower_and_npm_cache"
"clean"
"shell:npm_install_dependencies"
"build"
]

if rootUrl
@rootUrl = rootUrl

console.log("Custom root URL: " + @rootUrl)

grunt.task.run [
"replace:root_url"
]

grunt.task.run [
"shell:skip_check_dependencies"
"concat:application_dependencies"
"uglify:application_dependencies"
"concat:application"
"concat_css:app"
"jade"
"preprocess"
"copy:main"
"rename:assets"
"rename:html"
]

grunt.registerTask "deploy_static_to_dev", [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"angular-qr": "0.2.*",
"angular-translate": "2.7.*",
"angular-translate-loader-static-files": "2.7.*",
"angular-inview": "1.5.0",
"angular-inview": "1.5.*",
"angular-password-entropy": "0.1.*",
"browserdetection": "0.3.*",
"bc-qr-reader": "0.2.*",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"private": true,
"version": "0.0.0",
"description": "AngularJS front-end to My-Wallet-V3.",
"dependencies": {
},
"dependencies": {},
"devDependencies": {
"express": "^4.13.3",
"bower": "^1.3.1",
"coffee-script": "^1.9.1",
"ejs": "~0.8.4",
"express": "^4.13.3",
"git-changelog": "^0.1.8",
"grunt": "^0.4.5",
"grunt-autoprefixer": "^3.0.0",
Expand All @@ -33,6 +32,7 @@
"grunt-rename-assets": "0.0.1",
"grunt-shell": "^1.1.1",
"grunt-surround": "^0.1.0",
"grunt-text-replace": "^0.4.0",
"isparta": "^3.0.4",
"istanbul": "^0.3.19",
"jade": "*",
Expand Down

0 comments on commit 9664d0b

Please sign in to comment.