forked from ioBroker/ioBroker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
63 lines (62 loc) · 2.22 KB
/
.cirrus.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
freebsd_instance:
image_family: freebsd-12-0
task:
prepare_install_script:
- pkg install -y bash node npm libnghttp2
- mkdir -p node_modules/iobroker
- mv doc node_modules/iobroker
- mv img node_modules/iobroker
- mv install node_modules/iobroker
- mv lib node_modules/iobroker
- mv wiki node_modules/iobroker
- mv package.json node_modules/iobroker
- mv installer.sh node_modules/iobroker
install_script:
- sudo chmod +x travis/travis_install.sh
# make sure the iob_not_installed file can be created
- sudo chmod 777 .
- bash travis/travis_install.sh
prepare_test_script:
# only continue tests if ioBroker was actually installed
- |
if [ ! -e iob_not_installed ]; then
# Test file permissions now...
sudo chmod +x travis/travis_testFiles.sh
bash travis/travis_testFiles.sh
# ...because this will change them
sudo chmod +x travis/travis_prepareTest.sh
bash travis/travis_prepareTest.sh
fi
test_script:
# Remember the test dir
- TEST_DIR=`pwd`
# only continue tests if ioBroker was actually installed
- |
if [ ! -e iob_not_installed ]; then
# Move the test files to the correct location
IOB_DIR=`[ -d /opt/iobroker ] && echo "/opt/iobroker" || echo "/usr/local/iobroker"`
mv test $IOB_DIR/test
# And perform the tests
cd $IOB_DIR
node_modules/mocha/bin/mocha --exit
fi
# Now test if adapters which require python can be installed
- iobroker url iobroker.lovelace
# Now test that the fixer does what it should
- find / -iname "fix_installation.sh"
- |
if [ ! -e iob_not_installed ]; then
# Stop ioBroker processes before running the fixer
IOB_DIR=`[ -d /opt/iobroker ] && echo "/opt/iobroker" || echo "/usr/local/iobroker"`
cd $IOB_DIR
node node_modules/iobroker.js-controller/iobroker.js stop
sleep 60
#
cd $TEST_DIR
# Run the fixer
sudo chmod +x ./fix_installation.sh
sudo env "PATH=$PATH" bash ./fix_installation.sh
# Test file permissions again...
sudo chmod +x travis/travis_testFiles.sh
bash travis/travis_testFiles.sh
fi