2016-04-20 20:55:47 -04:00
|
|
|
services = require('./services')
|
|
|
|
|
|
|
|
module.exports = (grunt) ->
|
|
|
|
|
|
|
|
tag = grunt.option("tag") or 'latest'
|
2016-06-09 07:36:00 -04:00
|
|
|
to = grunt.option("to") or 'latest'
|
2016-04-20 20:55:47 -04:00
|
|
|
repos = []
|
|
|
|
for service in services
|
|
|
|
url = service.repo.split('/')
|
|
|
|
owner = url[3]
|
|
|
|
repo = url[4].replace('.git','')
|
|
|
|
repos.push "/repos/#{owner}/#{repo}/git/refs/heads/#{service.version}"
|
|
|
|
|
|
|
|
grunt.initConfig
|
|
|
|
docker_io:
|
|
|
|
default_options:
|
|
|
|
options:
|
|
|
|
dockerFileLocation: '.'
|
|
|
|
buildName: 'sharelatex'
|
|
|
|
tag: grunt.option('tag') or 'latest'
|
|
|
|
push: grunt.option('push') or false
|
|
|
|
force: true
|
|
|
|
|
|
|
|
github:
|
|
|
|
combinedRevisions:
|
|
|
|
options:
|
|
|
|
#oAuth:
|
|
|
|
# access_token: ''
|
|
|
|
concat: true
|
|
|
|
src: repos
|
2016-05-23 07:39:06 -04:00
|
|
|
dest: 'versions/' + tag + '.json'
|
2016-04-20 20:55:47 -04:00
|
|
|
|
2016-06-09 07:36:00 -04:00
|
|
|
rename:
|
|
|
|
main:
|
|
|
|
files: [{ src: ['versions/latest.json'], dest: 'versions/' + to + '.json'}]
|
|
|
|
|
2016-04-20 20:55:47 -04:00
|
|
|
grunt.loadNpmTasks 'grunt-docker-io'
|
|
|
|
grunt.loadNpmTasks 'grunt-github-api'
|
2016-06-09 07:36:00 -04:00
|
|
|
grunt.loadNpmTasks 'grunt-contrib-rename'
|
2016-04-20 20:55:47 -04:00
|
|
|
|
|
|
|
grunt.registerTask 'build', ['docker_io', 'github']
|
|
|
|
grunt.registerTask 'gitrev', ['github']
|
2016-06-09 07:36:00 -04:00
|
|
|
grunt.registerTask 'cut', ['rename']
|
2016-04-20 20:55:47 -04:00
|
|
|
|
|
|
|
grunt.registerTask 'default', ['build']
|