gitlab-ce.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. set -e
  3. _here=`dirname $(realpath $0)`
  4. . ${_here}/helpers/apt-download
  5. [ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
  6. BASE_PATH="${TUNASYNC_WORKING_DIR}"
  7. YUM_PATH="${BASE_PATH}/yum"
  8. UBUNTU_VERSIONS=("trusty" "wily")
  9. DEBIAN_VERSIONS=("wheezy" "jessie" "stretch")
  10. UBUNTU_PATH="${BASE_PATH}/ubuntu/"
  11. DEBIAN_PATH="${BASE_PATH}/debian/"
  12. mkdir -p $UBUNTU_PATH $DEBIAN_PATH $YUM_PATH
  13. cfg="/tmp/gitlab-ce-yum.conf"
  14. cat <<EOF > ${cfg}
  15. [el6]
  16. name=el6
  17. baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/6/x86_64
  18. repo_gpgcheck=0
  19. gpgcheck=0
  20. enabled=1
  21. gpgkey=https://packages.gitlab.com/gpg.key
  22. sslverify=0
  23. [el7]
  24. name=el7
  25. baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/7/x86_64
  26. repo_gpgcheck=0
  27. gpgcheck=0
  28. enabled=1
  29. gpgkey=https://packages.gitlab.com/gpg.key
  30. sslverify=0
  31. EOF
  32. reposync -c $cfg -d -p ${YUM_PATH}
  33. createrepo --update -o ${YUM_PATH}/el6 ${YUM_PATH}/el6
  34. createrepo --update -o ${YUM_PATH}/el7 ${YUM_PATH}/el7
  35. rm $cfg
  36. base_url="https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu"
  37. for version in ${UBUNTU_VERSIONS[@]}; do
  38. apt-download-binary ${base_url} "$version" "main" "amd64" "${UBUNTU_PATH}"
  39. apt-download-binary ${base_url} "$version" "main" "i386" "${UBUNTU_PATH}"
  40. done
  41. echo "Ubuntu finished"
  42. base_url="https://packages.gitlab.com/gitlab/gitlab-ce/debian"
  43. for version in ${DEBIAN_VERSIONS[@]}; do
  44. apt-download-binary ${base_url} "$version" "main" "amd64" "${DEBIAN_PATH}"
  45. apt-download-binary ${base_url} "$version" "main" "i386" "${DEBIAN_PATH}"
  46. done
  47. echo "Debian finished"
  48. # vim: ts=4 sts=4 sw=4