Skip to content

Commit

Permalink
Change port 4 deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
JeGoi committed Jun 12, 2023
1 parent 1b4a20d commit 062e017
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ variables:
variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_PORT: 444
PPA_ID: ${CI_PIPELINE_ID}
tags:
- shell
Expand All @@ -444,6 +445,7 @@ variables:
variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_PORT: 444
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh deb
tags:
Expand All @@ -456,6 +458,7 @@ variables:
variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_PORT: 444
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh deb
tags:
Expand All @@ -469,6 +472,7 @@ variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_SRPMS: "no"
DEPLOY_PORT: 444
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh rpm
tags:
Expand All @@ -482,6 +486,7 @@ variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_SRPMS: "no"
DEPLOY_PORT: 444
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh rpm
tags:
Expand All @@ -494,6 +499,7 @@ variables:
variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_PORT: 444
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-release
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-export
Expand All @@ -509,6 +515,7 @@ variables:
variables:
DEPLOY_USER: reposync
DEPLOY_HOST: web.inverse.ca
DEPLOY_PORT: 444
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh website
tags:
Expand Down
25 changes: 13 additions & 12 deletions ci/lib/upload/deploy-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PUBLIC_DIR=${PUBLIC_DIR:-public}

DEPLOY_USER=${DEPLOY_USER:-reposync}
DEPLOY_HOST=${DEPLOY_HOST:-web.inverse.ca}
DEPLOY_PORT=${DEPLOY_PORT:-444}

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

Expand Down Expand Up @@ -56,7 +57,7 @@ rpm_deploy() {
# repodata dir will be created by createrepo command
mkdir_cmd="$DEPLOY_USER@$DEPLOY_HOST mkdir -p $rpm_dir"
echo "running following command: $mkdir_cmd"
ssh $mkdir_cmd \
ssh -p $DEPLOY_PORT $mkdir_cmd \
|| die "remote mkdir failed"

if [ "$DEPLOY_SRPMS" == "no" ]; then
Expand All @@ -68,13 +69,13 @@ rpm_deploy() {

# copy rpm files
echo "copy: $src_dir/*.rpm -> $dst_dir"
scp $src_dir/*.rpm $dst_dir \
scp -P $DEPLOY_PORT $src_dir/*.rpm $dst_dir \
|| die "scp failed"

# update repository
dst_cmd="$DEPLOY_USER@$DEPLOY_HOST $deploy_cmd"
echo "running following command: $dst_cmd"
ssh $dst_cmd \
ssh -p $DEPLOY_PORT $dst_cmd \
|| die "update failed"
done
}
Expand All @@ -90,18 +91,18 @@ deb_deploy() {
# dest repo need to exist + conf directory
mkdir_cmd="$DEPLOY_USER@$DEPLOY_HOST mkdir -p $dst_repo/conf"
echo "running following command: $mkdir_cmd"
ssh $mkdir_cmd \
ssh -p $DEPLOY_PORT $mkdir_cmd \
|| die "remote mkdir failed"

echo "copy: $src_dir/* -> $dst_dir"
scp $src_dir/* $dst_dir/ \
scp -P $DEPLOY_PORT $src_dir/* $dst_dir/ \
|| die "scp failed"

deploy_cmd="/usr/local/bin/ci-repo-deploy deb $dst_repo $CI_ENV_NAME"
dst_cmd="$DEPLOY_USER@$DEPLOY_HOST $deploy_cmd"
extra_args="${release_name} ${changes_file}"
echo "running following command: $dst_cmd $extra_args"
ssh $dst_cmd $extra_args \
ssh -p $DEPLOY_PORT $dst_cmd $extra_args \
|| die "update failed"
done
}
Expand All @@ -117,7 +118,7 @@ packetfence_release_deploy() {
declare -p src_dir dst_dir pf_release_rpm_file pkg_dest_name

echo "scp: ${src_dir}/${pf_release_rpm_file} -> ${dst_dir}/${pkg_dest_name}"
scp "${src_dir}/${pf_release_rpm_file}" "${dst_dir}/${pkg_dest_name}" \
scp -P $DEPLOY_PORT "${src_dir}/${pf_release_rpm_file}" "${dst_dir}/${pkg_dest_name}" \
|| die "scp failed"
done
}
Expand All @@ -134,7 +135,7 @@ packetfence_export_deploy() {
declare -p src_dir dst_dir pf_export_rpm_file pf_export_rpm_dest_name

echo "scp: ${src_dir}/${pf_export_rpm_file} -> ${dst_dir}/${pf_export_rpm_dest_name}"
scp "${src_dir}/${pf_export_rpm_file}" "${dst_dir}/${pf_export_rpm_dest_name}" \
scp -P $DEPLOY_PORT "${src_dir}/${pf_export_rpm_file}" "${dst_dir}/${pf_export_rpm_dest_name}" \
|| die "scp failed"
done
# Deb
Expand All @@ -147,7 +148,7 @@ packetfence_export_deploy() {
declare -p src_dir dst_dir pf_export_deb_file pf_export_deb_dest_name

echo "scp: ${src_dir}/${pf_export_deb_file} -> ${dst_dir}/${pf_export_deb_dest_name}"
scp "${src_dir}/${pf_export_deb_file}" "${dst_dir}/${pf_export_deb_dest_name}" \
scp -P $DEPLOY_PORT "${src_dir}/${pf_export_deb_file}" "${dst_dir}/${pf_export_deb_dest_name}" \
|| die "scp failed"
done
}
Expand All @@ -163,7 +164,7 @@ packetfence_ci_lib_deploy() {
declare -p src_dir dst_dir pf_ci_lib_deb_file pf_ci_lib_deb_dest_name

echo "scp: ${src_dir}/${pf_ci_lib_deb_file} -> ${dst_dir}/${pf_ci_lib_deb_dest_name}"
scp "${src_dir}/${pf_ci_lib_deb_file}" "${dst_dir}/${pf_ci_lib_deb_dest_name}" \
scp -P $DEPLOY_PORT "${src_dir}/${pf_ci_lib_deb_file}" "${dst_dir}/${pf_ci_lib_deb_dest_name}" \
|| die "scp failed"
done
}
Expand All @@ -175,7 +176,7 @@ ppa_deploy() {
dst_dir="$DEPLOY_USER@$DEPLOY_HOST:$dst_repo"
declare -p src_dir dst_dir
echo "rsync: $src_dir -> $dst_dir"
rsync -avz $src_dir $dst_dir \
rsync -avz -e "ssh -p $DEPLOY_PORT" $src_dir $dst_dir \
|| die "rsync failed"
}

Expand All @@ -187,7 +188,7 @@ website_deploy() {
dst_dir="$DEPLOY_USER@$DEPLOY_HOST:$dst_repo"
declare -p src_dir dst_dir
echo "rsync: $src_dir -> $dst_dir"
rsync -avz $src_dir $dst_dir \
rsync -avz -e "ssh -p $DEPLOY_PORT" $src_dir $dst_dir \
|| die "rsync failed"
}

Expand Down

0 comments on commit 062e017

Please sign in to comment.