Skip to content

Commit 77827a4

Browse files
author
Gabriel Simmer
committed
Add travisCI deployment script.
1 parent c448d3a commit 77827a4

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
node_js:
3+
- "11"
4+
5+
deploy:
6+
provider: script
7+
script: bash scripts/deploy.sh
8+
on:
9+
tags: true

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Discord bot for r/webdev",
55
"main": "app.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
7+
"test": "echo \"Error: no test specified\" && exit",
88
"start": "node app.js"
99
},
1010
"author": "rwebdev",

scripts/deploy.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
# Generic deployment script for webster.
3+
export RSYNC_DESTINATION="webster@${PRODUCTION_SERVER}:/home/webster/discord-bot"
4+
5+
which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
6+
7+
eval $(ssh-agent -s)
8+
ssh-add <(echo "$DEPLOY_KEY")
9+
mkdir -p ~/.ssh
10+
echo "$HOST_FINGERPRINT" >> ~/.ssh/known_hosts
11+
12+
rsync -av --no-perms --no-owner --no-group --exclude '.git' ./ "${RSYNC_DESTINATION}/"
13+
ssh "webster@${PRODUCTION_SERVER}" 'cd discord-bot/; npm install'

0 commit comments

Comments
 (0)