---
-include:
- - local: /gitlab/deploy-template.yaml
+# include:
+# - local: /gitlab/deploy-template.yaml
-# ---------------------------
-Deploy packages EL7:
- extends:
- - '.deploy-packages'
- variables:
- EL_MAJOR_VERSION: '7'
- needs:
- - 'Sign EL 7 packages'
- dependencies:
- - 'Sign EL 7 packages'
+# # ---------------------------
+# Deploy packages EL7:
+# extends:
+# - '.deploy-packages'
+# variables:
+# EL_MAJOR_VERSION: '7'
+# needs:
+# - 'Sign EL 7 packages'
+# dependencies:
+# - 'Sign EL 7 packages'
-# ---------------------------
-Deploy packages EL8:
- extends:
- - '.deploy-packages'
- variables:
- EL_MAJOR_VERSION: '8'
- needs:
- - 'Sign EL 8 packages'
- dependencies:
- - 'Sign EL 8 packages'
+# # ---------------------------
+# Deploy packages EL8:
+# extends:
+# - '.deploy-packages'
+# variables:
+# EL_MAJOR_VERSION: '8'
+# needs:
+# - 'Sign EL 8 packages'
+# dependencies:
+# - 'Sign EL 8 packages'
+
+# # ---------------------------
+# Deploy packages EL9:
+# extends:
+# - '.deploy-packages'
+# variables:
+# EL_MAJOR_VERSION: '9'
+# needs:
+# - 'Sign EL 9 packages'
+# dependencies:
+# - 'Sign EL 9 packages'
-# ---------------------------
-Deploy packages EL9:
- extends:
- - '.deploy-packages'
- variables:
- EL_MAJOR_VERSION: '9'
+#---------------------------
+variables:
+ PKG_NAME: 'some_python_package'
+ USED_SSH_PRIV_KEY_YUM_REPO: 'nada'
+ YUM_REPO_HOST: 'repo02.pixelpark.com'
+ YUM_REPO_USER: 'rpm-repo'
+ YUM_REPO_DIR_HTTP: '/Linux/yum/pixelpark'
+ YUM_REPO_DIR: "/srv/www/repo${YUM_REPO_DIR_HTTP}"
+
+#---------------------------
+Deploy packages:
+ rules:
+ - if: '$CI_COMMIT_TAG'
+ when: manual
+ allow_failure: true
+ - if: $CI_COMMIT_BRANCH == "master"
+ - if: $CI_COMMIT_BRANCH == "main"
+ - if: $CI_COMMIT_BRANCH == "test"
+ - if: $CI_COMMIT_BRANCH =~ /test-.*/
+ - if: $CI_COMMIT_BRANCH =~ /build.*/
+ stage: deploy
needs:
+ - 'Sign EL 7 packages'
+ - 'Sign EL 8 packages'
- 'Sign EL 9 packages'
dependencies:
+ - 'Sign EL 7 packages'
+ - 'Sign EL 8 packages'
- 'Sign EL 9 packages'
+ tags:
+ - deploy_v2
+ before_script:
+ - hostname -f
+ - whoami
+ - printf 'Uname '; uname -a
+ - |
+ echo
+ echo 'OS-Release:'
+ if [[ -f /etc/os-release ]] ; then
+ cat /etc/os-release
+ else
+ echo 'File /etc/os-release not found.' >&2
+ fi
+ - printf 'PWD '; pwd
+ - printf 'Which sendmail '; which sendmail || true
+ - printf 'Which mailx '; which mailx || true
+ - ls -lA --color=always
+ - find rpmdir/*RPMS -type f -print0 | xargs --null --no-run-if-empty ls -l -d --color=always
+ - 'echo -e "YUM_REPO_USER: ${YUM_REPO_USER}"'
+ - 'echo -e "YUM_REPO_HOST: ${YUM_REPO_HOST}"'
+ - 'echo -e "YUM_REPO_DIR: ${YUM_REPO_DIR}"'
+ - 'mkdir -pv "${HOME}/.ssh"'
+ - 'chmod -v 0700 "${HOME}/.ssh"'
+ - '/bin/echo "${USED_SSH_PRIV_KEY_YUM_REPO}" > "${HOME}/.ssh/id_rsa"'
+ - 'chmod -v 0600 "${HOME}/.ssh/id_rsa"'
+ - 'ls -lA --color=always "${HOME}/.ssh"'
+ - |
+ if [[ -f "${HOME}/.ssh/config" ]] ; then
+ echo "Content of ${HOME}/.ssh/config:"
+ cat "${HOME}/.ssh/config"
+ echo
+ fi
+ script:
+ - 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 "Deploying packages for EL version ${src_repo_dir} ..."
+ if [[ -z "$CI_COMMIT_TAG" ]] ; then
+ continue
+ fi
+ echo
+ src_repo_dir="${YUM_REPO_DIR}/${el_version}-src"
+ if [[ -n "$CI_COMMIT_TAG" ]] ; then
+ echo "Ensuring existence of ${YUM_REPO_HOST}:${src_repo_dir}/ ..."
+ # ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "if [ ! -d ${src_repo_dir} ] ; then mkdir -pv ${src_repo_dir} ; fi"
+ fi
+ if [[ -n "$CI_COMMIT_TAG" ]] ; then
+ echo "Deploying source packages to ${YUM_REPO_HOST}:${src_repo_dir}/ ..."
+ # scp -p -o StrictHostKeyChecking=no rpmdir/SRPMS/*.${el_version}.*.rpm "${YUM_REPO_USER}@${YUM_REPO_HOST}:${src_repo_dir}/"
+ # 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
+ bin_repo_dir="${YUM_REPO_DIR}/${el_version}"
+ if [[ -n "$CI_COMMIT_TAG" ]] ; then
+ echo "Ensuring existence of ${YUM_REPO_HOST}:${bin_repo_dir}/ ..."
+ # ssh -o StrictHostKeyChecking=no "${YUM_REPO_USER}@${YUM_REPO_HOST}" "if [ ! -d ${bin_repo_dir} ] ; then mkdir -pv ${bin_repo_dir} ; fi"
+ fi
+ if [[ -n "$CI_COMMIT_TAG" ]] ; then
+ echo "Deploying binary packages to ${YUM_REPO_HOST}:${bin_repo_dir}/ ..."
+ # scp -p -o StrictHostKeyChecking=no rpmdir/RPMS/*/*.rpm "${YUM_REPO_USER}@${YUM_REPO_HOST}:${bin_repo_dir}/"
+ # 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 "Finished with EL version ${src_repo_dir}."
+ done
+ after_script:
+ - rm -rf rpmdir
# vim: et tabstop=2 expandtab shiftwidth=2 softtabstop=2 list