Guest User

Untitled

a guest
Dec 11th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. MODULES="../../$JOB_NAME/modules"
  2. TARGET="./"
  3. COMMIT="$(git rev-parse HEAD)"
  4. BRANCHES="$(for branch in $(git branch -a | grep -v "(no branch)" | cut -c 3-); do [ "$(git rev-parse $branch)" == "$(git rev-parse HEAD)" ] && echo "$(basename $branch)"; done | uniq -u)"
  5.  
  6. cd "$HUDSON_HOME/jobs/public/$JOB_NAME"
  7.  
  8. for modulepath in $(ls -d $MODULES/*/); do
  9. buildspath="${modulepath}builds"
  10. builddate="$(ls $buildspath | sort -r | head -n 1)"
  11. buildpath="$buildspath/$builddate"
  12. for file in $(find $buildpath -name '*.zip'); do
  13. filename="$(basename $file)"
  14. relativepath="../../builds/$JOB_NAME${file#$buildspath}"
  15. ln -sf "$relativepath" "$TARGET$filename"
  16. for branch in $BRANCHES; do
  17. ln -sf "$relativepath" "$TARGET$JOB_NAME-$branch-bin.zip"
  18. done
  19. done
  20. done
Add Comment
Please, Sign In to add comment