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

Commit

Permalink
Merge c3195ad into 8556d2c
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Dec 18, 2015
2 parents 8556d2c + c3195ad commit da377b3
Show file tree
Hide file tree
Showing 47 changed files with 628 additions and 2,191 deletions.
146 changes: 22 additions & 124 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = (grunt) ->
pkg: grunt.file.readJSON("package.json")
clean: {
build: ["build"]
dist: ["dist"]
dist: ["dist", "bower_components", "node_modules"]
test: ["coverage"]
sass: [".sass-cache"]
}
Expand All @@ -25,22 +25,11 @@ module.exports = (grunt) ->
options: {
context : {
PRODUCTION: true
BETA: false
}
},
expand: true
src: ['build/index.html']
dest: ''
beta:
options: {
context : {
PRODUCTION: true
BETA: true
}
},
expand: true
src: ['build/admin.html', 'build/index-beta.html']
dest: ''

concat:
options:
Expand Down Expand Up @@ -84,8 +73,7 @@ module.exports = (grunt) ->

application: # All components should first be minimized. Only trusted sources should be imported as minified..
src: [
'bower_components/blockchain-wallet/dist/my-wallet.min.js'
"build/bower_components/jquery/dist/jquery.js" # Duplicate; also included in my-wallet a.t.m. Minified version causes problems.
'build/bower_components/blockchain-wallet/dist/my-wallet.min.js'
'build/bower_components/angular/angular.min.js'
'build/bower_components/angular-sanitize/angular-sanitize.min.js'
'build/bower_components/angular-cookies/angular-cookies.min.js'
Expand All @@ -94,17 +82,7 @@ module.exports = (grunt) ->
'build/application-dependencies.min.js'
]

dest: "dist/application.min.js"

beta:
src: [
"build/bower_components/jquery/dist/jquery.js"
"build/bower_components/angular/angular.min.js"
"build/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"
"build/bower_components/bootstrap/dist/js/bootstrap.min.js"
"app/admin.js"
]
dest: "dist/beta-admin.js"
dest: "dist/js/application.min.js"

coffee:
coffee_to_js:
Expand Down Expand Up @@ -139,15 +117,8 @@ module.exports = (grunt) ->
"build/css/blockchain.css" # Needs to be loaded first
"build/css/**/*.css"
],
dest: "dist/application.css"
},
beta: {
src: [
"build/css/blockchain.css"
"build/css/navigation.css"
],
dest: "dist/beta-admin.css"
},
dest: "dist/css/application.css"
}
},

autoprefixer: {
Expand Down Expand Up @@ -201,8 +172,7 @@ module.exports = (grunt) ->
main:
files: [
{src: ["beep.wav"], dest: "dist/"}
{src: ["index.html", "index-beta.html"], dest: "dist/", cwd: "build", expand: true}
{src: ["admin.html"], dest: "dist/", cwd: "build", expand: true}
{src: ["index.html"], dest: "dist/", cwd: "build", expand: true}
{src: ["img/*"], dest: "dist/", cwd: "build", expand: true}
{src: ["locales/*"], dest: "dist/", cwd: "build", expand: true}
{src: ["**/*"], dest: "dist/fonts", cwd: "build/fonts", expand: true}
Expand All @@ -216,7 +186,6 @@ module.exports = (grunt) ->

css:
files: [
{src: ["intlTelInput.css"], dest: "build/css", cwd: "bower_components/intl-tel-input/build/css", expand: true }
{src: ["font-awesome.min.css"], dest: "build/css", cwd: "bower_components/fontawesome/css", expand: true }
{src: ["*.css"], dest: "build/css", cwd: "assets/css", expand: true }
]
Expand All @@ -228,15 +197,6 @@ module.exports = (grunt) ->
{src: ["*"], dest: "build/fonts", cwd: "assets/fonts/themify", expand: true}

]
beta:
files: [
{src: ["beta/betaAdminServer.js"], dest: "dist/", cwd: "app", expand: true}
{src: ["beta/package.json"], dest: "dist/", cwd: "app", expand: true}
]

beta_index:
src: "build/index.html"
dest: "build/index-beta.html"

images:
files: [
Expand Down Expand Up @@ -280,7 +240,6 @@ module.exports = (grunt) ->
options:
client: false
files:
"build/admin.html": "app/admin.jade"
"build/index.html": "app/index.jade"

babel:
Expand All @@ -295,7 +254,7 @@ module.exports = (grunt) ->
}]

rename:
assets: # Renames all images, fonts, etc and updates application.min.js, application.css and admin.html with their new names.
assets: # Renames all images, fonts, etc and updates application.min.js and application.css with their new names.
options:
skipIfHashed: true
startSymbol: "{{"
Expand All @@ -322,7 +281,7 @@ module.exports = (grunt) ->

publicdir = require("fs").realpathSync("dist")
path = require("path")
for referring_file_path in ["dist/application.min.js", "dist/beta-admin.js", "dist/application.css", "dist/beta-admin.css", "dist/admin.html", "dist/index.html", "dist/index-beta.html"]
for referring_file_path in ["dist/js/application.min.js", "dist/css/application.css", "dist/index.html"]
contents = grunt.file.read(referring_file_path)
before = undefined
after = undefined
Expand All @@ -347,7 +306,7 @@ module.exports = (grunt) ->
'dist/beep.wav'
]

