diff --git a/.github/workflows/publish_ghcr_image.yaml b/.github/workflows/publish_ghcr_image.yaml index 78815783a..6240a8c82 100644 --- a/.github/workflows/publish_ghcr_image.yaml +++ b/.github/workflows/publish_ghcr_image.yaml @@ -6,6 +6,7 @@ env: IMAGE_NAME_UI: ${{ github.repository }}-ui on: + pull_request: push: tags: - '*' diff --git a/Makefile b/Makefile index 50d070b9d..a7ee8784c 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,7 @@ docker: ${DOCKERDIR}/${DOCKERFILE} echo "Version ${VERSION}" echo "CDP tag ${CDP_TAG}" echo "git describe $(shell git describe --tags --always --dirty)" + docker login ghcr.io -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERDIR}/${DOCKERFILE}" --build-arg VERSION="${VERSION}" . indocker-race: diff --git a/delivery.yaml b/delivery.yaml index 7eacd769b..45d435dca 100644 --- a/delivery.yaml +++ b/delivery.yaml @@ -20,9 +20,9 @@ pipeline: IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"} if [[ ${CDP_TARGET_BRANCH} == "master" && ${IS_PR_BUILD} != "true" ]] then - IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator + IMAGE=ghcr.io/zalando/postgres-operator else - IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-test + IMAGE=ghcr.io/zalando/postgres-operator-test fi export IMAGE make docker push @@ -49,9 +49,9 @@ pipeline: IS_PR_BUILD=${CDP_PULL_REQUEST_NUMBER+"true"} if [[ ${CDP_TARGET_BRANCH} == "master" && ${IS_PR_BUILD} != "true" ]] then - IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui + IMAGE=ghcr.io/zalando/postgres-operator-ui else - IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-ui-test + IMAGE=ghcr.io/zalando/postgres-operator-ui-test fi export IMAGE make docker @@ -67,6 +67,7 @@ pipeline: cmd: | cd logical-backup export TAG=$(git describe --tags --always --dirty) - IMAGE="registry-write.opensource.zalan.do/acid/logical-backup" + IMAGE="ghcr.io/zalando/logical-backup" + docker login ghcr.io -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" docker build --rm -t "$IMAGE:$TAG$CDP_TAG" . docker push "$IMAGE:$TAG$CDP_TAG" diff --git a/ui/Dockerfile b/ui/Dockerfile index 51f1d7744..a32b9c80d 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -15,18 +15,14 @@ LABEL maintainer="Team ACID @ Zalando " EXPOSE 8081 WORKDIR /app -RUN apt-get -qq -y update \ - # https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary - && apt-get -qq -y install --no-install-recommends g++ libpq-dev python3-dev python3-distutils \ - && apt-get -qq -y clean \ - && rm -rf /var/lib/apt/lists/* - -COPY requirements.txt . -COPY start_server.sh . -RUN pip install -r requirements.txt +COPY requirements.txt start_server.sh ./ +# Install dependencies for building psycopg2 from source as well +RUN dnf install libpq libpq-devel gcc -y \ + && pip install -r requirements.txt --no-cache-dir \ + && dnf remove libpq-devel gcc -y \ + && dnf clean all COPY operator_ui operator_ui/ -COPY --from=build /workdir/operator_ui/static/build/ operator_ui/static/build/ ARG VERSION=dev RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" operator_ui/__init__.py diff --git a/ui/Makefile b/ui/Makefile index 8f88982ab..ecd34a368 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -30,6 +30,7 @@ docker: appjs echo "Version ${VERSION}" echo "CDP tag ${CDP_TAG}" echo "git describe $(shell git describe --tags --always --dirty)" + docker login ghcr.io -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)" -f Dockerfile . push: