-
Notifications
You must be signed in to change notification settings - Fork 5
/
shippable.yml
58 lines (50 loc) · 2.32 KB
/
shippable.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
# Language setting http://docs.shippable.com/ci/languages/node/
language: node_js
# use this to control what branches get built.
# http://docs.shippable.com/ci/advancedOptions/branches/
branches:
only:
- master
# using pre-defined build variables
# full list http://docs.shippable.com/ci/advancedOptions/environmentVariables/
env:
global:
- TEST_RESULTS_DIR=$SHIPPABLE_REPO_DIR/shippable/testresults
- CODE_COVERAGE_DIR=$SHIPPABLE_REPO_DIR/shippable/codecoverage
- TESTS_LOC_DIR=$SHIPPABLE_REPO_DIR/tests
- MOD_LOC=$SHIPPABLE_REPO_DIR/node_modules/.bin/
- DOCKER_REPO=deploy-kubernetes-runcli
- DOCKER_ACC=ttrahan # replace with your registry account name
build:
ci:
# npm mirrors can sometimes be flaky, better to use shippable_retry
# http://docs.shippable.com/ci/advancedOptions/retry/
- shippable_retry npm install
- mkdir -p $TEST_RESULTS_DIR && mkdir -p $CODE_COVERAGE_DIR
- pushd $TESTS_LOC_DIR
- $MOD_LOC/mocha --recursive "$TESTS_LOC_DIR/**/*.spec.js" -R mocha-junit-reporter --reporter-options mochaFile=$TEST_RESULTS_DIR/testresults.xml
- $MOD_LOC/istanbul --include-all-sources cover -root "$SHIPPABLE_REPO_DIR/routes" $SHIPPABLE_REPO_DIR/node_modules/mocha/bin/_mocha -- -R spec-xunit-file --recursive "$TESTS_LOC_DIR/**/*.spec.js"
- $MOD_LOC/istanbul report cobertura --dir $CODE_COVERAGE_DIR
- popd
post_ci:
- docker build -t $DOCKER_ACC/$DOCKER_REPO:$BRANCH.$SERVICE .
- docker push $DOCKER_ACC/$DOCKER_REPO:$BRANCH.$BUILD_NUMBER
on_success:
- echo versionName=$BRANCH.$BUILD_NUMBER > /build/state/deploy_kubernetes_runcli_img.env
# Integrations are used to connect external resources to CI
# http://docs.shippable.com/integrations/overview/
integrations:
# adding docker hub integration so that credentials are available to CI Job
# http://docs.shippable.com/integrations/imageRegistries/dockerHub/
hub:
- integrationName: ttrahan-dh # replace with your Docker Hub integration name
type: docker
# http://docs.shippable.com/ci/shippableyml/#notifications
notifications:
# turns off email for PR builds, notifies only on failure or change in status
# http://docs.shippable.com/integrations/notifications/email/
- integrationName: email
type: email
on_success: change
on_failure: always
on_pull_request: never