This repository has been archived by the owner on Jun 12, 2020. It is now read-only.
forked from hyperledger-archives/sawtooth-next-directory
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
69 lines (68 loc) · 2.56 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
jobs:
include:
- stage: backend
language: python
python:
- "3.6"
before_install:
- sudo apt-get install automake
- sudo apt-get install libtool
- sudo apt-get install pkg-config
install:
- pip3 install -r requirements.txt
script:
- bin/run_python_formatter_check
- bin/run_lint
- bin/build -t
- stage: frontend
env:
- NODE_PATH=src/
language: node_js
cache:
yarn: true
directories:
- node_modules
node_js:
- "lts/*"
before_install:
- cd ./client
install:
- yarn
script:
- yarn lint
- yarn test
# The deploy stage will deploy the master branch to a remote server once a
# merge occurs on the branch. Steps required to deploy to remote server:
#
# 1. Generate an SSH keypair to SSH into remote server
#
# 2. Clone Sawtooth NEXT Directory repo into your remote server and configure the
# cloned repo to allow pushes:
# $ git clone https://github.com/hyperledger/sawtooth-next-directory.git
# $ cd sawtooth-next-directory
# $ git config --local receive.denyCurrentBranch updateInstead
#
# 3. Run 'travis encrypt-file id_rsa' command to encrypt the SSH private key
# (change id_rsa to the name of your private key). Add the output of the
# command to the before_install stage and replace id_rsa.enc with the encrypted
# private key to the .travis folder.
# More information can be found here: https://docs.travis-ci.com/user/encrypting-files/
#
# 4. Add the following env variables into Travis Repo Settings to properly deploy:
# - IP: remote server's IP
# - DEPLOY_DIR: location of cloned repo on remote server
# - DEPLOY_USER: username of the user on the remote server
#
- stage: deploy
if: branch = master AND type = push AND env(IP)
language: generic
before_install:
# Decrypt the encrypted private key file named 'id_rsa.enc' and save the decrypted key for
# use to SSH into remote server. This command is outputted from the 'travis encrypt-file'
# command.
- openssl aes-256-cbc -K $encrypted_[hex string]_key -iv $encrypted_[hex string]_iv
-in .travis/id_rsa.enc -out .travis/id_rsa -d
- ssh-keyscan -H $IP >> ~/.ssh/known_hosts
- chmod +x ./.travis/deploy.sh
after_success:
- ./.travis/deploy.sh