mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 12:22:17 +01:00
chore: improving scripts and add thecodingmachine to edge release
This commit is contained in:
1
.github/workflows/continuous_integration.yml
vendored
1
.github/workflows/continuous_integration.yml
vendored
@@ -63,3 +63,4 @@ jobs:
|
|||||||
- name: Build and push Docker image for main branch
|
- name: Build and push Docker image for main branch
|
||||||
run: |
|
run: |
|
||||||
make release GOTENBERG_VERSION=edge
|
make release GOTENBERG_VERSION=edge
|
||||||
|
make release GOTENBERG_VERSION=edge DOCKER_REPOSITORY=thecodingmachine
|
||||||
@@ -10,23 +10,7 @@ NOTO_COLOR_EMOJI_VERSION="$5"
|
|||||||
PDFTK_VERSION="$6"
|
PDFTK_VERSION="$6"
|
||||||
DOCKER_REPOSITORY="$7"
|
DOCKER_REPOSITORY="$7"
|
||||||
|
|
||||||
if [ $GOTENBERG_VERSION == "edge" ]; then
|
if [ "$GOTENBERG_VERSION" == "edge" ]; then
|
||||||
# docker buildx build \
|
|
||||||
# --build-arg GOLANG_VERSION="$GOLANG_VERSION" \
|
|
||||||
# --build-arg GOTENBERG_VERSION="$GOTENBERG_VERSION" \
|
|
||||||
# --build-arg GOTENBERG_USER_GID="$GOTENBERG_USER_GID" \
|
|
||||||
# --build-arg GOTENBERG_USER_UID="$GOTENBERG_USER_UID" \
|
|
||||||
# --build-arg NOTO_COLOR_EMOJI_VERSION="$NOTO_COLOR_EMOJI_VERSION" \
|
|
||||||
# --build-arg PDFTK_VERSION="$PDFTK_VERSION" \
|
|
||||||
# --platform linux/amd64 \
|
|
||||||
# --platform linux/arm64 \
|
|
||||||
# --platform linux/arm/v7 \
|
|
||||||
# --platform linux/386 \
|
|
||||||
# -t "$DOCKER_REPOSITORY/gotenberg:edge" \
|
|
||||||
# --push \
|
|
||||||
# -f build/Dockerfile .
|
|
||||||
|
|
||||||
# FIXME: --platform linux/arm/v7 (armhf) not working.
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--build-arg GOLANG_VERSION="$GOLANG_VERSION" \
|
--build-arg GOLANG_VERSION="$GOLANG_VERSION" \
|
||||||
--build-arg GOTENBERG_VERSION="$GOTENBERG_VERSION" \
|
--build-arg GOTENBERG_VERSION="$GOTENBERG_VERSION" \
|
||||||
@@ -36,6 +20,7 @@ if [ $GOTENBERG_VERSION == "edge" ]; then
|
|||||||
--build-arg PDFTK_VERSION="$PDFTK_VERSION" \
|
--build-arg PDFTK_VERSION="$PDFTK_VERSION" \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
--platform linux/arm64 \
|
--platform linux/arm64 \
|
||||||
|
--platform linux/arm/v7 \
|
||||||
--platform linux/386 \
|
--platform linux/386 \
|
||||||
-t "$DOCKER_REPOSITORY/gotenberg:edge" \
|
-t "$DOCKER_REPOSITORY/gotenberg:edge" \
|
||||||
--push \
|
--push \
|
||||||
@@ -55,12 +40,12 @@ if [ $GOTENBERG_VERSION == "edge" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
GOTENBERG_VERSION="${GOTENBERG_VERSION//v}"
|
GOTENBERG_VERSION="${GOTENBERG_VERSION//v}"
|
||||||
SEMVER=( ${GOTENBERG_VERSION//./ } )
|
IFS='.' read -ra SEMVER <<< "$GOTENBERG_VERSION"
|
||||||
VERSION_LENGTH=${#SEMVER[@]}
|
VERSION_LENGTH=${#SEMVER[@]}
|
||||||
|
|
||||||
if [ $VERSION_LENGTH -ne 3 ]; then
|
if [ "$VERSION_LENGTH" -ne 3 ]; then
|
||||||
echo "$VERSION is not semver."
|
echo "$VERSION is not semver."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ HAS_CONSISTENT_RIGHTS=$?
|
|||||||
|
|
||||||
if [[ "$HAS_CONSISTENT_RIGHTS" != "0" ]]; then
|
if [[ "$HAS_CONSISTENT_RIGHTS" != "0" ]]; then
|
||||||
# If not specified, the DOCKER_USER is the owner of the current working directory (heuristic!).
|
# If not specified, the DOCKER_USER is the owner of the current working directory (heuristic!).
|
||||||
DOCKER_USER=`ls -dl $(pwd) | cut -d " " -f 3`
|
DOCKER_USER=$(stat -c '%U' "$(pwd)")
|
||||||
else
|
else
|
||||||
# macOs or Windows.
|
# macOs or Windows.
|
||||||
# Note: in most cases, we don't care about the rights (they are not respected).
|
# Note: in most cases, we don't care about the rights (they are not respected).
|
||||||
FILE_OWNER=`ls -dl testing_file_system_rights.foo/foo | cut -d " " -f 3`
|
FILE_OWNER=$(stat -c '%U' "testing_file_system_rights.foo/foo")
|
||||||
if [[ "$FILE_OWNER" == "root" ]]; then
|
if [[ "$FILE_OWNER" == "root" ]]; then
|
||||||
# If root, we are likely on a Windows host.
|
# If root, we are likely on a Windows host.
|
||||||
# All files will belong to root, but it does not matter as everybody can write/delete
|
# All files will belong to root, but it does not matter as everybody can write/delete
|
||||||
@@ -38,11 +38,11 @@ unset HAS_CONSISTENT_RIGHTS
|
|||||||
# DOCKER_USER is an ID.
|
# DOCKER_USER is an ID.
|
||||||
if [[ "$DOCKER_USER" =~ ^[0-9]+$ ]] ; then
|
if [[ "$DOCKER_USER" =~ ^[0-9]+$ ]] ; then
|
||||||
# Let's change the gotenberg user's ID in order to match this free ID.
|
# Let's change the gotenberg user's ID in order to match this free ID.
|
||||||
usermod -u $DOCKER_USER -G sudo gotenberg
|
usermod -u "$DOCKER_USER" -G sudo gotenberg
|
||||||
DOCKER_USER=gotenberg
|
DOCKER_USER=gotenberg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DOCKER_USER_ID=`id -ur $DOCKER_USER`
|
DOCKER_USER_ID=$(id -ur $DOCKER_USER)
|
||||||
|
|
||||||
# Fix access rights to stdout and stderr.
|
# Fix access rights to stdout and stderr.
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
Reference in New Issue
Block a user