Skip to content

Commit

Permalink
use volume to avoid having to rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
vilmibm committed Jan 27, 2021
1 parent 773c8b3 commit 7479b38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
mkdir -p site/packages/rpm
cp dist/*.rpm site/packages/rpm/
./script/createrepo.sh
cp -r repodata site/packages/rpm/
cp -r dist/repodata site/packages/rpm/
pushd site/packages/rpm
gpg --yes --detach-sign --armor repodata/repomd.xml
popd
Expand Down
18 changes: 3 additions & 15 deletions script/createrepo.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
#!/bin/bash
set -e
# This script:

# - creates a dockerfile
# - prepares a docker image that can run `createrepo` that has the latest release rpms
# - "runs" the image by creating a throwaay container
# - copies the result of createrepo out of the throwaway container
# - destroys the throwaway container
mkdir -p createrepo/dist
mkdir createrepo
cat > createrepo/Dockerfile << EOF
FROM fedora:32
RUN yum install -y createrepo_c
RUN mkdir /packages
COPY dist/*.rpm /packages/
RUN createrepo /packages
ENTRYPOINT ["createrepo", "/packages"]
EOF

cp dist/*.rpm createrepo/dist/
docker build -t createrepo createrepo/
docker create -ti --name runcreaterepo createrepo bash
docker cp runcreaterepo:/packages/repodata .
docker rm -f runcreaterepo
docker run --rm --volume "$PWD/dist":/packages createrepo
rm -rf createrepo

0 comments on commit 7479b38

Please sign in to comment.