-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update-artifact-upload-script-to-upload-to-yum-update-d…
…es-364'
- Loading branch information
Showing
4 changed files
with
129 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Usage: ./prepare-rpm-repository.sh <artifact dir> <app version> <repository dir> | ||
# | ||
# Will create an rpm repository in <repository dir> and add all .rpm files from | ||
# <artifact dir> matching <app version> to the repository. | ||
|
||
set -eu | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source "$SCRIPT_DIR/buildserver-config.sh" | ||
|
||
artifact_dir=$1 | ||
version=$2 | ||
repo_dir=$3 | ||
|
||
function create_repository { | ||
local arch_repo_dir=$1 | ||
local rpm_path=$2 | ||
|
||
mkdir -p "$arch_repo_dir" | ||
|
||
# Copy RPM file into repository | ||
cp "$rpm_path" "$arch_repo_dir"/ | ||
|
||
# Generate repository metadata files (containing among other things checksums | ||
# for the above artifact) | ||
createrepo_c "$arch_repo_dir" | ||
|
||
# Sign repository metadata (created by createrepo_c above) | ||
# --yes is passed to automatically overwrite existing files | ||
# in the case where the build server re-builds something we already | ||
# have built. | ||
gpg --detach-sign --armor --yes "$arch_repo_dir/repodata/repomd.xml" | ||
} | ||
|
||
for arch in "${SUPPORTED_RPM_ARCHITECTURES[@]}"; do | ||
rpm_path="$artifact_dir"/MullvadVPN-"$version"_"$arch".rpm | ||
if [[ ! -e "$rpm_path" ]]; then | ||
echo "RPM at $rpm_path does not exist" >&2 | ||
exit 1 | ||
fi | ||
create_repository "$repo_dir/$arch" "$rpm_path" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters