Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

Commit

Permalink
Merge pull request #16 from Sirimangalo/travis-deployment
Browse files Browse the repository at this point in the history
chore(travis): adds deployment steps
  • Loading branch information
binarious authored Jul 31, 2016
2 parents 32257cb + 1f1991b commit c64a825
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
35 changes: 23 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,37 @@ sudo: required
dist: trusty
language: node_js
node_js:
- '5.12'

- '5.12'
addons:
apt:
sources:
- google-chrome
- google-chrome
packages:
- google-chrome-stable
- google-chrome-beta

- google-chrome-stable
- google-chrome-beta
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

- openssl aes-256-cbc -K $encrypted_ef3fa096c499_key -iv $encrypted_ef3fa096c499_iv
-in deploy_key.enc -out deploy_key -d
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
before_script:
- npm install
- cp src/api.config.ts.dist src/api.config.ts

script:
- npm run lint
- npm test
- npm run build:prod
- npm run build:prod
after_success:
- |
if ([ ! -z "$TRAVIS_TAG" ]) &&
[ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "Deploying $TRAVIS_TAG to server"
chmod 600 deploy_key
mv deploy_key ~/.ssh/id_rsa
touch dist/assets/version.json
echo "{ \"version\": \"$TRAVIS_TAG\" }" > dist/assets/version.json
tar -czf transfer.tgz dist
scp -o "StrictHostKeyChecking no" transfer.tgz jenkins@159.203.18.58:/var/www/meditation-plus
ssh -o "StrictHostKeyChecking no" jenkins@159.203.18.58 'cd /var/www/meditation-plus; rm -rf client; mkdir client; tar -xzf transfer.tgz -C client --strip 1; rm transfer.tgz'
fi
Binary file added deploy_key.enc
Binary file not shown.
16 changes: 14 additions & 2 deletions src/app/help/help.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Http } from '@angular/http';
import { AppState } from '../';

@Component({
Expand All @@ -9,7 +10,18 @@ import { AppState } from '../';
]
})
export class HelpComponent {
constructor(public appState: AppState) {
this.appState.set('title', 'Help');

version: string = 'dev';

constructor(
public appState: AppState,
public http: Http
) {
appState.set('title', 'Help');
http.get('/assets/version.json')
.map(res => res.json())
.subscribe(res => {
this.version = res.version;
});
}
}
3 changes: 2 additions & 1 deletion src/app/help/help.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<md-card>
<h3>About</h3>
<md-card-title>About</md-card-title>
<md-card-subtitle>Version: {{ version }}</md-card-subtitle>

<p>
Meditation+ is a companion app for our online community at <a href="http://meditation.sirimangalo.org/">meditation.sirimangalo.org</a>. It is meant to provide all the functionality of the website in a format more suited to a mobile device.
Expand Down

0 comments on commit c64a825

Please sign in to comment.