-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
63 lines (62 loc) · 1.7 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
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/openjdk:8-jdk
steps:
- checkout
- restore_cache:
key: maven-{{ checksum "pom.xml" }}
- run: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: maven-{{ checksum "pom.xml" }}
- run: mvn resources:resources package
- store_test_results:
path: target/surefire-reports
- store_artifacts:
path: target/esl.jar
- persist_to_workspace:
root: ~/
paths:
- code
deploy:
working_directory: ~/code
docker:
- image: circleci/openjdk:8-jdk
steps:
- attach_workspace:
at: ~/
- setup_remote_docker
- run: |
TAG=1.0.$CIRCLE_BUILD_NUM
docker build -t thcathy/esl:latest -t thcathy/esl:$TAG -f docker/Dockerfile .
docker build -t thcathy/esl-nginx:latest -t thcathy/esl-nginx:$TAG -f nginx/Dockerfile .
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push thcathy/esl:$TAG
docker push thcathy/esl:latest
docker push thcathy/esl-nginx:$TAG
docker push thcathy/esl-nginx:latest
workflows:
version: 2
commit-workflow:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
scheduled-workflow:
triggers:
- schedule:
cron: "20 5 * * 5"
filters:
branches:
only:
- master
jobs:
- build