This repository has been archived by the owner on Mar 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basePublish.js
54 lines (48 loc) · 1.59 KB
/
basePublish.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import BaseRecipe from './baseRecipe'
import extend from 'extend'
/**
* This is the base for publish recipes using BuildControl
*/
export const Default = {
dir: 'build', // directory to assemble the files - make sure to add this to your .gitignore so you don't publish this to your source branch
source: {
types: ['javascripts', 'stylesheets'], // source types to resolve from preset and copy into the build directory pushing to the dist branch
files: ['.travis.yml', 'package.json', 'bower.json', 'LICENSE*', 'dist'] // any additional file patterns to copy to `dir`
/*
# NOTE: we need .travis.yml so that travis-ci will process the ignore branches
* add the following:
*
* # remove the dist branch and dist tags from travis builds
* branches:
* except:
* - dist
* - /^v(\d+\.)?(\d+\.)?(\*|\d+)$/
*/
},
watch: false,
presetType: 'macro',
options: { // see https://github.com/alienfast/build-control/blob/master/src/buildControl.js#L11
//cwd: 'build', // Uses recipe's dir
branch: 'dist',
tag: {
existsFailure: false
},
clean: {
before: true,
after: false
}
}
}
const BasePublish = class extends BaseRecipe {
/**
*
* @param gulp - gulp instance
* @param config - customized overrides
*/
constructor(gulp, preset, ...configs) {
super(gulp, preset, Default, ...configs)
// use the dir as the cwd to the BuildControl class
this.config.options = extend(true, {debug: this.config.debug, cwd: this.config.dir}, this.config.options)
}
}
export default BasePublish