forked from MyBitFoundation/MyBit-UI-Toolkit.app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (47 loc) · 1.98 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
language: node_js
node_js:
- "8"
cache:
directories:
- node_modules
yarn: true
before_script:
# Install ssh-agent if not already installed, it is required by Docker.
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to a file to be used later
- echo "$SSH_PRIVATE_KEY" | base64 --decode > bit_rsa
# Provide the proper permissions for the ssh keys
- chmod 600 bit_rsa
# Adding ssh key to agent
- ssh-add bit_rsa
# Adding bit-bin for being able to use bit commands later
# @TODO: Alias dev dependency binary (i.e. ./node_modules/.bin/bit) instead of installing
- npm install bit-bin -g
# buidl
- yarn build
script:
- GIT_HASH=$(git rev-parse --short HEAD)
- if [ "$TRAVIS_BRANCH" = "develop" -a ! "$TRAVIS_PULL_REQUEST" = "false" ]; then HOST=$(echo ui-develop.mybit.io); fi
- if [ "$TRAVIS_BRANCH" = "develop" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then HOST=$(echo ui-staging.mybit.io); fi
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then HOST=$(echo ui.mybit.io); fi
- echo ${GIT_HASH} > build/version
- cp CONTRIBUTORS build/contributors
- BUILD_URL=$(npx now --name ui.mybit.io build -t $NOW_PROD_TOKEN)
- npx now alias ${BUILD_URL} $HOST -t $NOW_PROD_TOKEN
after_success:
- npm set init.author.name "MyBit AG"
- npm set init.author.email "[email protected]"
- npm config set @bit:registry = "https://node.bitsrc.io"
- echo "//registry.npmjs.org/:_authToken=$NPM_MYBIT_BOT_TOKEN" > ~/.npmrc
- echo "//node.bitsrc.io/:_authToken=$NPM_MYBIT_BOT_TOKEN" >> ~/.npmrc
- bit config set analytics_reporting false
- bit config set error_reporting false
- bit config set user.name jjperezaguinaga
- bit config set user.email [email protected]
- bit config set ssh_key_file bit_rsa
- bit init
- bit add src/showcase/*
- bit tag --all
- bit export mybit.test