File tree 5 files changed +1256
-1
lines changed
Filter options
5 files changed +1256
-1
lines changed
Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
node_modules
3
- package-lock.json
4
3
.github2rangerc
Original file line number Diff line number Diff line change
1
+ FROM node:10
2
+ WORKDIR /usr/src/github2range
3
+ COPY package*.json ./
4
+ RUN npm install
5
+ COPY lib/* ./lib/
6
+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change @@ -69,6 +69,25 @@ locations:
69
69
- ` /etc/github2rangerc `
70
70
- ` /etc/github2range/config `
71
71
72
+ ## Docker
73
+
74
+ This repository provides a ` Dockerfile ` which can be used to execute ` github2range ` . You can
75
+ customize the Dockerfile and copy over a config file to one of the above locations, or you can pass
76
+ configuration options to docker via environment variables. For example:
77
+
78
+ ``` bash
79
+ docker build -t github2range .
80
+ docker run \
81
+ --env github2range_githubAccessToken=XXXXXXXX \
82
+ --env github2range_rangeWebhook=https://in.range.co/services/incoming/XXXXXXXX \
83
+ --env github2range_users__catboy=conner@pjmasks.com \
84
+ --env github2range_users__owlette=amaya@pjmasks.com \
85
+ --env github2range_users__ghlogin=email@company.com \
86
+ github2range
87
+ ```
88
+
89
+ A prebuilt is available on Docker hub at [ pupius/github2range] ( https://hub.docker.com/r/pupius/github2range ) .
90
+
72
91
## FAQ
73
92
74
93
### How do I get a GitHub access token?
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ const cfg = rc('github2range', {
36
36
37
37
colors . setTheme ( cfg . colors ) ;
38
38
39
+ validateConfig ( ) ;
40
+
39
41
// We use Octokit to access GitHub REST APIS. See https://octokit.github.io/rest.js/ for docs.
40
42
const client = octokit ( {
41
43
userAgent : `github2range/${ pkg . version } ` ,
@@ -218,3 +220,14 @@ function emailHash(email) {
218
220
shasum . update ( email ) ;
219
221
return shasum . digest ( 'hex' ) ;
220
222
}
223
+
224
+ function validateConfig ( ) {
225
+ if ( ! cfg . githubAccessToken ) exit ( 'githubAccessToken not specified' ) ;
226
+ if ( ! cfg . rangeWebhook ) exit ( 'rangeWebhook not specified' ) ;
227
+ if ( Object . values ( cfg . users ) . length === 0 ) exit ( 'no users configured' ) ;
228
+ }
229
+
230
+ function exit ( msg ) {
231
+ console . error ( `ERROR: ${ msg } \n` . error ) ;
232
+ process . exit ( 1 ) ;
233
+ }
You can’t perform that action at this time.
0 commit comments