Skip to content

Commit

Permalink
make ppa-deploy more reusable
Browse files Browse the repository at this point in the history
publish_ppa=yes
  • Loading branch information
nqb committed Jan 10, 2023
1 parent 04111da commit 47e7c16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ variables:
variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
GITLAB_DEPLOY_DIR: ${CI_PIPELINE_ID}
PPA_ID: ${CI_PIPELINE_ID}
tags:
- shell

Expand Down
7 changes: 5 additions & 2 deletions ci/lib/upload/deploy-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ DEPLOY_HOST=${DEPLOY_HOST:-web.inverse.ca}

PUBLIC_REPO_BASE_DIR=${PUBLIC_REPO_BASE_DIR:-/var/www/inverse.ca/downloads/PacketFence}

# CI
CI_PLATFORM=${CI_PLATFORM:-gitlab}

# RPM
DEPLOY_SRPMS=${DEPLOY_SRPMS:-no}
RPM_BASE_DIR=${RPM_BASE_DIR:-"${PUBLIC_REPO_BASE_DIR}"}
Expand All @@ -34,7 +37,7 @@ DEB_DEPLOY_DIR=${DEB_DEPLOY_DIR:-foo}
DEB_RESULT_DIR=${DEB_RESULT_DIR:-"${RESULT_DIR}/debian"}

# Maintenance
GITLAB_DEPLOY_DIR=${GITLAB_DEPLOY_DIR:-tmp}
PPA_ID=${PPA_ID:-tmp}

# CI
# automatically set up by CI based on environment
Expand Down Expand Up @@ -168,7 +171,7 @@ packetfence_ci_lib_deploy() {
ppa_deploy() {
# warning: slashs at end of dirs are significant for rsync
src_dir="$PUBLIC_DIR/"
dst_repo="$PUBLIC_REPO_BASE_DIR/gitlab/$GITLAB_DEPLOY_DIR/"
dst_repo="$PUBLIC_REPO_BASE_DIR/$CI_PLATFORM/$PPA_ID/"
dst_dir="$DEPLOY_USER@$DEPLOY_HOST:$dst_repo"
declare -p src_dir dst_dir
echo "rsync: $src_dir -> $dst_dir"
Expand Down

0 comments on commit 47e7c16

Please sign in to comment.