-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
39 lines (32 loc) · 1.08 KB
/
index.js
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
'use strict'
const crypto = require('crypto')
const dockerPrepare = require('./lib/prepare.js')
const dockerVerify = require('./lib/verify.js')
const dockerPublish = require('./lib/publish.js')
const buildConfig = require('./lib/build-config.js')
const dockerSuccess = require('./lib/success.js')
const dockerFail = require('./lib/fail.js')
const build_id = crypto.randomBytes(10).toString('hex')
module.exports = {
buildConfig
, fail
, prepare
, publish
, success
, verifyConditions
}
async function fail(config, context) {
return dockerFail(await buildConfig(build_id, config, context), context)
}
async function prepare(config, context) {
return dockerPrepare(await buildConfig(build_id, config, context), context)
}
async function publish(config, context) {
return dockerPublish(await buildConfig(build_id, config, context), context)
}
async function success(config, context) {
return dockerSuccess(await buildConfig(build_id, config, context), context)
}
async function verifyConditions(config, context) {
return dockerVerify(await buildConfig(build_id, config, context), context)
}