Skip to content
Snippets Groups Projects
Unverified Commit baf3b6af authored by aviau's avatar aviau
Browse files

deploy-packages: support manual download location

Change-Id: I42f69660cef7b0e004b11a8ab0035721b0a2efe9
Tuleap: #872
parent 2fd81444
No related branches found
No related tags found
No related merge requests found
...@@ -8,3 +8,4 @@ packages ...@@ -8,3 +8,4 @@ packages
ring_*.tar.gz ring_*.tar.gz
Makefile.packaging.distro_targets Makefile.packaging.distro_targets
repositories repositories
manual-download
...@@ -37,8 +37,12 @@ case $i in ...@@ -37,8 +37,12 @@ case $i in
KEYID="${i#*=}" KEYID="${i#*=}"
shift shift
;; ;;
--remote-location=*) --remote-repository-location=*)
REMOTE_LOCATION="${i#*=}" REMOTE_REPOSITORY_LOCATION="${i#*=}"
shift
;;
--remote-manual-download-location=*)
REMOTE_MANUAL_DOWNLOAD_LOCATION="${i#*=}"
shift shift
;; ;;
*) *)
...@@ -55,12 +59,12 @@ echo "#########################" ...@@ -55,12 +59,12 @@ echo "#########################"
echo "## Creating repository ##" echo "## Creating repository ##"
echo "#########################" echo "#########################"
DISTRIBUTION_FOLDER=$(realpath repositories)/${DISTRIBUTION} DISTRIBUTION_REPOSITOIRY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
rm -rf ${DISTRIBUTION_FOLDER} rm -rf ${DISTRIBUTION_REPOSITOIRY_FOLDER}
mkdir -p ${DISTRIBUTION_FOLDER}/conf mkdir -p ${DISTRIBUTION_REPOSITOIRY_FOLDER}/conf
# Distributions file # Distributions file
cat << EOF > ${DISTRIBUTION_FOLDER}/conf/distributions cat << EOF > ${DISTRIBUTION_REPOSITOIRY_FOLDER}/conf/distributions
Origin: ring Origin: ring
Label: Ring ${DISTRIBUTION} Repository Label: Ring ${DISTRIBUTION} Repository
Codename: ring Codename: ring
...@@ -71,8 +75,8 @@ SignWith: ${KEYID} ...@@ -71,8 +75,8 @@ SignWith: ${KEYID}
EOF EOF
# Options file # Options file
cat << EOF > ${DISTRIBUTION_FOLDER}/conf/options cat << EOF > ${DISTRIBUTION_REPOSITOIRY_FOLDER}/conf/options
basedir ${DISTRIBUTION_FOLDER} basedir ${DISTRIBUTION_REPOSITOIRY_FOLDER}
EOF EOF
#################################### ####################################
...@@ -93,17 +97,40 @@ echo "####################" ...@@ -93,17 +97,40 @@ echo "####################"
echo "## including debs ##" echo "## including debs ##"
echo "####################" echo "####################"
for package in packages/${DISTRIBUTION}*/*.deb; do for package in packages/${DISTRIBUTION}*/*.deb; do
reprepro --verbose --basedir ${DISTRIBUTION_FOLDER} includedeb ring ${package} reprepro --verbose --basedir ${DISTRIBUTION_REPOSITOIRY_FOLDER} includedeb ring ${package}
done done
# Rebuild the index # Rebuild the index
reprepro --verbose --basedir ${DISTRIBUTION_FOLDER} export ring reprepro --verbose --basedir ${DISTRIBUTION_REPOSITOIRY_FOLDER} export ring
#######################################
## create the manual download folder ##
#######################################
DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER=$(realpath manual-download)/${DISTRIBUTION}
mkdir -p ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
for package in packages/${DISTRIBUTION}*/*.deb; do
cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
package_name=$(dpkg -I ${package} | grep Package: | awk '{print $2}')
package_arch=$(dpkg -I ${package} | grep Architecture: | awk '{print $2}')
cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}/${package_name}_${package_arch}.deb
done
############
## deploy ##
############
# Deploy the repository # Deploy the repository
echo "##########################" echo "##########################"
echo "## deploying repository ##" echo "## deploying repository ##"
echo "##########################" echo "##########################"
rsync --archive --recursive --verbose --delete ${DISTRIBUTION_FOLDER} ${REMOTE_LOCATION} rsync --archive --recursive --verbose --delete ${DISTRIBUTION_REPOSITOIRY_FOLDER} ${REMOTE_REPOSITORY_LOCATION}
# deploy the manual download files
echo "#####################################"
echo "## deploying manual download files ##"
echo "#####################################"
rsync --archive --recursive --verbose --delete ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER} ${REMOTE_MANUAL_DOWNLOAD_LOCATION}
# Remove the local copy of the repository # remove deployed files
rm -rf manual-download
rm -rf repositories rm -rf repositories
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment