-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
65 lines (61 loc) · 2.4 KB
/
.travis.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
dist: bionic
branches:
only:
- master
before_script:
- GAMA_Continuous_URL=$(curl -s https://api.github.com/repos/gama-platform/gama/releases/tags/continuous | grep continuous/GAMA1.8_Continuous_Linux | cut -d ':' -f 2,3 | tr -d \")
- echo $GAMA_Continuous_URL
- GAMA_URL=https://github.com/gama-platform/gama/releases/download/1.8.1/GAMA_1.8.1_Linux.zip
script:
# Prepare COMOKIT
- mkdir ./COMOKIT-HPC
- mv ./pre-processing ./COMOKIT-HPC
- mv ./post-processing ./COMOKIT-HPC
- git clone https://github.com/COMOKIT/COMOKIT-Model.git ./Model
- mv ./Model/COMOKIT ./COMOKIT-Model
# Stable 1.8.1
- curl -o gama.zip -fSL $GAMA_URL
- unzip gama.zip -d ./GAMA
- chmod +x ./GAMA/headless/gama-headless.sh
- echo "osgi.locking=none" >> ./GAMA/configuration/config.ini # Disable Eclipse's workspace locking
# Continuous 1.8.1
- rm gama.zip
- curl -o gama.zip -fSL $GAMA_Continuous_URL
- unzip gama.zip -d ./GAMA_Continuous
- chmod +x ./GAMA_Continuous/headless/gama-headless.sh
- echo "osgi.locking=none" >> ./GAMA_Continuous/configuration/config.ini # Disable Eclipse's workspace locking
after_success:
- zip -r ./GAMA-COMOKIT-HPC.zip ./GAMA ./COMOKIT-Model ./COMOKIT-HPC
- rm -fr ./GAMA && mv ./GAMA{_Continuous,}
- zip -r ./GAMA_Continuous-COMOKIT-HPC.zip ./GAMA ./COMOKIT-Model ./COMOKIT-HPC
before_deploy:
# Remove latest release
- LATEST_COMOKIT_HPC_URL=$(node -pe 'JSON.parse(process.argv[1]).url' "$(curl -s https://api.github.com/repos/COMOKIT/COMOKIT-HPC/releases/tags/latest)")
- |
if [ $LATEST_COMOKIT_HPC_URL == undefined ]; then
echo "No continuous release to delete";
else
echo $LATEST_COMOKIT_HPC_URL;
bash -c "curl -H \"Authorization: token ${GITHUB_API_KEY}\" -H \"Accept: application/vnd.github.v3+json\" -X DELETE ${LATEST_COMOKIT_HPC_URL}";
fi
# Update tag
- git remote add master https://${GITHUB_API_KEY}@github.com/COMOKIT/COMOKIT-HPC.git
- git fetch master --tags
- git tag -f latest
- git push master --tags -f
deploy:
provider: releases
name: "All-In-One Archive"
body: "Prerelease of COMOKIT archived with GAMA Continuous, COMOKIT's default models and HPC scripts"
overwrite: true
tag_name: latest
prerelease: true
file:
- "./GAMA-COMOKIT-HPC.zip"
- "./GAMA_Continuous-COMOKIT-HPC.zip"
skip_cleanup: true
on:
repo: COMOKIT/COMOKIT-HPC
branch: master
tags: false
api_key: $GITHUB_API_KEY