diff --git a/.circleci/config.yml b/.circleci/config.yml index e3fc5cc9..a37362ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -906,6 +906,38 @@ workflows: branches: only: main + - approve-postgres-operator: + type: approval + - build: + name: build-postgres-operator + directory: postgres-operator + requires: + - approve-postgres-operator + - run_pre_commit + - test: + name: test-postgres-operator + directory: postgres-operator + test_script: bin/test.py + test_requirements: requirements/test-requirements.txt + requires: + - build-postgres-operator + - scan-trivy: + name: scan-trivy-postgres-operator + directory: postgres-operator + requires: + - test-postgres-operator + - release: + name: release-postgres-operator + directory: postgres-operator + context: + - quay.io + - docker.io + requires: + - scan-trivy-postgres-operator + filters: + branches: + only: main + - approve-postgresql: type: approval - build: diff --git a/docker-compose.yaml b/docker-compose.yaml index b7f755c8..0b4c63ca 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -128,6 +128,11 @@ services: image: ap-postgres-exporter:${ASTRO_IMAGE_TAG:-latest} build: context: postgres-exporter + ap-postgres-operator: + image: ap-postgres-operator:${ASTRO_IMAGE_TAG:-latest} + build: + context: postgres-operator + entrypoint: "/bin/sleep 1m" ap-postgresql: image: ap-postgresql:${ASTRO_IMAGE_TAG:-latest} build: diff --git a/postgres-operator/Dockerfile b/postgres-operator/Dockerfile new file mode 100644 index 00000000..7d9bacd3 --- /dev/null +++ b/postgres-operator/Dockerfile @@ -0,0 +1,22 @@ +# +# Copyright 2016 Astronomer Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#https://github.com/zalando/postgres-operator/tags +FROM registry.opensource.zalan.do/acid/postgres-operator:v1.8.1 +LABEL maintainer="Astronomer " + +ARG BUILD_NUMBER=-1 +LABEL io.astronomer.docker=true +LABEL io.astronomer.docker.build.number=$BUILD_NUMBER diff --git a/postgres-operator/test.yaml b/postgres-operator/test.yaml new file mode 100644 index 00000000..03d19eb8 --- /dev/null +++ b/postgres-operator/test.yaml @@ -0,0 +1,11 @@ +--- +tests: + root_user_test: True + default_user: pgo + users_config: + - name: pgo + group: pgo + gid: 1000 + uid: 1000 +docker: + entrypoint: "/bin/sleep 1m" diff --git a/postgres-operator/trivyignore b/postgres-operator/trivyignore new file mode 100644 index 00000000..02074945 --- /dev/null +++ b/postgres-operator/trivyignore @@ -0,0 +1,4 @@ +# Upstream postgres-operator images include several CVEs. +# We should try to remove these each time we update. +CVE-2022-27191 +CVE-2021-38561 diff --git a/postgres-operator/version.txt b/postgres-operator/version.txt new file mode 100644 index 00000000..a8fdfda1 --- /dev/null +++ b/postgres-operator/version.txt @@ -0,0 +1 @@ +1.8.1