Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/webkom/chewie

Project deployment tool
https://github.com/webkom/chewie

Last synced: 27 days ago
JSON representation

Project deployment tool

Awesome Lists containing this project

README

        

# chewie [![Build Status](https://ci.abakus.no/api/badges/webkom/chewie/status.svg)](https://ci.abakus.no/webkom/chewie)
Server deploy tool, supports deployments from a web interface and through GitHub webhooks.

### Usage
There are currently two ways to make chewie deploy a project. By a status event hook
from GitHub, from which a success status on master will make it deploy the master
branch, and by using the web frontend.

## Setup
```bash
git clone [email protected]:webkom/chewie.git
cd chewie
npm install
forever start $PWD/index.js
```
This will get the project up and running on port 3000 or the port specified in the `PORT` environment variable.

There has to be a JSON-file with descriptions of the projects you want to deploy.
*chewie* will look for it on the location specified by the environment variable:
`SERVER_CONFIG_FILE`. The file should use the following format:

```json
{
"": {
"hostname": "",
"user": "",
"path": ""
},
"": {
...
}
}
```

The user running chewie needs to have ssh access to the user on the server each project runs on.

### Deploy chewie with chewie
If you want to deploy chewie on a server with another hostname than `.abakus.no` expose
the `CORRECT_HOSTNAME` environment variable in order to run `make production`.

#### Prepare the projects
All projects must have a `production` target in make. *chewie* will run
`make production` in the given path on the given server. Thus, the target
must contain all tasks to successfully deploy the project. Except
`git fetch && git reset --hard origin/master` which will run before
`make production` in order to make sure that the latest makefile is available.

## Tests
```bash
make test
```

## Settings
All settings should be set by environment variables.

#### `PORT`
The port the express web-server will listen to.

### `NODE_ENV`
Default: `'development'`
The environment chewie is running in. This should be set to `production` in production.

#### `SERVER_CONFIG_FILE` - required
The config file with projects, mentioned in [the setup section](#setup)

#### `HOOK_TOKEN` - required
The secret token used to authenticate github webhooks.

#### `PASSPORT_STRATEGY`
The strategy passport should use to authenticate. This will be passed into require and the required file will be called like a function and passed into passport. [passport-abakus](https://github.com/webkom/passport-abakus) is an example of a passport strategy that comply with the structure chewie expects.

**Note:** If this is not set chewie will not require authentication for the deployment dashboard.

#### `PASSPORT_STRATEGY_OPTIONS`
Default: `{}`
The options passed into the passport strategy

#### `REDIS`
Default: `false`
Should redis dependent features be used.

#### `REDIS_PORT`
Default: `6379`

#### `REDIS_HOST`
Default: `'127.0.0.1'`

#### `REDIS_DB`
Default: `1`

#### `SLACK_URL`
Used to enable sending of slack notification on deployments.

#### `SLACK_CHANNEL`
The channel to send notifications to

#### `CORRECT_HOSTNAME`
Default: `abakus.no`
Only used by the makefile to make sure `make production` only runs in the right environment.

--------
MIT © webkom, Abakus Linjeforening