mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(ci): move rust docker target bash to shell script
This commit is contained in:
parent
79f7c973e7
commit
124da02a42
5 changed files with 139 additions and 19 deletions
42
ci/rust-docker-target.sh
Executable file
42
ci/rust-docker-target.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
#tag=
|
||||
#branch=
|
||||
#push=
|
||||
|
||||
build() {
|
||||
bin=$1
|
||||
extra=$2
|
||||
|
||||
f=$(mktemp)
|
||||
|
||||
cat > $f << EOF
|
||||
FROM alpine:latest
|
||||
COPY .docker-bin/$bin /bin/$bin
|
||||
$extra
|
||||
CMD ["/bin/$bin"]
|
||||
EOF
|
||||
|
||||
echo "building $dockerfile"
|
||||
|
||||
$dockerfile | docker build -t ghcr.io/pluralkit/$bin:$tag -f $f .
|
||||
|
||||
rm $f
|
||||
|
||||
if [ "$push" == "true" ]; then
|
||||
docker push ghcr.io/pluralkit/$bin:$tag
|
||||
docker image tag ghcr.io/pluralkit/$bin:$tag ghcr.io/pluralkit/$bin:$branch
|
||||
docker push ghcr.io/pluralkit/$bin:$branch
|
||||
if [ "$branch" == "main" ]; then
|
||||
docker image tag ghcr.io/pluralkit/$bin:$tag ghcr.io/pluralkit/$bin:latest
|
||||
docker push ghcr.io/pluralkit/$bin:latest
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# add rust binaries here to build
|
||||
build api
|
||||
build gateway
|
||||
build avatars
|
||||
Loading…
Add table
Add a link
Reference in a new issue