Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #!/bin/bash -xe
  2.  
  3. VIRTUAL_ENV="${JENKINS_HOME}/VirtualEnvs/${JOB_NAME}"
  4. . "${VIRTUAL_ENV}/bin/activate"
  5.  
  6. RSYNC_OPTS="-a --delete --progress --exclude=.repo.lock --exclude .git/\*"
  7. RSYNC_RSH="ssh -o User=jenkins"
  8.  
  9. # By default we go to docs.testing.ansible.com dir
  10. RSYNC_TARGET="${ANSIBLE_NIGHTLY_DOCS_PATH}"
  11.  
  12. if [ "$OFFICIAL" = "yes" ]; then
  13. # Copy into docs.ansible.com dir
  14. RSYNC_TARGET="${ANSIBLE_RELEASE_DOCS_PATH}"
  15. fi
  16.  
  17. # Get the version in the form 2.7
  18. # Note: this will return 2.8 (not devel)
  19. VERSION=$(make version -B | cut -f 1-2 -d .)
  20.  
  21. make webdocs
  22.  
  23. if [ "${GIT_BRANCH}" == "origin/devel" ]; then
  24. # We are using devel, not 2.?
  25. VERSION=devel
  26. fi
  27.  
  28. rsync ${RSYNC_OPTS} --rsh "${RSYNC_RSH}" docs/docsite/_build/html/ "${RSYNC_TARGET}/$VERSION/"
  29.  
  30. if [ "${OLD_VERSION}" == "no" ]; then
  31. # Add latest symlink
  32. ln -s $VERSION docs/docsite/_build/latest
  33. rsync ${RSYNC_OPTS} --rsh "${RSYNC_RSH}" docs/docsite/_build/latest "${RSYNC_TARGET}"
  34. fi
  35.  
  36. # Sync releases mirrors
  37. if [[ ( "$OFFICIAL" == "yes" ) || ( "$GIT_BRANCH" == "origin/devel" ) ]]; then
  38. echo -e "build" > sync_releases.cfg
  39. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement