-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_config.jsonnet
66 lines (61 loc) · 2.87 KB
/
_config.jsonnet
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
// References example: https://circleci.com/docs/2.0/configuration-reference/#example-full-configuration
// Local file imports
local cmn = import 'common.libsonnet';
local dsl = cmn.dsl;
local environment_jobs = import 'environment.libsonnet';
// DSL remapping for convenience
local const = dsl.constants;
local executors = dsl.executors;
local jobs = dsl.jobs;
local pipeline = dsl.pipeline;
local steps = dsl.steps;
local workflows = dsl.workflows;
pipeline.new(
workflows=[
workflows.new(
name='build-deploy',
jobs=[
workflows.job(
'build',
filters=workflows.filter_branches(ignore=['develop', '/feature-.*/']),
environment={ TEST_REPORTS: '/tmp/test-reports' },
working_directory='~/%s' % [cmn.project_name],
executor_options=[
executors.docker('ubuntu:14.04', auth=cmn.executor_auth),
executors.docker('mongo:2.6.8', auth=cmn.executor_auth, command=['mongod', '--smallfiles']),
executors.docker('postgres:14.2', auth=cmn.executor_auth, environment={ POSTGRES_USER: 'user' }),
executors.docker(
'redis@sha256:54057dd7e125ca41afe526a877e8bd35ec2cdd33b9217e022ed37bdcf7d09673',
auth=cmn.executor_auth
),
executors.docker('rabbitmq:3.5.4', auth=cmn.executor_auth),
],
steps=[
steps.checkout(),
steps.run('echo 127.0.0.1 devhost | sudo tee -a /etc/hosts'),
steps.run(|||
sudo -u root createuser -h localhost --superuser ubuntu &&
sudo createdb -h localhost test_db
|||),
steps.restore_cache([cmn.cache_key, cmn.cache_key_base]),
steps.run(environment={ SSH_TARGET: 'localhost', TEST_ENV: 'linux' }, command=|||
set -xu
mkdir -p ${TEST_REPORTS}
run-tests.sh
cp out/tests/*.xml ${TEST_REPORTS}
|||),
steps.run(|||
set -xu
mkdir -p /tmp/artifacts
create_jars.sh << pipeline.number >>
cp *.jar /tmp/artifacts
|||),
steps.save_cache(key=cmn.cache_key, paths=['~/.m2']),
steps.store_artifacts(path='/tmp/artifacts', destination='build'),
steps.store_test_results('/tmp/test-reports'),
],
),
] + environment_jobs
),
],
)