-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
119 lines (115 loc) · 4.13 KB
/
wercker.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
109
110
111
112
113
114
115
116
117
118
119
# This is the build pipeline. Pipelines are the core of wercker
# Read more about pipelines on our dev center
# https://devcenter.wercker.com/development/pipelines/
box: alpine
build:
steps:
- script:
name: noop
code: |
echo 'todo build script here'
- script:
name: check env
code: |
env
test-jvm:
box: openjdk:8-jdk
services:
- id: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: rootpw
MYSQL_DATABASE: test_db
steps:
# todo: nc is not available on debian-stretch
# https://devcenter.wercker.com/administration/services/service-container-networking/#waiting-for-services-to-come-up
# https://devcenter.wercker.com/administration/services/service-container-networking/#getting-the-environment-variables
# https://devcenter.wercker.com/administration/services/examples/mysql/
- script:
name: mapping env
code: |
export CARBON_RDB_HOST=${MYSQL_PORT_3306_TCP_ADDR}
export CARBON_RDB_PORT=${MYSQL_PORT_3306_TCP_PORT}
export CARBON_RDB_CRAWLER_SCHEMA=test_db
export CARBON_RDB_CRAWLER_USER=root
export CARBON_RDB_CRAWLER_PASSWORD=rootpw
export CARBON_API_CRAWLER_ADMIN_HOST=localhost
export CARBON_API_CRAWLER_ADMIN_PORT=40001
# https://github.com/wercker/step-gradle
- java/gradle:
task: clean test
version: '5.1'
cache_project_cache: true
test-node:
box: node:10.9.0-alpine
steps:
- script:
name: add git
code: |
apk update && \
apk upgrade && \
apk add --no-cache git
- script:
name: test
code: |
set -x
cd carbon-crawler-admin-client
yarn && yarn app:test
build-jvm:
box: openjdk:8-jdk
steps:
- java/gradle:
task: clean build -x test
version: '5.1'
cache_project_cache: true
build-node:
box: node:10.9.0-alpine
steps:
- script:
name: add git
code: |
apk update && \
apk upgrade && \
apk add --no-cache git
- script:
name: build
code: |
set -x
cd carbon-crawler-admin-client
yarn && yarn app:build
# https://devcenter.wercker.com/administration/containers/building-an-image/#creating-a-docker-image-using-wercker-steps
# Note: If you don’t push the new image to a registry, the image will become inaccessible when the pipeline ends.
deploy-docker:
steps:
- internal/docker-build:
dockerfile: carbon-crawler-ci/carbon_jre/Dockerfile
image-name: carbon-crawler-admin-api
build-args: "JAR_FILE=carbon-crawler-admin-api/build/libs/carbon-crawler-admin-api-LATEST.jar"
- internal/docker-build:
dockerfile: carbon-crawler-ci/carbon_jre/Dockerfile
image-name: carbon-crawler-stream-flow-crawl-listing-sink
build-args: "JAR_FILE=carbon-crawler-stream/flow/crawl-listing-sink/build/libs/crawl-listing-sink-LATEST.jar"
- internal/docker-build:
dockerfile: carbon-crawler-ci/carbon_jre/Dockerfile
image-name: carbon-crawler-stream-flow-crawl-listing-source
build-args: "JAR_FILE=carbon-crawler-stream/flow/crawl-listing-source/build/libs/crawl-listing-source-LATEST.jar"
- internal/docker-push:
image-name: carbon-crawler-admin-api
username: _json_key
password: $GCR_JSON_KEY_FILE
repository: asia.gcr.io/carbon/crawler-admin-api
registry: https://asia.gcr.io/v2
tag: $WERCKER_GIT_BRANCH $WERCKER_GIT_TAG $WERCKER_GIT_COMMIT ${WERCKER_GIT_COMMIT:0:8}
- internal/docker-push:
image-name: carbon-crawler-stream-flow-crawl-listing-sink
username: _json_key
password: $GCR_JSON_KEY_FILE
repository: asia.gcr.io/carbon/carbon-crawler-stream-flow-crawl-listing-sink
registry: https://asia.gcr.io/v2
tag: $WERCKER_GIT_BRANCH $WERCKER_GIT_TAG $WERCKER_GIT_COMMIT ${WERCKER_GIT_COMMIT:0:8}
- internal/docker-push:
image-name: carbon-crawler-stream-flow-crawl-listing-source
username: _json_key
password: $GCR_JSON_KEY_FILE
repository: asia.gcr.io/carbon/carbon-crawler-stream-flow-crawl-listing-source
registry: https://asia.gcr.io/v2
tag: $WERCKER_GIT_BRANCH $WERCKER_GIT_TAG $WERCKER_GIT_COMMIT ${WERCKER_GIT_COMMIT:0:8}