Skip to content

Commit 609d19d

Browse files
committed
Merge pull request #12 from A21z/2.0.0
Version 2.0.0
2 parents 3a25d4f + fd00e29 commit 609d19d

21 files changed

+550
-206
lines changed

.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"standard"
4+
]
5+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ results
1313

1414
node_modules
1515
npm-debug.log
16-
node-cd.sh
16+
node-cd.sh
17+
18+
.idea/
19+
.nvmrc

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- 0.6
4-
- 0.8
5-
- 0.10.30
6-
script: "cd src && npm install"
3+
- 4.2.2
4+
- 5.0.0
5+
script: "npm test"
6+
sudo: false

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
node-cd
22
=======
33

4-
**Featherweight Github/Bitbucket Continuous Deployment**
4+
**Featherweight Github/Bitbucket/Contentful Continuous Deployment**
55

6-
Continuously deploy any code from Github to your server.
6+
Continuously deploy any code from Github/Bitbucket/Contentful to your server.
77

8-
node-cd is a simple node.js app handling Github's and Bitbucket's post-receive hooks.
9-
It can execute any script you want on your server: deployment, testing, etc.
8+
node-cd is a simple node.js app handling Github's, Bitbucket's and Contentful's post-receive hooks.
9+
It can execute any script you want on your server: deployment, testing, etc.
1010

1111
## Installation
1212

1313
git clone https://github.com/A21z/node-cd.git
14-
cd node-cd/src
1514
npm install
1615

1716
## Usage
1817

19-
* `cp node-cd.template.sh node-cd.sh`
20-
* Edit the `node-cd.sh` file to execute whatever you like after your commits (ex: stop server, git pull, start server)
18+
* Edit the `bitbucket.sh`, `contentful.sh` or `github.sh` file to execute whatever you like after your commits (ex: stop server, git pull, start server)
2119
* **For GitHub**: Set your post-receive hook as described [here](https://help.github.com/articles/post-receive-hooks) with the url `http://yourserver.com:61440/github`
2220
* **For Bitbucket**: Set your post-receive hook as described [here](https://confluence.atlassian.com/display/BITBUCKET/POST+hook+management) with the url `http://yourserver.com:61440/bitbucket`
21+
* **For Contentful**: Set your webhook in your Settings > Webhooks with the url `http://yourserver.com:61440/contentful`
22+
* Add execution permission on scripts
23+
`chmod +x bitbucket.sh contentful.sh github.sh`
2324
* Run the app
24-
`WWW_PORT=61440 node node-cd.js`
25+
`WWW_PORT=61440 node src/index.js`
26+
27+
[![Build Status](https://travis-ci.org/A21z/node-cd.svg)](https://travis-ci.org/A21z/node-cd)

bitbucket.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
echo "Updating Template"
2+
echo "====================================="

config.js

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
1-
Private = {
2-
server: {port: "61440"}, // Port is overriden by env var "WWW_PORT"
3-
security: {
4-
authorizedIps:[
5-
'127.0.0.1',
6-
'localhost',
7-
// Bitbucket IPs
8-
// 131.103.20.165,
9-
// 131.103.20.166
10-
// Github's IPs
11-
// '207.97.227.253',
12-
// '50.57.128.197',
13-
// '204.232.175.75',
14-
// '108.171.174.178'
15-
],
16-
bitbucketIps: [
17-
'131.103.20.165',
18-
'131.103.20.166'
19-
],
20-
githubIps: [
21-
'207.97.227.253',
22-
'50.57.128.197',
23-
'204.232.175.75',
24-
'108.171.174.178'
25-
],
26-
authorizedSubnet:[
27-
'204.232.175.64/27',
28-
'192.30.252.0/22'
29-
]
30-
},
31-
repository: {
32-
branch: 'refs/heads/master',
33-
},
34-
action: {exec: "../node-cd.sh"}
35-
};
1+
var Private = {
2+
server: {port: '61440'}, // Port is overriden by env var 'WWW_PORT'
3+
security: {
4+
authorizedIps: [
5+
'127.0.0.1',
6+
'localhost'
7+
],
8+
bitbucketIps: [
9+
'131.103.20.160',
10+
'131.103.20.27',
11+
'131.103.20.165',
12+
'165.254.145.0',
13+
'165.254.145.26',
14+
'104.192.143.0',
15+
'104.192.143.24'
16+
],
17+
githubIps: [
18+
'207.97.227.253',
19+
'50.57.128.197',
20+
'204.232.175.75',
21+
'108.171.174.178'
22+
],
23+
githubAuthorizedSubnets: [
24+
'204.232.175.64/27',
25+
'192.30.252.0/22'
26+
]
27+
},
28+
repository: {
29+
branch: 'master'
30+
},
31+
action: {
32+
exec: {
33+
github: './github.sh',
34+
bitbucket: './bitbucket.sh',
35+
contentful: './contentful.sh'
36+
}
37+
}
38+
}
3639

37-
module.exports = Private;
40+
module.exports = Private

contentful.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
echo "Updating Content"
2+
echo "====================================="
3+

github.sh

Whitespace-only changes.

node-cd.template.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "node-cd",
3+
"version": "2.0.0-rc",
4+
"private": true,
5+
"scripts": {
6+
"start": "node src/index",
7+
"test": "standard && tape test/**/*.js"
8+
},
9+
"dependencies": {
10+
"express": "4.13.3",
11+
"body-parser": "^1.6.3",
12+
"morgan": "^1.5.0",
13+
"netmask": "0.0.2",
14+
"underscore": ""
15+
},
16+
"devDependencies": {
17+
"eslint": "^1.10.1",
18+
"eslint-config-standard": "^4.4.0",
19+
"eslint-plugin-standard": "^1.3.1",
20+
"standard": "^3.0.0",
21+
"tape": "^4.2.2"
22+
}
23+
}

0 commit comments

Comments
 (0)