forked from code-dot-org/code-dot-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.yml
More file actions
152 lines (137 loc) · 3.28 KB
/
Copy path.drone.yml
File metadata and controls
152 lines (137 loc) · 3.28 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
kind: pipeline
name: unit
clone:
disable: true
steps:
- name: clone
image: docker:git
commands:
- git clone --branch $DRONE_SOURCE_BRANCH --depth 50 $DRONE_GIT_HTTP_URL .
- git reset --hard $DRONE_COMMIT
- name: verify-pr
image: wintercdo/code-dot-org:0.7
pull: always
commands:
- |
if [ -z "$DRONE_PULL_REQUEST" ]; then
echo "Not a pull request."
exit 0
fi
# Check to see if PR is from fork. If so, exit, as the test run provides access to secrets.
- head_repo=$(curl -s "https://api.github.com/repos/code-dot-org/code-dot-org/pulls/$DRONE_PULL_REQUEST" | jq .head.repo.full_name)
- echo $head_repo
- |
if [ "$head_repo" != '"code-dot-org/code-dot-org"' ]; then
echo "Pull request is from fork $head_repo; exiting."
exit 1
fi
- name: restore-cache
image: plugins/s3-cache
settings:
pull: true
restore: true
access_key:
from_secret: S3_CACHE_ACCESS_KEY
secret_key:
from_secret: S3_CACHE_SECRET_KEY
- name: unit-tests
image: wintercdo/code-dot-org:0.7
pull: always
volumes:
- name: rbenv
path: /home/circleci/.rbenv
- name: mysql
path: /var/lib/mysql
environment:
CLOUDFRONT_KEY_PAIR_ID:
from_secret: CLOUDFRONT_KEY_PAIR_ID
CLOUDFRONT_PRIVATE_KEY:
from_secret: CLOUDFRONT_PRIVATE_KEY
commands:
- df -h
- sudo chown -R circleci:circleci .
- # cache is restored to source directory, so we need to copy it into the right place
- cp -rn "$(pwd)/home/circleci/.rbenv" /home/circleci || true
- /entrypoint.sh docker/unit_tests.sh
- name: update-cache
image: plugins/s3-cache
volumes:
- name: rbenv
path: /home/circleci/.rbenv
settings:
pull: true
rebuild: true
access_key:
from_secret: S3_CACHE_ACCESS_KEY
secret_key:
from_secret: S3_CACHE_SECRET_KEY
mount:
- /home/circleci/.rbenv
volumes:
- name: rbenv
temp: {}
- name: mysql
temp: {}
trigger:
event:
include:
- pull_request
# ---
# kind: pipeline
# name: ui
# clone:
# depth: 50
# services:
# - name: ui-tests-redis
# image: redis
# ports:
# - 6379
# steps:
# - name: ui-tests
# image: wintercdo/code-dot-org:0.7
# volumes:
# - name: rbenv
# path: /home/circleci/.rbenv
# - name: mysql
# path: /var/lib/mysql
# environment:
# CLOUDFRONT_KEY_PAIR_ID:
# from_secret: CLOUDFRONT_KEY_PAIR_ID
# CLOUDFRONT_PRIVATE_KEY:
# from_secret: CLOUDFRONT_PRIVATE_KEY
# PROPERTIES_ENCRYPTION_KEY:
# from_secret: PROPERTIES_ENCRYPTION_KEY
# AWS_ACCESS_KEY_ID:
# from_secret: AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY:
# from_secret: AWS_SECRET_ACCESS_KEY
# APPLITOOLS_KEY:
# from_secret: APPLITOOLS_KEY
# FIREBASE_NAME:
# from_secret: FIREBASE_NAME
# SAUCE_USERNAME:
# from_secret: SAUCE_USERNAME
# SAUCE_ACCESS_KEY:
# from_secret: SAUCE_ACCESS_KEY
# commands:
# - pwd
# - whoami
# - id -u
# - id -g
# - ls -alh
# - sudo chown -R circleci:circleci .
# - /entrypoint.sh docker/ui_tests.sh
# volumes:
# - name: rbenv
# temp: {}
# - name: mysql
# temp: {}
# trigger:
# event:
# include:
# - pull_request
---
kind: signature
hmac: 4ef30caa9dc7941b06d4ed3e8427def6b650ee9b3ceb3b161e2ffe83e603cae4
...