This repository has been archived by the owner on Jul 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [#8] Add travis CI integration (#20) * [#8] Add travis CI integration * [#8] Add travis CI integration * [#8] Add travis CI integration * [#8] Add travis CI integration * [#8] Add travis CI integration * [#8] Add travis CI integration * [#8] Add travis CI integration * [#11] Add travis CI Badge (#31) * [#32] Add Codacy Integration and Badge (#33)
- Loading branch information
1 parent
6e5a593
commit 7c746ce
Showing
5 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: python | ||
|
||
python: | ||
- '3.5' | ||
|
||
branches: | ||
only: | ||
- master | ||
- develop | ||
|
||
script: | ||
- bash build/ci.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
export REPO_HOME=$(pwd) | ||
export BUILD_DIR=${REPO_HOME}/build | ||
export WORK_DIR=${REPO_HOME}/.tmp | ||
|
||
# Fetch reusable functions ... | ||
source ${BUILD_DIR}/functions.sh | ||
# Fetch constants and environment variables ... | ||
source ${BUILD_DIR}/env.sh | ||
|
||
export args=$* | ||
|
||
write_log "Arguments --> ${args}" | ||
|
||
write_log "################### Cleanup #####################" | ||
|
||
write_log "Work Directory --> ${WORK_DIR}" | ||
run_cmd "rm -rf ${WORK_DIR}" | ||
run_cmd "mkdir ${WORK_DIR}" | ||
|
||
#Place as many pre-requisite steps here as requires... | ||
write_log "#################### Install Requisite Packages ###############" | ||
|
||
write_log " ----------- 1. Install Tableau SDK ------------- " | ||
|
||
run_cmd "cd ${WORK_DIR}" | ||
run_cmd "wget ${TABLEAU_URL}" | ||
run_cmd "tar -xvf ${TABLEAU_TAR_BALL}" | ||
run_cmd "export TABLEAU_DIR=$(ls | grep Tableau | grep -v gz)" | ||
run_cmd "cd ${TABLEAU_DIR}" | ||
run_cmd "python setup.py install" | ||
run_cmd "cd ${REPO_HOME}" | ||
|
||
write_log "#################### Install PPExtensions ####################" | ||
|
||
run_cmd "pip install ppextensions" | ||
|
||
write_log "################### Final Cleanup #########################" | ||
|
||
run_cmd "rm -rf ${WORK_DIR}" | ||
|
||
write_log "######################## BUILD SUCCESS ###############################" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
export TABLEAU_URL=https://downloads.tableau.com/tssoftware/Tableau-SDK-Python-Linux-64Bit-10-3-14.tar.gz | ||
export TABLEAU_TAR_BALL=Tableau-SDK-Python-Linux-64Bit-10-3-14.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
|
||
|
||
# This is a re-usable functions file | ||
# Other scripts may use the functions in this file by sourcing them | ||
|
||
#----------------------------function will check for error code & exit if failure, else proceed further----------------------------# | ||
|
||
#usage : check_error <$?> <custom_error_code> | ||
#Example: Check_error < pass $? from the shell command > < Custom Message for errorcode -gt 0 > | ||
|
||
check_error() | ||
{ | ||
cmd_error_code=$1 | ||
custom_message=$2 | ||
if [ ${cmd_error_code} -gt 0 ]; then | ||
write_log "Error | Stage | ${custom_message}" | ||
exit ${cmd_error_code} | ||
else | ||
write_log "Success | Stage | ${custom_message}" | ||
fi | ||
} | ||
|
||
#----------------------------function will check for error code & warn if failure----------------------------# | ||
|
||
#usage : check_warning <$?> <custom_error_code> | ||
#Example: Check_warning < pass $? from the shell command > < Custom Message for errorcode -gt 0 > | ||
|
||
|
||
check_warning() | ||
{ | ||
|
||
cmd_error_code=$1 | ||
pgm_exit_code=$2 | ||
pgm_exit_msg=$3 | ||
if [ ${cmd_error_code} -gt 0 ]; then | ||
write_log "WARNING ! ${cmd_error_code} ${pgm_exit_code} ${pgm_exit_msg}" | ||
else | ||
echo "" | ||
fi | ||
} | ||
|
||
|
||
|
||
#----------------------------function will write the message to Console / Log File----------------------------# | ||
|
||
#Usage : write_log < Whatever message you need to log > | ||
|
||
write_log() | ||
{ | ||
msg=$1 | ||
to_be_logged="$(date '+%Y%m%d %H:%M:%S') | $msg" | ||
echo ${to_be_logged} | ||
} | ||
|
||
#-----------------------------------Executes a Command--------------------------------------------------------# | ||
|
||
|
||
|
||
#Usage : run_cmd < The command to execute > | ||
|
||
run_cmd() | ||
{ | ||
cmd=$1 | ||
if [ -z $2 ]; then | ||
fail_on_error="break_code" | ||
else | ||
fail_on_error=$2 | ||
fi | ||
write_log "Executing Command --> $1" | ||
$cmd | ||
error_code=$? | ||
if [ ! $fail_on_error = "ignore_errors" ]; then | ||
check_error $error_code "$cmd" | ||
fi | ||
} |