html: # Renames application/beta.min.js/css and updates index/admin.html
html: # Renames application.min.js/css and updates index.html
options:
skipIfHashed: true
startSymbol: "{{"
Expand All @@ -359,7 +318,7 @@ module.exports = (grunt) ->
publicdir = require("fs").realpathSync("dist")
path = require("path")

for referring_file_path in ["dist/index.html", "dist/index-beta.html", "dist/admin.html"]
for referring_file_path in ["dist/index.html"]
contents = grunt.file.read(referring_file_path)
before = undefined
after = undefined
Expand All @@ -375,13 +334,15 @@ module.exports = (grunt) ->

files:
src: [
'dist/application.min.js'
'dist/application.css'
'dist/beta-admin.js'
'dist/beta-admin.css'
'dist/js/application.min.js'
'dist/css/application.css'
]

shell:
clean_bower_and_npm_cache:
command: () ->
'bower cache clean && npm cache clean'

deploy_static_to_dev:
command: () ->
'rsync -rz --delete dist hd-dev@server:'
Expand All @@ -390,10 +351,6 @@ module.exports = (grunt) ->
command: () ->
'rsync -rz --delete server.js hd-dev@server:'

deploy_beta_to_dev:
command: () ->
'rsync -rz --delete node_modules/my-wallet-v3-beta-module hd-dev@server:node_modules/'

deploy_static_to_staging:
command: () ->
'rsync -rz --delete dist hd-staging@server:'
Expand All @@ -402,22 +359,6 @@ module.exports = (grunt) ->
command: () ->
'rsync -rz --delete server.js hd-staging@server:'

deploy_beta_to_staging:
command: () ->
'rsync -rz --delete node_modules/my-wallet-v3-beta-module hd-staging@server:node_modules/'

deploy_static_to_alpha:
command: () ->
'rsync -rz --delete dist hd-alpha@server:'

deploy_server_to_alpha:
command: () ->
'rsync -rz --delete server.js hd-alpha@server:'

deploy_beta_to_alpha:
command: () ->
'rsync -rz --delete node_modules/my-wallet-v3-beta-module hd-alpha@server:node_modules/'

deploy_start_dev:
command: () ->
'ssh hd-dev@server "./start.sh"'
Expand All @@ -440,7 +381,7 @@ module.exports = (grunt) ->

npm_install_dependencies:
command: () ->
'cd build && npm install'
'npm install'

bower_install_dependencies:
command: () ->
Expand All @@ -462,7 +403,7 @@ module.exports = (grunt) ->
app_name : 'Blockchain HD Frontend',
# logo : 'https://raw.githubusercontent.com/blockchain/My-Wallet-HD-Frontend/changelog/assets/icons/png/logo.png',
intro : 'Recent changes'
grep_commits: '^fix|^feat|^ui|^copy|^docs|^dep|^refactor|^chore|^test|BREAKING'
grep_commits: '^fix|^feat|^ui|^copy|^docs|^dep|^refactor|^chore|^test|^dev|BREAKING'
repo_url: 'https://github.com/blockchain/My-Wallet-HD-Frontend'

coveralls:
Expand Down Expand Up @@ -513,14 +454,11 @@ module.exports = (grunt) ->
"watch"
]

grunt.registerTask "dist_beta", [
"concat:beta"
"concat_css:beta"
]

# 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"
Expand All @@ -531,30 +469,26 @@ module.exports = (grunt) ->
"concat:application"
"concat_css:app"
"jade"
"copy:beta_index"
"preprocess"
"copy:main"
"copy:beta"
"dist_beta" # We don't check beta dependencies against a whitelist
"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"
"copy:beta_index"
"preprocess"
"copy:main"
"copy:beta"
"dist_beta"
"rename:assets"
"rename:html"
]
Expand All @@ -570,15 +504,9 @@ module.exports = (grunt) ->
"shell:deploy_start_dev"
]

grunt.registerTask "deploy_beta_to_dev", [
"shell:deploy_beta_to_dev"
"shell:deploy_start_dev"
]

grunt.registerTask "deploy_to_dev", [
"dist"
"shell:deploy_static_to_dev"
"shell:deploy_beta_to_dev"
"shell:deploy_server_to_dev"
"shell:deploy_start_dev"
]
Expand All @@ -594,43 +522,13 @@ module.exports = (grunt) ->
"shell:deploy_start_staging"
]

grunt.registerTask "deploy_beta_to_staging", [
"shell:deploy_beta_to_staging"
"shell:deploy_start_staging"
]

grunt.registerTask "deploy_to_staging", [
"dist"
"shell:deploy_static_to_staging"
"shell:deploy_beta_to_staging"
"shell:deploy_server_to_staging"
"shell:deploy_start_staging"
]

grunt.registerTask "deploy_static_to_alpha", [
"dist"
"shell:deploy_static_to_alpha"
"shell:deploy_start_alpha"
]

grunt.registerTask "deploy_server_to_alpha", [
"shell:deploy_server_to_alpha"
"shell:deploy_start_alpha"
]

grunt.registerTask "deploy_beta_to_alpha", [
"shell:deploy_beta_to_alpha"
"shell:deploy_start_alpha"
]

grunt.registerTask "deploy_to_alpha", [
"dist"
"shell:deploy_static_to_alpha"
"shell:deploy_beta_to_alpha"
"shell:deploy_server_to_alpha"
"shell:deploy_start_alpha"
]

grunt.registerTask "check_translations", [
"shell:check_translations"
]
Expand Down
Loading

0 comments on commit da377b3

Please sign in to comment.