add grunt cut task

This commit is contained in:
ShareLaTeX 2016-06-09 11:36:00 +00:00
parent 2870b6a460
commit dad3a74a7f
3 changed files with 11 additions and 2 deletions

View file

@ -1,2 +1,3 @@
node_modules/ node_modules/
api-data api-data
versions/

View file

@ -3,6 +3,7 @@ services = require('./services')
module.exports = (grunt) -> module.exports = (grunt) ->
tag = grunt.option("tag") or 'latest' tag = grunt.option("tag") or 'latest'
to = grunt.option("to") or 'latest'
repos = [] repos = []
for service in services for service in services
url = service.repo.split('/') url = service.repo.split('/')
@ -29,10 +30,16 @@ module.exports = (grunt) ->
src: repos src: repos
dest: 'versions/' + tag + '.json' dest: 'versions/' + tag + '.json'
rename:
main:
files: [{ src: ['versions/latest.json'], dest: 'versions/' + to + '.json'}]
grunt.loadNpmTasks 'grunt-docker-io' grunt.loadNpmTasks 'grunt-docker-io'
grunt.loadNpmTasks 'grunt-github-api' grunt.loadNpmTasks 'grunt-github-api'
grunt.loadNpmTasks 'grunt-contrib-rename'
grunt.registerTask 'build', ['docker_io', 'github'] grunt.registerTask 'build', ['docker_io', 'github']
grunt.registerTask 'gitrev', ['github'] grunt.registerTask 'gitrev', ['github']
grunt.registerTask 'cut', ['rename']
grunt.registerTask 'default', ['build'] grunt.registerTask 'default', ['build']

View file

@ -4,8 +4,9 @@
"description": "none", "description": "none",
"dependencies": { "dependencies": {
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-contrib-rename": "0.0.3",
"grunt-docker-io": "^0.7.0", "grunt-docker-io": "^0.7.0",
"simple-git": "^1.32.1", "grunt-github-api": "^0.2.3",
"grunt-github-api": "^0.2.3" "simple-git": "^1.32.1"
} }
} }