Skip to content

Commit

Permalink
gitlab-ce script
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna-mirror-server committed Nov 10, 2015
1 parent c96b7aa commit 43747f5
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions scripts/gitlab-ce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash
set -e

BASE_PATH="${TUNASYNC_WORKING_DIR}"

UBUNTU_PATH="${BASE_PATH}/ubuntu"
UBUNTU_VERSIONS=("trusty" "utopic" "vivid" "wily")
DEBIAN_PATH="${BASE_PATH}/debian"
DEBIAN_VERSIONS=("wheezy" "jessie" "stretch")
YUM_PATH="${BASE_PATH}/yum"

mkdir -p $UBUNTU_PATH $DEBIAN_PATH $YUM_PATH


cfg="/tmp/gitlab-ce-yum.conf"
cat <<EOF > ${cfg}
[el6]
name=el6
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/6/x86_64
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
sslverify=0
[el7]
name=el7
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/7/x86_64
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
sslverify=0
EOF

reposync -c $cfg -d -p ${YUM_PATH}
createrepo -o ${YUM_PATH}/el6 ${YUM_PATH}/el6
createrepo -o ${YUM_PATH}/el7 ${YUM_PATH}/el7
rm $cfg


cfg="/tmp/gitlab-ce-ubuntu.list"
cat << EOF > ${cfg}
set mirror_path ${UBUNTU_PATH}
set nthreds 5
set _tilde 0
EOF
for version in ${UBUNTU_VERSIONS[@]}; do
echo "deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $version main" >> $cfg
echo "deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ $version main" >> $cfg
done

apt-mirror $cfg
rm $cfg


cfg="/tmp/gitlab-ce-debian.list"
cat << EOF > ${cfg}
set mirror_path ${DEBIAN_PATH}
set nthreds 5
set _tilde 0
EOF
for version in ${DEBIAN_VERSIONS[@]}; do
echo "deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ $version main" >> $cfg
echo "deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ $version main" >> $cfg
done

apt-mirror $cfg
rm $cfg

# vim: ts=4 sts=4 sw=4

0 comments on commit 43747f5

Please sign in to comment.