Skip to content

Commit

Permalink
fix if
Browse files Browse the repository at this point in the history
  • Loading branch information
gkirok committed Feb 25, 2019
1 parent 01872e1 commit fe0dce4
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,21 @@ def build_nuclio(V3IO_TSDB_VERSION, internal_status="stable") {
def git_project = 'tsdb-nuclio'
stage('prepare sources') {
container('jnlp') {
echo "a1"
dir("${BUILD_FOLDER}") {
sh """
rm -rf "src/github.com/v3io/${git_project}";
git clone https://${GIT_TOKEN}@github.com/${git_project_user}/${git_project}.git src/github.com/v3io/${git_project}
"""
sh("rm -rf src/github.com/v3io/${git_project}; git clone https://${GIT_TOKEN}@github.com/${git_project_user}/${git_project}.git src/github.com/v3io/${git_project}")
}
echo "a2"
if ( "${internal_status}" == "unstable" ) {
echo "a3"
dir("${BUILD_FOLDER}/src/github.com/v3io/${git_project}") {
echo "a4"
sh("git checkout development")
}
}
echo "a5"
dir("${BUILD_FOLDER}/src/github.com/v3io/${git_project}") {
echo "a6"
sh """
rm -rf functions/ingest/vendor/github.com/v3io/v3io-tsdb functions/query/vendor/github.com/v3io/v3io-tsdb
git clone https://${GIT_TOKEN}@github.com/${git_project_user}/v3io-tsdb.git functions/ingest/vendor/github.com/v3io/v3io-tsdb
Expand All @@ -92,12 +95,12 @@ def build_nuclio(V3IO_TSDB_VERSION, internal_status="stable") {
git config --global user.name '${GIT_USERNAME}'
git add functions/ingest/vendor/github.com functions/query/vendor/github.com;
git commit -am 'Updated TSDB to ${V3IO_TSDB_VERSION}';
if [[ "${internal_status}" == "unstable" ]]; then
git push origin development
else
git push origin master
fi
"""
if ( "${internal_status}" == "unstable" ) {
sh("git push origin development")
} else {
sh("git push origin master")
}
}
} catch (err) {
echo "Can not push code to master"
Expand Down Expand Up @@ -132,7 +135,7 @@ def build_prometheus(V3IO_TSDB_VERSION, internal_status="stable") {
container('jnlp') {
dir("${BUILD_FOLDER}") {
sh """
rm -rf "src/github.com/${git_project}/${git_project}";
rm -rf src/github.com/${git_project}/${git_project}
git clone https://${GIT_TOKEN}@github.com/${git_project_user}/${git_project}.git src/github.com/${git_project}/${git_project}
"""
}
Expand Down Expand Up @@ -162,12 +165,12 @@ def build_prometheus(V3IO_TSDB_VERSION, internal_status="stable") {
git config --global user.name '${GIT_USERNAME}'
git add vendor/github.com;
git commit -am 'Updated TSDB to ${V3IO_TSDB_VERSION}';
if [[ "${internal_status}" == "unstable" ]]; then
git push origin development
else
git push origin master
fi
"""
if ( "${internal_status}" == "unstable" ) {
sh("git push origin development")
} else {
sh("git push origin master")
}
}
} catch (err) {
echo "Can not push code to master"
Expand Down

0 comments on commit fe0dce4

Please sign in to comment.