addet workflows!
Some checks failed
Build and Push to Forgejo Registry / build (push) Has been cancelled
Some checks failed
Build and Push to Forgejo Registry / build (push) Has been cancelled
This commit is contained in:
parent
0683f18868
commit
9d952d0a70
2 changed files with 24 additions and 53 deletions
42
build.sh
42
build.sh
|
@ -35,37 +35,15 @@ tag=latest
|
|||
|
||||
container="${domain}/${image}:${tag}"
|
||||
|
||||
askToPush() {
|
||||
echo_info "Do you want to push directly to $domain?"
|
||||
read -r push_
|
||||
|
||||
case "$push_" in
|
||||
[yY])
|
||||
push=true
|
||||
;;
|
||||
[nN])
|
||||
push=false
|
||||
;;
|
||||
*)
|
||||
echo_warning "You entered something wrong!"
|
||||
askToPush
|
||||
;;
|
||||
esac
|
||||
|
||||
if $push; then
|
||||
docker push "$container"
|
||||
fi
|
||||
}
|
||||
|
||||
if ! command_exists docker; then
|
||||
echo_error "Docker does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ ! -e ./Dockerfile ]] &&
|
||||
echo_error "Dockerfile does not exist" &&
|
||||
exit 1
|
||||
|
||||
# if ! command_exists docker; then
|
||||
# echo_error "Docker does not exist!"
|
||||
# exit 1
|
||||
# fi
|
||||
#
|
||||
# [[ ! -e ./Dockerfile ]] &&
|
||||
# echo_error "Dockerfile does not exist" &&
|
||||
# exit 1
|
||||
#
|
||||
docker build -t "$container" .
|
||||
|
||||
askToPush
|
||||
docker push "$container"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue