forked from codacy/codacy-scalameta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
55 lines (54 loc) · 1.99 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
version: 2
jobs:
build:
machine: true
working_directory: ~/workdir
steps:
- checkout
- run:
name: Clone test project
working_directory: ~/
command: |
(git -C ~/codacy-plugins-test fetch --all &&
git -C ~/codacy-plugins-test reset --hard origin/master) ||
git clone git://github.com/codacy/codacy-plugins-test.git ~/codacy-plugins-test
- restore_cache:
key: dependencies-{{ checksum "build.sbt" }}
- run:
name: Compile test project
working_directory: ~/codacy-plugins-test
command: sbt compile
- run:
name: Publish tool docker locally
working_directory: ~/workdir
command: sbt 'set version in Docker := "latest"' "set name := \"$CIRCLE_PROJECT_REPONAME\"" docker:publishLocal
- save_cache:
key: dependencies-{{ checksum "build.sbt" }}
paths:
- "~/.ivy2"
- "~/.m2"
- "~/.sbt"
- "~/codacy-plugins-test/target"
- "~/codacy-plugins-test/project/target"
- "~/codacy-plugins-test/project/project"
- "~/workdir/target"
- "~/workdir/project/target"
- "~/workdir/project/project"
- run:
name: Test
working_directory: ~/codacy-plugins-test
command: sbt -Dcodacy.tests.ignore.descriptions=true "runMain codacy.plugins.DockerTest all $CIRCLE_PROJECT_REPONAME:latest"
- deploy:
name: Push application Docker image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker tag $CIRCLE_PROJECT_REPONAME codacy/$CIRCLE_PROJECT_REPONAME
docker tag $CIRCLE_PROJECT_REPONAME codacy/$CIRCLE_PROJECT_REPONAME:1.0.$CIRCLE_BUILD_NUM
docker push codacy/$CIRCLE_PROJECT_REPONAME
fi
workflows:
version: 2
build-and-deploy:
jobs:
- build