-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
84 lines (83 loc) · 2.12 KB
/
circle.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
version: 2.1
orbs:
codecov: codecov/[email protected]
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/openjdk:10-jdk-node-browsers
environment:
TERM: dumb
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: web-parser-rest-{{ checksum "build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew dependencies
- save_cache:
paths:
- ~/.gradle
key: web-parser-rest-{{ checksum "build.gradle" }}
- run:
name: Run Tests
command: ./gradlew check
- run:
name: Save test results
command: |
mkdir -p ~/junit/
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \;
when: always
- run:
command: ./gradlew jacocoTestReport
- codecov/upload:
file: ./build/reports/jacoco/test/jacocoTestReport.xml
- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/junit
- run:
name: Build Artifacts
command: ./gradlew assemble
- persist_to_workspace:
root: ~/
paths:
- code
deploy:
working_directory: ~/code
docker:
- image: jdrouet/docker-with-buildx:stable
steps:
- attach_workspace:
at: ~/
- setup_remote_docker:
version: 18.09.3
- run: |
TAG=1.0.$CIRCLE_BUILD_NUM
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker buildx build --push \
--platform linux/arm64/v8,linux/amd64 \
--tag thcathy/web-parser-rest:latest --tag thcathy/web-parser-rest:$TAG .
workflows:
version: 2
commit-workflow:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
scheduled-workflow:
triggers:
- schedule:
cron: "00 18 * * 5"
filters:
branches:
only:
- master
jobs:
- build