-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use latest Fedora image and use RSA key type and curve for gpg key
No need to use %_topdir in specs, it is implicitly done setup-repo.sh: No need to pass `-r' to rpmbuild command, it was a wrong usage for our usecase Signed-off-by: Shreenidhi Shedi <[email protected]>
- Loading branch information
Showing
22 changed files
with
68 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM fedora:34 | ||
FROM fedora:latest | ||
|
||
COPY ci/prep.sh /prep.sh | ||
RUN chmod +x /prep.sh | ||
|
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 |
---|---|---|
|
@@ -8,22 +8,21 @@ | |
# | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "Usage: $0 <repo_path> <specs_dir>" | ||
echo "Usage: $0 <repo_path> <specs_dir>" >&2 | ||
exit 1 | ||
fi | ||
|
||
function fix_dir_perms() | ||
{ | ||
function fix_dir_perms() { | ||
chmod 755 ${TEST_REPO_DIR} | ||
find ${TEST_REPO_DIR} -type d -exec chmod 0755 {} \; | ||
find ${TEST_REPO_DIR} -type f -exec chmod 0644 {} \; | ||
} | ||
|
||
## used to check return code for each command. | ||
function check_err { | ||
rc=$? | ||
function check_err() { | ||
local rc=$? | ||
if [ $rc -ne 0 ]; then | ||
echo $1 | ||
echo "$1" >&2 | ||
exit $rc | ||
fi | ||
} | ||
|
@@ -37,7 +36,7 @@ fi | |
|
||
REPO_SRC_DIR=$2 | ||
if [ ! -d ${REPO_SRC_DIR} ]; then | ||
echo "specs dir does not exist" | ||
echo "ERROR: specs dir does not exist" >&2 | ||
exit 1 | ||
fi | ||
|
||
|
@@ -58,21 +57,21 @@ mkdir -p -m 755 ${BUILD_PATH}/BUILD \ | |
${TEST_REPO_DIR}/yum.repos.d \ | ||
${PUBLISH_PATH} \ | ||
${PUBLISH_SRC_PATH} \ | ||
${PUBLISH_SHA512_PATH} \ | ||
${PUBLISH_SHA512_PATH} \ | ||
${GNUPGHOME} | ||
|
||
#gpgkey data for unattended key generation | ||
cat << EOF > ${TEST_REPO_DIR}/gpgkeydata | ||
%echo Generating a key for repogpgcheck signatures | ||
%no-protection | ||
Key-Type: default | ||
Subkey-Type: default | ||
Name-Real: tdnf test | ||
Name-Comment: tdnf test key | ||
Name-Email: [email protected] | ||
Expire-Date: 0 | ||
%commit | ||
%echo done | ||
%echo Generating a key for repogpgcheck signatures | ||
%no-protection | ||
Key-Type: RSA | ||
Subkey-Type: RSA | ||
Name-Real: tdnf test | ||
Name-Comment: tdnf test key | ||
Name-Email: [email protected] | ||
Expire-Date: 0 | ||
%commit | ||
%echo done | ||
EOF | ||
|
||
#generate a key non interactively. this is used in testing | ||
|
@@ -90,12 +89,11 @@ for d in conflicts enhances obsoletes provides recommends requires suggests supp | |
sed s/@@dep@@/$d/ < ${REPO_SRC_DIR}/tdnf-repoquery-deps.spec.in > ${BUILD_PATH}/SOURCES/tdnf-repoquery-$d.spec | ||
done | ||
|
||
echo building packages | ||
echo "Building packages" | ||
for spec in ${REPO_SRC_DIR}/*.spec ${BUILD_PATH}/SOURCES/*.spec ; do | ||
echo "building ${spec}" | ||
rpmbuild --define "_topdir ${BUILD_PATH}" \ | ||
-r ${BUILD_PATH} -ba ${spec} 2>&1 | ||
check_err "failed to build ${spec}" | ||
echo "Building ${spec}" | ||
rpmbuild -D "_topdir ${BUILD_PATH}" -ba ${spec} 2>&1 | ||
check_err "ERROR: failed to build ${spec}" | ||
done | ||
rpmsign --addsign ${BUILD_PATH}/RPMS/*/*.rpm | ||
check_err "Failed to sign built packages." | ||
|
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 |
---|---|---|
|
@@ -19,19 +19,12 @@ Part of tdnf test spec. Test bad install scripts. | |
%build | ||
|
||
%install | ||
mkdir -p %_topdir/%buildroot/usr/bin | ||
cat << EOF >> %_topdir/%buildroot/usr/bin/bad-pre.sh | ||
#!/bin/sh | ||
# dummy script. Return false because we are bad. | ||
/bin/false | ||
EOF | ||
|
||
%pre | ||
# fail intentionally | ||
/bin/false | ||
%{_bindir}/false | ||
|
||
%files | ||
/usr/bin/bad-pre.sh | ||
|
||
%changelog | ||
* Fri Apr 2 2021 Oliver Kurth <[email protected]> 1.0.0-1 | ||
|
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
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
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
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
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
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