-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
36 lines (31 loc) · 861 Bytes
/
.gitlab-ci.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
image: debian
before_script:
- apt-get update
- apt-get --yes --force-yes install rsync ssh wget jq
stages:
- test
- upload
test:
stage: test
script:
- echo "Check if files in data/ are valid JSON file"
- |
for file in data/*;
do
cat $file | jq empty
done
upload:
stage: upload
script:
- echo "${SSH_PRIVATE_KEY}" > id_rsa
- chmod 400 id_rsa
- mkdir "${HOME}/.ssh"
- echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
- rsync -hrvz --delete --exclude='venv' --exclude='__pycache__' --exclude='\..*' -e 'ssh -i id_rsa' src/ [email protected]:~/git-demo/
- rsync -hrvz --delete --exclude='venv' --exclude='__pycache__' --exclude='\..*' -e 'ssh -i id_rsa' data/ [email protected]:~/git-demo/data/
only:
refs:
- master
after_script:
- rm -rf "${HOME}/.ssh"
- rm -rf id_rsa