- echo "Packages to deploy:"; find rpmdir/*RPMS -type f -print0 | xargs --null --no-run-if-empty ls -l -d --color=always
- |
for el_version in 7 8 9 ; do
- echo
+ echo ' '
echo "Deploying packages for EL version ${el_version} ..."
- # if [[ -z "$CI_COMMIT_TAG" ]] ; then
- # continue
- # fi
- echo
+ if [[ -z "$CI_COMMIT_TAG" ]] ; then
+ echo "Deploy will not be done, not a tag."
+ continue
+ fi
+ echo ' '
src_repo_dir="${YUM_REPO_DIR}/${el_version}-src"
echo "Ensuring existence of ${YUM_REPO_HOST}:${src_repo_dir}/ ..."
- if [[ -n "$CI_COMMIT_TAG" || 1 == 1 ]] ; then
- echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"if [ ! -d ${src_repo_dir} ] ; then mkdir -pv ${src_repo_dir} ; fi\""
- # ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "if [ ! -d ${src_repo_dir} ] ; then mkdir -pv ${src_repo_dir} ; fi"
- fi
+ echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"if [ ! -d ${src_repo_dir} ] ; then mkdir -pv ${src_repo_dir} ; fi\""
+ ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "if [ ! -d ${src_repo_dir} ] ; then mkdir -pv ${src_repo_dir} ; fi"
echo "Deploying source packages to ${YUM_REPO_HOST}:${src_repo_dir}/ ..."
ls -l --color=auto rpmdir/SRPMS/*.el${el_version}.*.rpm
- if [[ -n "$CI_COMMIT_TAG" || 1 == 1 ]] ; then
- echo "scp -p -o StrictHostKeyChecking=no rpmdir/SRPMS/*.el${el_version}.*.rpm \"${YUM_REPO_USER}@${YUM_REPO_HOST}:${src_repo_dir}/\""
- # scp -p -o StrictHostKeyChecking=no rpmdir/SRPMS/*.el${el_version}.*.rpm "${YUM_REPO_USER}@${YUM_REPO_HOST}:${src_repo_dir}/"
- echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"cd ${src_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata\""
- # ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "cd ${src_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata"
- fi
- echo
+ echo "scp -p -o StrictHostKeyChecking=no rpmdir/SRPMS/*.el${el_version}.*.rpm \"${YUM_REPO_USER}@${YUM_REPO_HOST}:${src_repo_dir}/\""
+ scp -p -o StrictHostKeyChecking=no rpmdir/SRPMS/*.el${el_version}.*.rpm "${YUM_REPO_USER}@${YUM_REPO_HOST}:${src_repo_dir}/"
+ echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"cd ${src_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata\""
+ ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "cd ${src_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata"
+ echo ' '
bin_repo_dir="${YUM_REPO_DIR}/${el_version}"
echo "Ensuring existence of ${YUM_REPO_HOST}:${bin_repo_dir}/ ..."
- if [[ -n "$CI_COMMIT_TAG" || 1 == 1 ]] ; then
- echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"if [ ! -d ${bin_repo_dir} ] ; then mkdir -pv ${bin_repo_dir} ; fi\""
- # ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "if [ ! -d ${bin_repo_dir} ] ; then mkdir -pv ${bin_repo_dir} ; fi"
- fi
+ echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"if [ ! -d ${bin_repo_dir} ] ; then mkdir -pv ${bin_repo_dir} ; fi\""
+ ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "if [ ! -d ${bin_repo_dir} ] ; then mkdir -pv ${bin_repo_dir} ; fi"
echo "Deploying binary packages to ${YUM_REPO_HOST}:${bin_repo_dir}/ ..."
ls -l --color=auto rpmdir/RPMS/*/*.el${el_version}.*.rpm
- if [[ -n "$CI_COMMIT_TAG" || 1 == 1 ]] ; then
- echo "scp -p -o StrictHostKeyChecking=no rpmdir/RPMS/*/*.el${el_version}.*.rpm \"${YUM_REPO_USER}@${YUM_REPO_HOST}:${bin_repo_dir}/\""
- # scp -p -o StrictHostKeyChecking=no rpmdir/RPMS/*/*.el${el_version}.*.rpm "${YUM_REPO_USER}@${YUM_REPO_HOST}:${bin_repo_dir}/"
- echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"cd ${bin_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata\""
- # ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "cd ${bin_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata"
- fi
+ echo "scp -p -o StrictHostKeyChecking=no rpmdir/RPMS/*/*.el${el_version}.*.rpm \"${YUM_REPO_USER}@${YUM_REPO_HOST}:${bin_repo_dir}/\""
+ scp -p -o StrictHostKeyChecking=no rpmdir/RPMS/*/*.el${el_version}.*.rpm "${YUM_REPO_USER}@${YUM_REPO_HOST}:${bin_repo_dir}/"
+ echo "ssh -o StrictHostKeyChecking=no \"${YUM_REPO_USER}@${YUM_REPO_HOST}\" \"cd ${bin_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata\""
+ ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "cd ${bin_repo_dir}/ && createrepo --update . && chmod -v a+x repodata && chmod -Rv a+r repodata"
echo "Finished with EL version ${src_repo_dir}."
done
after_script: