-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcircle.yml
134 lines (112 loc) · 3.62 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
defaults: &defaults
working_directory: ~/repo
docker:
# specify the version you desire here
- image: coturiv/ci-cordova
version: 2
jobs:
angular:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/repo
# Authenticate to npm
# - run:
# name: Authenticate to npm
# command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/repo/.npmrc
# Download and cache dependencies
- restore_cache:
keys:
- npm-deps-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- npm-deps-
- run: npm install --no-progress
- save_cache:
paths:
- node_modules
key: npm-deps-{{ checksum "package.json" }}
# run test!
- run:
name: Testing
command: |
npm run lint
# npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
# npm run e2e -- --protractor-config=e2e/protractor-ci.conf.js
# run build!
- run:
name: Build
command: ionic build --prod
android:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/repo
- restore_cache:
keys:
- npm-deps-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- npm-deps-
# Download and cache plugins
- restore_cache:
keys:
- plugins-{{ checksum "config.xml" }}
# fallback to using the latest cache if no exact match is found
- plugins-
- run: ionic cordova platform add android
- save_cache:
paths:
- plugins
key: plugins-{{ checksum "config.xml" }}
# Download and cache gradle
- restore_cache:
key: jars-{{ checksum "platforms/android/build.gradle" }} \
-{{ checksum "platforms/android/app/build.gradle" }}
# run build!
- run:
name: Building android
command: ionic cordova build android --prod
# command: cordova build android --release
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "platforms/android/build.gradle" }} \
-{{ checksum "platforms/android/app/build.gradle" }}
# Signing and Optimizing (TBD)
# - run:
# name: Signing and Optimizing apk
# command: ./builds/sign-apk.sh
# Artifacts
# - store_artifacts:
# path: platforms/android/app/build/outputs/apk/debug/app-debug.apk
# destination: apks/
# - run:
# name: Upload to Slack
# command: |
# export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g')
# curl -F file=@platforms/android/app/build/outputs/apk/debug/app-debug.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload
workflows:
version: 2
builds:
jobs:
- angular
# - angular:
# filters:
# branches:
# ignore:
# - develop
- android:
requires:
- angular
filters:
branches:
only:
- release
# - ios:
# requires:
# - angular