From 5e99a47ac1f9b77be01a22f6748c0c1f98e00814 Mon Sep 17 00:00:00 2001 From: Felix Schizlein Date: Tue, 6 Feb 2024 17:49:07 +0100 Subject: [PATCH] shell lint fixes and trailing whitespace --- .github/workflows/lint-unit.yml | 2 +- ci/rmt-build-rpm | 18 +++++++++--------- ci/rmt-configure | 8 ++++---- ci/rmt-run-feature-tests | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lint-unit.yml b/.github/workflows/lint-unit.yml index e6249533a..8b73c85c3 100644 --- a/.github/workflows/lint-unit.yml +++ b/.github/workflows/lint-unit.yml @@ -18,7 +18,7 @@ jobs: # those are: SLE15 (2.5.8, 2.5.9) ruby-version: ['2.5.8', '2.5.9'] # skipping Ruby3 tests for now, because RMT isn't Ruby3 compatible yet, and the failing - # tests confuse the team. + # tests confuse the team. # ruby-version: ['2.5.8', '2.5.9', '3.0.3'] services: diff --git a/ci/rmt-build-rpm b/ci/rmt-build-rpm index 128824f16..6e1aa8436 100755 --- a/ci/rmt-build-rpm +++ b/ci/rmt-build-rpm @@ -13,31 +13,31 @@ ARTIFACT_DIR=${ARTIFACT_DIR:-$SOURCE/tmp/artifacts} # Current version we are working with VERSION=$(ruby -r "$SOURCE/lib/rmt" -e 'print RMT::VERSION') -group() { echo "::group::$@"; } +group() { echo "::group::$1"; } groupend() { echo "::groupend::"; } -fail() { echo "::error::$@"; exit 1;} +fail() { echo "::error::$1"; exit 1;} # Setup artifact dir -mkdir -p $ARTIFACT_DIR +mkdir -p "$ARTIFACT_DIR" group "create rmt-server tarball" -pushd $SOURCE +pushd "$SOURCE" make dist - cp $SOURCE/package/obs/rmt-server-$VERSION.tar.bz2 $ARTIFACT_DIR + cp "$SOURCE/package/obs/rmt-server-$VERSION.tar.bz2" "$ARTIFACT_DIR" popd groupend group "prepare build environment (in $BUILD_DIR)" -pushd $BUILD_DIR +pushd "$BUILD_DIR" mkdir -p {BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS,OTHERS} - cp -r $SOURCE/package/obs/* SOURCES/ + cp -r "$SOURCE/package/obs/*" SOURCES/ popd groupend group "build rmt-server-$VERSION.x86_64.rpm" pushd $BUILD_DIR rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature --undefine _enable_debug_packages SOURCES/rmt-server.spec - cp -r RPMS/x86_64/rmt-server-$VERSION*.rpm $ARTIFACT_DIR/ - cp -r RPMS/x86_64/rmt-server-config-$VERSION*.rpm $ARTIFACT_DIR/ + cp -r "RPMS/x86_64/rmt-server-$VERSION*.rpm" "$ARTIFACT_DIR/" + cp -r "RPMS/x86_64/rmt-server-config-$VERSION*.rpm" "$ARTIFACT_DIR/" popd groupend diff --git a/ci/rmt-configure b/ci/rmt-configure index 35f619e4e..7b44f33ad 100755 --- a/ci/rmt-configure +++ b/ci/rmt-configure @@ -34,7 +34,7 @@ group() { echo "::group::$@"; } groupend() { echo "::groupend::"; } fail() { echo "::error::$@"; exit 1; } -if [ "x$SCC_PASSWORD" = "x" ] || [ "x$SCC_USERNAME" = "x" ]; then +if [ "$SCC_PASSWORD" = "" ] || [ "$SCC_USERNAME" = "" ]; then fail "To correctly configure RMT environment variables \$SCC_USERNAME and \$SCC_PASSWORD are required. Check your environment!" fi @@ -45,8 +45,8 @@ group "setup system uuid" groupend group "install rmt-server rpms" -pushd $BUILD_DIR/RPMS/x86_64 - zypper --non-interactive --no-refresh install --allow-unsigned-rpm $RPMS +pushd "$BUILD_DIR/RPMS/x86_64" + zypper --non-interactive --no-refresh install --allow-unsigned-rpm "$RPMS" popd groupend @@ -71,7 +71,7 @@ EOL groupend group "setup database" -pushd $INSTALL_DIR +pushd "$INSTALL_DIR" RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rails db:drop db:create db:migrate popd groupend diff --git a/ci/rmt-run-feature-tests b/ci/rmt-run-feature-tests index 66cb4d61d..6e5ee8dca 100755 --- a/ci/rmt-run-feature-tests +++ b/ci/rmt-run-feature-tests @@ -4,7 +4,7 @@ set -e # Where is the rmt-server source code located SOURCE=${SOURCE:-/usr/src/rmt-server} -group() { echo "::group::$@"; } +group() { echo "::group::$1"; } groupend() { echo "::groupend::"; } group "synchronize SCC product/repositories" @@ -12,7 +12,7 @@ group "synchronize SCC product/repositories" groupend group "run feature tests" -pushd $SOURCE +pushd "$SOURCE" NO_COVERAGE=true bundle exec rspec features/ popd groupend