This repository has been archived by the owner on May 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
108 lines (91 loc) · 3.61 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
language: node_js
node_js: "10"
addons:
chrome: stable
cache:
yarn: true
directories:
- packages/commercetools/api-client/node_modules
- packages/commercetools/api-client/lib
- packages/commercetools/helpers/node_modules
- packages/commercetools/helpers/lib
- packages/commercetools/composables/node_modules
- packages/commercetools/composables/lib
- packages/commercetools/theme/.nuxt
- packages/commercetools/theme/node_modules
- packages/about-you/api-client/node_modules
- packages/about-you/api-client/lib
- packages/about-you/composables/node_modules
- packages/about-you/composables/lib
- packages/core/core/node_modules
- packages/core/core/lib
- packages/prismic/node_modules
- packages/prismic/lib
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
services:
- docker
before_install:
- npm install -g @lhci/cli
install:
- yarn
jobs:
include:
- stage: build
name: Build commercetools
script:
- yarn build:prismic && yarn build:ct
- stage: build
name: Build about you
script:
- yarn build:ay
- stage: unit tests
script: yarn test:core --coverage
name: Test core packages
after_script:
- cat ./packages/core/coverage/lcov.info | coveralls
- stage: unit tests
script: yarn test:ct:api-client --coverage
name: Test CT api-client
after_script:
- cat ./packages/commercetools/api-client/coverage/lcov.info | coveralls
- stage: unit tests
script: yarn test:ct:composables --coverage
name: Test CT composables
after_script:
- cat ./packages/commercetools/composables/coverage/lcov.info | coveralls
- stage: unit tests
script: yarn test:ay:api-client --coverage
name: Test AY api-client
after_script:
- cat ./packages/about-you/api-client/coverage/lcov.info | coveralls
- stage: unit tests
script: yarn build:ay:api-client && yarn test:ay:composables --coverage
name: Test AY composables
after_script:
- cat ./packages/about-you/composables/coverage/lcov.info | coveralls
- stage: unit tests
script: yarn test:prismic --coverage
name: Test Prismic
after_script:
- cat ./packages/prismic/coverage/lcov.info | coveralls
# - stage: lighthouse
# name: commercetools
# script: lhci autorun --rc-overrides.upload.target=temporary-public-storage --collect.startServerCommand="yarn start:ct" --collect.url=http://localhost:3000 --collect.startServerReadyPattern="Listening"
- build_image:
if: branch = master AND type != pull_request
name: "Build docker image"
stage: docker build
script:
- travis_wait 30 docker build --build-arg COMMIT -t registry.storefrontcloud.io/vsf-next-demo-storefrontcloud-io/vue-storefront:$COMMIT -f dev/docker/Dockerfile .
- echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin registry.storefrontcloud.io
- docker push registry.storefrontcloud.io/vsf-next-demo-storefrontcloud-io/vue-storefront:$COMMIT
- curl $COMMIT.vsf-next-demo.preview.storefrontcloud.io
- echo "This commit preview is available here $COMMIT.vsf-next-demo.preview.storefrontcloud.io"
- deploy_to_storefrontcloud:
if: branch = master AND type != pull_request
name: "Deploy to StorefrontCloud"
stage: deploy
script:
- "curl -u $CLOUD_USERNAME:$CLOUD_PASSWORD -H 'Content-Type: application/json' -X POST -d \"{\\\"code\\\":\\\"vsf-next-demo\\\", \\\"frontContainerVersion\\\":\\\"$COMMIT\\\"}\" https://farmer.storefrontcloud.io/instances"