-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add NPM deployment with release notes and fix flow issues (#24)
Add deployment to NPM and ping to Jenkins after with release notes. fix flow issues to complete the cycle as we have on other NPM packages. Solve FEC-9495, FEC-10064.
- Loading branch information
Showing
13 changed files
with
167 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,88 @@ | ||
|
||
conditions: v1 | ||
sudo: required | ||
dist: trusty | ||
dist: xenial | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- "node" | ||
|
||
addons: | ||
chrome: stable | ||
|
||
services: | ||
- xvfb | ||
cache: | ||
yarn: true | ||
directories: | ||
- node_modules | ||
- node_modules | ||
|
||
before_install: | ||
- export CHROME_BIN=/usr/bin/google-chrome | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- sudo apt-get update | ||
- sudo apt-get install -y libappindicator1 fonts-liberation | ||
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
- sudo dpkg -i google-chrome*.deb | ||
- export DISPLAY=:99.0 | ||
- chmod +x ./scripts/travis.sh | ||
|
||
script: ./scripts/travis.sh | ||
|
||
stages: | ||
- Tests | ||
- Release canary | ||
- Release | ||
|
||
script: | ||
- npm run eslint | ||
- npm run flow | ||
- npm run test | ||
jobs: | ||
fast_finish: true | ||
include: | ||
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/ | ||
- stage: Release | ||
name: "Releasing a new version" | ||
if: tag IS present | ||
env: TRAVIS_MODE=release | ||
deploy: | ||
- provider: releases | ||
api_key: $GH_TOKEN | ||
file_glob: true | ||
file: dist/* | ||
prerelease: true | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
tags: true | ||
- provider: npm | ||
api_key: $NPM_TOKEN | ||
email: $NPM_EMAIL | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
branch: master | ||
after_deploy: | ||
- currentVersion=$(npx -c 'echo "$npm_package_version"') | ||
- chmod +x ./scripts/after_deploy.sh | ||
- ./scripts/after_deploy.sh "cast-receiver" "$currentVersion" "$JENKINS_TAG_TOKEN" | ||
# publish canary package if on master | ||
- stage: Release canary | ||
if: (branch = master) AND (type != pull_request) AND commit_message !~ /^chore\(release\)/ | ||
env: TRAVIS_MODE=releaseCanary | ||
deploy: | ||
provider: npm | ||
api_key: $NPM_TOKEN | ||
email: $NPM_EMAIL | ||
skip_cleanup: true | ||
tag: canary | ||
on: | ||
tags: false | ||
branch: master | ||
after_deploy: | ||
- currentVersion=$(npx -c 'echo "$npm_package_version"') | ||
- echo $currentVersion | ||
- chmod +x ./scripts/after_deploy.sh | ||
- ./scripts/after_deploy.sh "cast-receiver" "$currentVersion" "$JENKINS_CANARY_TOKEN" | ||
# Required tests | ||
- stage: Tests | ||
if: (branch = master) OR (tag IS present) OR (type = pull_request) | ||
name: "Running lint" | ||
env: TRAVIS_MODE=lint | ||
- stage: Tests | ||
if: (branch = master) OR (tag IS present) OR (type = pull_request) | ||
name: "Running Flow type check" | ||
env: TRAVIS_MODE=flow | ||
- stage: Tests | ||
if: (branch = master) OR (tag IS present) OR (type = pull_request) | ||
name: "Running unit tests" | ||
env: TRAVIS_MODE=unitTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
curl -k -d "{'name':$1, 'version':$2, 'source':'npm'}" -H "Content-Type: application/json" -X POST https://jenkins.ovp.kaltura.com/generic-webhook-trigger/invoke?token=$3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"rules": { | ||
"flowtype/no-types-missing-file-annotation": "off", | ||
"require-jsdoc": "off", | ||
"valid-jsdoc": "off", | ||
"mocha-no-only/mocha-no-only": ["error"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import prepareTestEnvironment from './prepare-test-environment'; | ||
import loadSpecs from './load-specs'; | ||
|
||
prepareTestEnvironment(); | ||
loadSpecs(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @returns {void} | ||
*/ | ||
export function loadSpecs() { | ||
const context = require.context('../src/', true, /\.spec\.js$/); | ||
for (const key of context.keys()) { | ||
describe(key, () => { | ||
context(key); | ||
}); | ||
} | ||
} | ||
|
||
export default loadSpecs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import chai from 'chai'; | ||
import sinonChai from 'sinon-chai'; | ||
import sinon from 'sinon/pkg/sinon'; | ||
|
||
/** | ||
* @returns {void} | ||
*/ | ||
export function prepareTestEnvironment() { | ||
chai.should(); | ||
chai.use(sinonChai); | ||
global.chai = chai; | ||
global.expect = chai.expect; | ||
global.should = chai.should; | ||
global.sinon = sinon; | ||
} | ||
|
||
export default prepareTestEnvironment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('Cast Player', () => { | ||
it('', function(done) { | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters