-
Notifications
You must be signed in to change notification settings - Fork 0
/
cico_setup.sh
executable file
·81 lines (69 loc) · 1.86 KB
/
cico_setup.sh
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
#!/bin/bash -ex
load_jenkins_vars() {
if [ -e "jenkins-env" ]; then
cat jenkins-env \
| grep -E "(DEVSHIFT_TAG_LEN|DEVSHIFT_USERNAME|DEVSHIFT_PASSWORD|JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \
| sed 's/^/export /g' \
> ~/.jenkins-env
source ~/.jenkins-env
fi
}
prep() {
yum -y update
yum -y install git gcc-c++ bzip2 fontconfig initscripts
yum -y install gtk2 libXtst libXScrnSaver libXScrnSaver-devel GConf2
yum -y install firefox Xvfb libXfont libsecret
yum -y install wget
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
/usr/bin/Xvfb :99 -screen 0 1280x1024x24 &
sleep 3;
curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash -
yum -y install nodejs
}
install_dependencies() {
# Build fabric8-analytics-vscode-extension
npm install -g typescript
npm install -g vsce
npm ci
# fetch lsp latest release
#. fetch_lsp.sh
#chmod +x /root/payload/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
if [ $? -eq 0 ]; then
echo 'CICO: npm install : OK'
else
echo 'CICO: npm install : FAIL'
exit 1
fi
}
# run_unit_tests() {
# # Exec unit tests
# npm run test:unit
# if [ $? -eq 0 ]; then
# echo 'CICO: unit tests OK'
# else
# echo 'CICO: unit tests FAIL'
# exit 2
# fi
# }
build_project() {
vsce package
if [ $? -eq 0 ]; then
echo 'CICO: vsce prepublish OK'
else
echo 'CICO: vsce prepublish FAIL'
exit 2
fi
}
run_int_tests() {
# Exec integration tests
npm run test-compile
npm test --silent
if [ $? -eq 0 ]; then
echo 'CICO: integration tests OK'
else
echo 'CICO: integration tests FAIL'
exit 2
fi
}
load_jenkins_vars
prep