Skip to content

Commit

Permalink
Merge pull request #357 from Knowledge-Graph-Hub/jenkins_preserve_exi…
Browse files Browse the repository at this point in the history
…sting_builds_in_index_html

Added existing builds in index.html for project dir
  • Loading branch information
justaddcoffee committed Sep 28, 2020
2 parents aec5569 + 6be0f4a commit 1909da5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,12 @@ pipeline {
sh 'mkdir $BUILDSTARTDATE/stats/'
sh 'cp -p *_stats.yaml $BUILDSTARTDATE/stats/'

// make local $S3PROJECTDIR with two dirs, $BUILDSTARTDATE and current/, both with the same contents
// make local $S3PROJECTDIR
sh 'mkdir $S3PROJECTDIR'
// add dir for existing builds so they are indexed
// do an s3cmd ls for our project subdir, for each existing build make a local dir in $S3PROJECTDIR
sh "for dir in `s3cmd ls s3://kg-hub-public-data/kg-covid-19/ | grep '\/$' | awk '{print $NF}' | grep -w -v -E 'raw|current' | xargs -n1 basename`; do mkdir -p $S3PROJECTDIR/$dir; done"
// now make two dirs, $BUILDSTARTDATE and current/, both with the same contents
sh 'mv $BUILDSTARTDATE $S3PROJECTDIR/'
sh 'cp -pr $S3PROJECTDIR/$BUILDSTARTDATE $S3PROJECTDIR/current'

Expand Down

0 comments on commit 1909da5

Please sign in to comment.