-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks
executable file
·111 lines (108 loc) · 3.16 KB
/
tasks
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
#!/bin/bash
set -e
if [[ ! -f ./releaser ]];then
timeout 2 wget -O releaser http://http.archive.ai-traders.com/releaser/1.0.6/releaser || { echo "Cannot download releaser, ignoring"; rm -f ./releaser; }
fi
if [[ -f ./releaser ]];then
source ./releaser
releaser_init
fi
function verify_version_ide {
version=$(get_next_oversion)
if [[ "version=\"${version}\"" != $(cat ./ide_version) ]]; then
echo "fail! version in ide_version file is different than in OVersion backend"
exit 1
fi
verify_version_for_release
}
command="$1"
case "${command}" in
set_version)
if [[ -n "$2" ]]; then
next_version="$2"
set_next_oversion "${next_version}"
else
next_version=$(get_next_oversion)
fi
set_version_in_changelog "${changelog_file}" "${next_version}"
echo "version=\"${next_version}\"" > "./ide_version"
exit $?
;;
verify_version)
verify_version_ide
exit $?
;;
style)
# install shellcheck with (https://github.com/koalaman/shellcheck):
# 1. add to your apt source:
# deb http://archive.ubuntu.com/ubuntu/ trusty-backports restricted main universe
# 2. run: apt-get install shellcheck
#
# To run the docker container interactively:
# 1. add this to Idefile.shellcheck: IDE_DOCKER_OPTIONS="--entrypoint=/bin/sh"
# 2. run: ide --idefile Idefile.shellcheck
ide --idefile Idefile.shellcheck /ide/work/ide
ide --idefile Idefile.shellcheck /ide/work/ide_functions
exit $?
;;
unit)
# install shpec with (https://github.com/rylnd/shpec):
# sudo sh -c "`curl -L https://raw.github.com/rylnd/shpec/master/install.sh`"
set +e
ide "time shpec test/unit/shpec/**/*.sh"
exit $?
;;
unit_alpine)
# install shpec with (https://github.com/rylnd/shpec):
# sudo sh -c "`curl -L https://raw.github.com/rylnd/shpec/master/install.sh`"
set +e
ide --idefile Idefile.alpine "time shpec test/unit/shpec/**/*.sh"
exit $?
;;
itest_build_exampleide)
# this is needed to run shpec itests
rm -rf test/docker-example-ide/src
cp -r ./ide_image_scripts/src test/docker-example-ide/src
cd test/docker-example-ide
docker build -t example-ide:0.0.1 .
exit $?
;;
itest)
set +e
time shpec test/integration/shpec/*.sh
exit $?
;;
itest_install)
sudo ./install.sh
ide_installed=$(ide -c version 2>&1)
if [[ "${ide_installed}" == "/usr/bin/ide version"* ]]; then
echo "success, ide is installed"
exit 0
else
exit 1
fi
;;
itest_local_install)
sudo ./local_install.sh
ide_installed=$(ide -c version 2>&1)
if [[ "${ide_installed}" == "/usr/bin/ide version"* ]]; then
echo "success, ide is installed"
exit 0
else
exit 1
fi
;;
release)
verify_version_for_release
git_tag_from_oversion
old_version=$(get_next_oversion)
next_version=$(bump_patch_version "${old_version}")
set_next_oversion "${next_version}"
exit $?
;;
*)
echo "Invalid command: '${command}'"
exit 1
;;
esac
set +e