Skip to content

Commit 48a0008

Browse files
created deploy github-status
1 parent c6920fd commit 48a0008

File tree

4 files changed

+222
-0
lines changed

4 files changed

+222
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# misc
12+
/.sass-cache
13+
/connect.lock
14+
/coverage/*
15+
/libpeerconnection.log
16+
npm-debug.log*
17+
yarn-error.log
18+
testem.log
19+
20+
# ember-try
21+
.node_modules.ember-try/
22+
bower.json.ember-try
23+
package.json.ember-try

index.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use strict';
2+
3+
const GitHubApi = require('github');
4+
const DeployPluginBase = require('ember-cli-deploy-plugin');
5+
6+
module.exports = {
7+
name: 'ember-cli-deploy-github-deployments',
8+
createDeployPlugin(options) {
9+
var DeployPlugin = DeployPluginBase.extend({
10+
name: options.name,
11+
requiredConfig: ['publicURL', 'token', 'userOrOrganization', 'repo', 'commitSha'],
12+
13+
didDeploy(context) {
14+
return this.notifyPullRequestOfDeploy(context);
15+
},
16+
17+
notifyPullRequestOfDeploy(context) {
18+
let github = new GitHubApi();
19+
20+
github.authenticate({
21+
type: 'oauth',
22+
token: this.readConfig('token'),
23+
});
24+
25+
return new Promise((resolve, reject) => {
26+
github.repos.createStatus({
27+
owner: this.readConfig('userOrOrganization'),
28+
repo: this.readConfig('repo'),
29+
sha: this.readConfig('commitSha'),
30+
state: 'success',
31+
target_url: this.readConfig('publicURL'),
32+
context: 'ember-cli-deploy',
33+
}, (error, result) => {
34+
if (error) {
35+
reject(error);
36+
} else {
37+
resolve(result);
38+
}
39+
});
40+
});
41+
},
42+
});
43+
44+
return new DeployPlugin();
45+
},
46+
};

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "ember-cli-deploy-github-deployments",
3+
"version": "0.1.0",
4+
"description": "",
5+
"scripts": {},
6+
"repository": "https://github.com/aureliosaraiva/ember-cli-deploy-github-deployments",
7+
"engines": {
8+
"node": ">= 4.x.x"
9+
},
10+
"author": "Aurelio Saraiva",
11+
"license": "MIT",
12+
"keywords": [
13+
"ember-cli-deploy-plugin"
14+
],
15+
"dependencies": {
16+
"ember-cli-deploy-plugin": "^0.2.9",
17+
"github": "^9.2.0",
18+
"urlencode": "^1.1.0"
19+
},
20+
"ember-addon": {
21+
"configPath": "tests/dummy/config"
22+
}
23+
}

yarn.lock

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
agent-base@2:
6+
version "2.1.1"
7+
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7"
8+
dependencies:
9+
extend "~3.0.0"
10+
semver "~5.0.1"
11+
12+
ansi-regex@^2.0.0:
13+
version "2.1.1"
14+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
15+
16+
ansi-styles@^2.2.1:
17+
version "2.2.1"
18+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
19+
20+
chalk@^1.0.0, chalk@^1.1.3:
21+
version "1.1.3"
22+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
23+
dependencies:
24+
ansi-styles "^2.2.1"
25+
escape-string-regexp "^1.0.2"
26+
has-ansi "^2.0.0"
27+
strip-ansi "^3.0.0"
28+
supports-color "^2.0.0"
29+
30+
core-object@2.0.6:
31+
version "2.0.6"
32+
resolved "https://registry.yarnpkg.com/core-object/-/core-object-2.0.6.tgz#60134b9c40ff69b27bc15e82db945e4df782961b"
33+
dependencies:
34+
chalk "^1.1.3"
35+
36+
debug@2, debug@^2.2.0:
37+
version "2.6.8"
38+
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
39+
dependencies:
40+
ms "2.0.0"
41+
42+
ember-cli-deploy-plugin@^0.2.9:
43+
version "0.2.9"
44+
resolved "https://registry.yarnpkg.com/ember-cli-deploy-plugin/-/ember-cli-deploy-plugin-0.2.9.tgz#a3d395b8adad7ef68d8bacdd0b0f4a61bcf9e651"
45+
dependencies:
46+
chalk "^1.0.0"
47+
core-object "2.0.6"
48+
lodash.clonedeep "^4.5.0"
49+
50+
escape-string-regexp@^1.0.2:
51+
version "1.0.5"
52+
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
53+
54+
extend@3, extend@~3.0.0:
55+
version "3.0.1"
56+
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
57+
58+
follow-redirects@0.0.7:
59+
version "0.0.7"
60+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-0.0.7.tgz#34b90bab2a911aa347571da90f22bd36ecd8a919"
61+
dependencies:
62+
debug "^2.2.0"
63+
stream-consume "^0.1.0"
64+
65+
github@^9.2.0:
66+
version "9.2.0"
67+
resolved "https://registry.yarnpkg.com/github/-/github-9.2.0.tgz#8a886dc40dd63636707dcaf99df3df26c59f16fc"
68+
dependencies:
69+
follow-redirects "0.0.7"
70+
https-proxy-agent "^1.0.0"
71+
mime "^1.2.11"
72+
netrc "^0.1.4"
73+
74+
has-ansi@^2.0.0:
75+
version "2.0.0"
76+
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
77+
dependencies:
78+
ansi-regex "^2.0.0"
79+
80+
https-proxy-agent@^1.0.0:
81+
version "1.0.0"
82+
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6"
83+
dependencies:
84+
agent-base "2"
85+
debug "2"
86+
extend "3"
87+
88+
iconv-lite@~0.4.11:
89+
version "0.4.18"
90+
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2"
91+
92+
lodash.clonedeep@^4.5.0:
93+
version "4.5.0"
94+
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
95+
96+
mime@^1.2.11:
97+
version "1.3.6"
98+
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0"
99+
100+
ms@2.0.0:
101+
version "2.0.0"
102+
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
103+
104+
netrc@^0.1.4:
105+
version "0.1.4"
106+
resolved "https://registry.yarnpkg.com/netrc/-/netrc-0.1.4.tgz#6be94fcaca8d77ade0a9670dc460914c94472444"
107+
108+
semver@~5.0.1:
109+
version "5.0.3"
110+
resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a"
111+
112+
stream-consume@^0.1.0:
113+
version "0.1.0"
114+
resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f"
115+
116+
strip-ansi@^3.0.0:
117+
version "3.0.1"
118+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
119+
dependencies:
120+
ansi-regex "^2.0.0"
121+
122+
supports-color@^2.0.0:
123+
version "2.0.0"
124+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
125+
126+
urlencode@^1.1.0:
127+
version "1.1.0"
128+
resolved "https://registry.yarnpkg.com/urlencode/-/urlencode-1.1.0.tgz#1f2ba26f013c85f0133f7a3ad6ff2730adf7cbb7"
129+
dependencies:
130+
iconv-lite "~0.4.11"

0 commit comments

Comments
 (0)