@@ -813,3 +813,63 @@ void watchdog() {
813
813
sh ' `exit -1`'
814
814
}
815
815
}
816
+
817
+ // Reset and initialize skyhook base.
818
+ void initialize () {
819
+
820
+ // Possibly protect against issues like #350 by making sure
821
+ // $BRANCH_NAME is there and vaguely sane.
822
+ if (BRANCH_NAME instanceof String && BRANCH_NAME . size() >= 3 ) {
823
+
824
+ // Get a mount point ready
825
+ sh ' mkdir -p $WORKSPACE/mnt || true'
826
+ // Ninja in our file credentials from Jenkins.
827
+ withCredentials([file(credentialsId : ' skyhook-private-key' , variable : ' SKYHOOK_IDENTITY' )]) {
828
+ // Try and ssh fuse skyhook onto our local system.
829
+ sh
' sshfs -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o IdentityFile=$SKYHOOK_IDENTITY -o idmap=user [email protected] :/home/skyhook $WORKSPACE/mnt/'
830
+ }
831
+ // Remove anything we might have left around from
832
+ // times past.
833
+ sh ' rm -r -f $WORKSPACE/mnt/$BRANCH_NAME || true'
834
+ // Rebuild directory structure.
835
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/bin || true'
836
+ // WARNING/BUG: needed for arachne to run at
837
+ // this point.
838
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/lib || true'
839
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products || true'
840
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/ttl || true'
841
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/json || true'
842
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/blazegraph || true'
843
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/upstream_and_raw_data || true'
844
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/pages || true'
845
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/solr || true'
846
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/panther || true'
847
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/products/gaferencer || true'
848
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/metadata || true'
849
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/annotations || true'
850
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/ontology || true'
851
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/reports || true'
852
+ sh ' mkdir -p $WORKSPACE/mnt/$BRANCH_NAME/release_stats || true'
853
+ // Tag the top to let the world know I was at least
854
+ // here.
855
+ sh ' echo "Runtime summary." > $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
856
+ sh ' echo "" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
857
+ sh ' date >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
858
+ sh ' echo "" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
859
+ sh ' echo "Release notes: https://github.com/geneontology/go-site/tree/master/releases" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
860
+ sh ' echo "Branch: $BRANCH_NAME" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
861
+ sh ' echo "Start day: $START_DAY" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
862
+ sh ' echo "Start date: $START_DATE" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
863
+ sh ' echo "$START_DAY" > $WORKSPACE/mnt/$BRANCH_NAME/metadata/dow.txt'
864
+ sh ' echo "$START_DATE" > $WORKSPACE/mnt/$BRANCH_NAME/metadata/date.txt'
865
+
866
+ sh ' echo "Official release date: metadata/release-date.json" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
867
+ sh ' echo "Official Zenodo archive DOI: metadata/release-archive-doi.json" >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
868
+ sh ' echo "TODO: Note software versions." >> $WORKSPACE/mnt/$BRANCH_NAME/summary.txt'
869
+ // TODO: This should be wrapped in exception
870
+ // handling. In fact, this whole thing should be.
871
+ sh ' fusermount -u $WORKSPACE/mnt/ || true'
872
+ }else {
873
+ sh ' echo "HOW DID THIS EVEN HAPPEN?"'
874
+ }
875
+ }
0 commit comments