All checks were successful
Build docker image / build_docker_image (push) Successful in 3m49s
59 lines
1.5 KiB
Bash
Executable File
59 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo This is a sample build script, if the workflow cannot be used.
|
|
echo Please customize the repository address/name for your own.
|
|
|
|
|
|
PACKAGE_REPOSITORY=proxima.goliath.hu/proxima/backend
|
|
BUILD_TAG=nginx
|
|
UID=$(id -u)
|
|
GID=$(id -g)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Building "${BUILD_TAG}" package ..
|
|
echo
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Changing to project root directory...
|
|
|
|
pushd ../.. > /dev/null
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Building assets...
|
|
|
|
pushd src > /dev/null
|
|
npm run build
|
|
popd > /dev/null
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Determining tag name...
|
|
|
|
branch=$(git branch --show-current)
|
|
tag=${PACKAGE_TAG:-temp}
|
|
|
|
[[ $branch == dev ]] && tag=testing
|
|
[[ $branch == main ]] && tag=latest
|
|
[[ $branch == master ]] && tag=latest
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Building image...
|
|
|
|
docker build . \
|
|
--tag ${PACKAGE_REPOSITORY}:$tag \
|
|
--build-arg GROUP_ID=${GID} \
|
|
--build-arg USER_ID=${UID} \
|
|
--file build/${BUILD_TAG}/Dockerfile \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--provenance=false \
|
|
--sbom=false \
|
|
# --push \
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Changing back to build directory...
|
|
|
|
popd > /dev/null
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
echo Done.
|