Generate all locale only in deloyment mode

pull/289/head
Rizky Maulana Nugraha 2021-01-27 20:42:40 +07:00
rodzic 0342801ab2
commit e703e86431
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F08C600969AC1656
2 zmienionych plików z 17 dodań i 0 usunięć

Wyświetl plik

@ -52,6 +52,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Do we need to generate locale?
id: is_generate_locale
if: github.ref == env.latest-ref
run: echo "::set-output name=is_generate::"
- name: Build base image
id: docker_build_base
uses: docker/build-push-action@v2
@ -61,6 +66,7 @@ jobs:
push: false
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
build-args: |
GENERATE_ALL_LOCALE=${{ steps.is_generate_locale.outputs.is_generate }}
DISTRO=${{ matrix.distro }}
IMAGE_VERSION=${{ matrix.imageVersion }}
IMAGE_VARIANT=${{ matrix.imageVariant }}
@ -189,6 +195,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Do we need to generate locale?
id: is_generate_locale
if: github.ref == env.latest-ref
run: echo "::set-output name=is_generate::"
- name: Build base image
id: docker_build_base
uses: docker/build-push-action@v2
@ -198,6 +209,7 @@ jobs:
push: ${{ github.ref == env.latest-ref }}
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
build-args: |
GENERATE_ALL_LOCALE=${{ steps.is_generate_locale.outputs.is_generate }}
DISTRO=${{ matrix.distro }}
IMAGE_VERSION=${{ matrix.imageVersion }}
IMAGE_VARIANT=${{ matrix.imageVariant }}

Wyświetl plik

@ -31,8 +31,13 @@ RUN chmod 0755 /gdal_install.sh;/bin/bash /gdal_install.sh
# Generating locales takes a long time. Utilize caching by runnig it by itself
# early in the build process.
# Generate all locale only on deployment mode build
# Set to empty string to generate only default locale
ARG GENERATE_ALL_LOCALE=1
COPY scripts/locale.gen /etc/locale.gen
RUN set -eux \
&& [[ (! -z "${GENERATE_ALL_LOCALE}") && (! $GENERATE_ALL_LOCALE -eq 0) ]] \
&& /usr/sbin/locale-gen
ENV LANG=en_US.UTF-8 \