-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathconfig.yml
More file actions
69 lines (69 loc) · 3.18 KB
/
config.yml
File metadata and controls
69 lines (69 loc) · 3.18 KB
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
version: 2.1
jobs:
sunbird-ed-dp-build:
machine:
image: ubuntu-2004:202008-01
steps:
- checkout
- run:
name: clone analytics core
command: |
if [ -z $CIRCLE_PR_NUMBER ]; then
target_branch=$CIRCLE_BRANCH
else
prdata=$(curl -X GET -u $GITHUB_USER_TOKEN:x-oauth-basic https://api.github.com/repos/Sunbird-Ed/sunbird-data-products/pulls/$CIRCLE_PR_NUMBER)
target_branch=$(echo "${prdata}" | jq -r '.base.ref')
fi
echo $target_branch
git clone https://github.com/project-sunbird/sunbird-analytics-core.git
branchExists=$(cd sunbird-analytics-core && git ls-remote --heads origin $target_branch)
echo $branchExists
if [ -z ${branchExists} ]; then
latest_branch=$(cd sunbird-analytics-core && git for-each-ref --count=1 --sort=-committerdate 'refs/remotes/**/release*' --format='%(refname:short)' | head -1)
echo $latest_branch
cd sunbird-analytics-core && git checkout $latest_branch
else
cd sunbird-analytics-core && git checkout $target_branch
fi
cd ../ && git clone https://github.com/project-sunbird/sunbird-core-dataproducts.git
branchExists=$(cd sunbird-core-dataproducts && git ls-remote --heads origin $target_branch)
echo $branchExists
if [ -z ${branchExists} ]; then
latest_branch=$(cd sunbird-core-dataproducts && git for-each-ref --count=1 --sort=-committerdate 'refs/remotes/**/release*' --format='%(refname:short)' | head -1)
echo $latest_branch
cd sunbird-core-dataproducts && git checkout $latest_branch
else
cd sunbird-core-dataproducts && git checkout $target_branch
fi
- restore_cache:
keys:
- dp-dependency-cache-{{ checksum "data-products/pom.xml" }}
- run:
name: Build analytics-core dependency jar
command: |
echo $(java -version)
cd sunbird-analytics-core && mvn install -DskipTests
- run:
name: Build core-data-products dependency jar
command: |
echo $(java -version)
cd sunbird-core-dataproducts && mvn install -DskipTests
- run:
name: Ed-data-products-build
command: |
echo $(java -version)
cd data-products && mvn scoverage:report
- save_cache:
key: dp-dependency-cache-{{ checksum "data-products/pom.xml" }}
paths: ~/.m2
- run:
name: sonar
command: |
export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
echo $(java -version)
cd data-products && mvn -X sonar:sonar -Dsonar.projectKey=Sunbird-Ed_sunbird-data-products -Dsonar.host.url=https://sonarcloud.io -Dsonar.exclusions=/home/circleci/project/adhoc-scripts/**,/home/circleci/project/replay-scripts/** -Dsonar.scala.coverage.reportPaths=/home/circleci/project/data-products/target/scoverage.xml -Dsonar.organization=sunbird-ed
workflows:
version: 2.1
workflow:
jobs:
- sunbird-ed-dp-build