Skip to content

Commit

Permalink
adds cico files
Browse files Browse the repository at this point in the history
  • Loading branch information
invincibleJai authored and Jyasveer Gotta committed Sep 19, 2017
1 parent 88ca421 commit 1ff5c7c
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 12 deletions.
11 changes: 11 additions & 0 deletions cico_build_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -ex

. cico_setup.sh

install_dependencies

build_project

run_int_tests
17 changes: 5 additions & 12 deletions cico_run_tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#!/bin/bash

set -ex

# Show command before executing
set -x
. cico_setup.sh

set -e
install_dependencies

#npm install -g typescript
build_project


npm install
npm run vscode:prepublish
#npm install -g vsce
vsce package

#script:
npm test --silent
run_int_tests
72 changes: 72 additions & 0 deletions cico_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/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
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum -y install nodejs
}

install_dependencies() {
# Build fabric8-analytics-vscode-extension
npm install -g typescript
npm install -g vsce
npm install;
#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() {
npm run vscode:prepublish
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 test --silent

if [ $? -eq 0 ]; then
echo 'CICO: integration tests OK'
else
echo 'CICO: integration tests FAIL'
exit 2
fi
}

load_jenkins_vars
prep

0 comments on commit 1ff5c7c

Please sign in to comment.