Skip to content

Commit

Permalink
feat: Add creation of RPM repos
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmunday committed Mar 16, 2024
1 parent c61dfa0 commit 5ff93c2
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,29 @@ jobs:
run: |
cp README.md pages/index.md
cp CHANGELOG.md TEMPLATES.md pages/
mkdir -p pages/tests/unit pages/tests/integration pages/tests/integration/docker-slurm
mkdir -p pages/repo pages/tests/unit pages/tests/integration pages/tests/integration/docker-slurm
cp tests/unit/README.md pages/tests/unit/index.md
cp tests/integration/README.md pages/tests/integration/index.md
cp tests/integration/docker-slurm/README.md pages/tests/integration/docker-slurm/index.md
sed -i 's#../../#https://github.com/neilmunday/slurm-mail/blob/main/#g' pages/tests/integration/index.md
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install required packages
run: |
sudo apt update
sudo apt install -y jq createrepo-c
- name: Create repos
env:
GH_TOKEN: ${{ github.token }}
run: |
build-tools/create-repos.sh -o $(realpath pages/repo)
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./pages
destination: ./_site
- name: Set permissions on the _site directory
run: sudo chown -R runner:docker _site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

Expand Down
101 changes: 101 additions & 0 deletions build-tools/create-repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

#
# This file is part of Slurm-Mail.
#
# Slurm-Mail is a drop in replacement for Slurm's e-mails to give users
# much more information about their jobs compared to the standard Slurm
# e-mails.
#
# Copyright (C) 2018-2024 Neil Munday (neil@mundayweb.com)
#
# Slurm-Mail is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# Slurm-Mail is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Slurm-Mail. If not, see <http://www.gnu.org/licenses/>.
#

#
# This is a helper script to create package repos for the latest
# release of Slurm-Mail.
#

set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

source $DIR/common.sh

function usage {
echo "Usage: $0 -o path" 1>&2
echo " -o output path"
exit 1
}

while getopts ":o:" options; do
case "${options}" in
o)
OUTPUT_DIR=${OPTARG}
;;
:)
echo "Error: -${OPTARG} requires a value"
usage
;;
*)
usage
;;
esac
done

if [ -z $OUTPUT_DIR ]; then
usage
fi

check_dir $OUTPUT_DIR

echo "repos will be written to: $OUTPUT_DIR"

RHEL_OSES="
amzn2
el7
el8
el9
sl15
"

for OS in $RHEL_OSES; do
cd $DIR
echo "processing: $OS"
REPO_DIR="$OUTPUT_DIR/$OS"
mkdir -p $REPO_DIR
echo "downloading RPM..."
gh release download --pattern "*${OS}.noarch.rpm" -D $REPO_DIR
echo "creating repo"
cd $REPO_DIR
createrepo_c .
done

DEB_OSES="
ub20
ub22
"

#@TODO: support creation of debian repos

#for OS in $DEB_OSES; do
# cd $DIR
# echo "processing: $OS"
# REPO_DIR="$OUTPUT_DIR/$OS"
# mkdir -p $REPO_DIR
# echo "downloading DEB..."
# gh release download --pattern "*${OS}-ubuntu1_all.deb" -D $REPO_DIR
# cd $REPO_DIR
#done

0 comments on commit 5ff93c2

Please sign in to comment.