forked from airtonix/concourse-resource-samba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJakefile.coffee
68 lines (59 loc) · 1.67 KB
/
Jakefile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# // "test:in": "cat ./test/in.request.json | docker-compose run test /test/run in /mnt/in",
# // "test:out": "cat ./test/out.request.json | docker-compose run test /test/run out /mnt/out",
# // "test:check": "cat ./test/in.request.json | docker-compose run test /test/run check /mnt/out"
{dirname} = require('path')
{SECRETS_HOME} = process.env;
PIPELINE_NAME = __dirname.split(/\/|\\/).pop()
jake.logger.log(PIPELINE_NAME)
task 'login', () ->
cmd = [
'fly login'
'--target main'
"--username #{process.env.CONCOURSE_USERNAME}"
"--password #{process.env.CONCOURSE_PASSWORD}"
].join(' ')
jake.exec cmd, {printStdout: true, interactive: true}, () ->
console.log('done')
complete()
task 'sync', () ->
cmd = [
'fly set-pipeline'
'--target main'
'--config ./pipeline.yml'
"--pipeline #{PIPELINE_NAME}"
'--non-interactive'
"--load-vars-from #{process.env.HOME}/.concourse/worker.yml"
].join(' ')
jake.exec cmd, {printStdout: true}, () ->
console.log('done')
complete()
task 'unpause', () ->
cmd = [
'fly unpause-pipeline'
'--target main'
"--pipeline #{PIPELINE_NAME}"
].join(' ')
jake.exec cmd, {printStdout: true}, () ->
console.log('done')
complete()
task 'trigger', (job) ->
cmd = [
'fly trigger-job'
'--target main'
"--job #{PIPELINE_NAME}/build"
].join(' ')
jake.exec cmd, {printStdout: true}, () ->
console.log('done')
complete()
task 'bump:rc', ->
complete()
task 'bump:patch', ->
complete()
task 'bump:minor', ->
complete()
task 'bump:major', ->
complete()
task 'patch', ['bump:patch', 'default']
task 'minor', ['bump:minor', 'default']
task 'major', ['bump:major', 'default']
task 'default', ['login', 'sync', 'unpause', 'trigger']