2
0

gitlab-ce.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. cache_dir="/tmp/yum-gitlab-ce-cache/"
  14. cfg="/tmp/gitlab-ce-yum.conf"
  15. cat <<EOF > ${cfg}
  16. [main]
  17. keepcache=0
  18. [el6]
  19. name=el6
  20. baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/6/x86_64
  21. repo_gpgcheck=0
  22. gpgcheck=0
  23. enabled=1
  24. gpgkey=https://packages.gitlab.com/gpg.key
  25. sslverify=0
  26. [el7]
  27. name=el7
  28. baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/7/x86_64
  29. repo_gpgcheck=0
  30. gpgcheck=0
  31. enabled=1
  32. gpgkey=https://packages.gitlab.com/gpg.key
  33. sslverify=0
  34. EOF
  35. reposync -c $cfg -d -p ${YUM_PATH} -e $cache_dir
  36. createrepo --update -v -c $cache_dir -o ${YUM_PATH}/el6 ${YUM_PATH}/el6
  37. createrepo --update -v -c $cache_dir -o ${YUM_PATH}/el7 ${YUM_PATH}/el7
  38. rm $cfg
  39. base_url="https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu"
  40. for version in ${UBUNTU_VERSIONS[@]}; do
  41. apt-download-binary ${base_url} "$version" "main" "amd64" "${UBUNTU_PATH}" || true
  42. apt-download-binary ${base_url} "$version" "main" "i386" "${UBUNTU_PATH}" || true
  43. done
  44. echo "Ubuntu finished"
  45. base_url="https://packages.gitlab.com/gitlab/gitlab-ce/debian"
  46. for version in ${DEBIAN_VERSIONS[@]}; do
  47. apt-download-binary ${base_url} "$version" "main" "amd64" "${DEBIAN_PATH}" || true
  48. apt-download-binary ${base_url} "$version" "main" "i386" "${DEBIAN_PATH}" || true
  49. done
  50. echo "Debian finished"
  51. # vim: ts=4 sts=4 sw=4