Skip to content

Commit

Permalink
Add tembo-pg-cnpg to release workflow (#69)
Browse files Browse the repository at this point in the history
* Add tembo-pg-cnpg to release workflow

* standard-cnpg: fix ARG location

* pg-cnpg: bump to Rust 1.78

* standard-cnpg: put ARG... where it was before

* tembo-pg-cnpg: ARG location

* tembo-pg-cnpg: don't push to ECR
  • Loading branch information
vrmiguel authored Jun 11, 2024
1 parent 232b774 commit 76c4f0d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
40 changes: 39 additions & 1 deletion .github/workflows/build_tembo_pg_slim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- 'tembo-pg-slim/**'
- 'standard-cnpg/**'
- 'tembo-pg-cnpg/**'
- 'dw-cnpg/**'
- 'ml-cnpg/**'
- 'geo-cnpg/**'
Expand All @@ -20,7 +21,6 @@ on:
- 'ml-cnpg/**'
- 'geo-cnpg/**'


jobs:
pre-build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -363,3 +363,41 @@ jobs:
docker tag $IMAGE_NAME ${{ secrets.ECR_REGISTRY }}/$IMAGE_NAME-$tag
docker push ${{ secrets.ECR_REGISTRY }}/$IMAGE_NAME-$tag
done
tembo-pg-cnpg-build:
needs: [pre-build, tembo-pg-slim-build]
permissions:
id-token: write
contents: read
runs-on:
- self-hosted
- dind
- large-8x8
strategy:
fail-fast: false
matrix: ${{fromJson(needs.pre-build.outputs.build_matrix)}}
env:
CONTAINER_NAME: "tembo-pg-cnpg"
steps:
- uses: actions/checkout@v4
- name: Build Docker images based on conditions
run: |
IMAGE_NAME=$CONTAINER_NAME:${{ matrix.pg_version }}
docker build ./$CONTAINER_NAME --build-arg PG_VERSION=${{ matrix.pg_version }} --build-arg TAG=${{ needs.pre-build.outputs.short_sha }} -t $IMAGE_NAME
shell: bash
- name: Login to Tembo Quay
uses: docker/login-action@v2
with:
registry: ${{ secrets.QUAY_REPOSITORY }}
username: ${{ secrets.QUAY_USER_TEMBO }}
password: ${{ secrets.QUAY_PASSWORD_TEMBO }}
- name: Push to Quay
shell: bash
run: |
set -xe
IMAGE_NAME=$CONTAINER_NAME:${{ matrix.pg_version }}
IFS=' ' read -ra TAG_ARRAY <<< "${{ needs.pre-build.outputs.tags }}"
for tag in "${TAG_ARRAY[@]}"; do
docker tag $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/$IMAGE_NAME-$tag
docker push ${{ secrets.QUAY_REPOSITORY }}/$IMAGE_NAME-$tag
done
2 changes: 1 addition & 1 deletion standard-cnpg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM rust:1.74-bookworm as builder

ARG TRUNK_VER=0.12.25

ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
RUN cargo install --version $TRUNK_VER pg-trunk

FROM quay.io/tembo/tembo-pg-slim:${PG_VERSION}-${TAG}
Expand Down
5 changes: 3 additions & 2 deletions tembo-pg-cnpg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
ARG PG_VERSION=15
ARG TAG=latest

FROM rust:1.70-bookworm as builder
FROM rust:1.78-bookworm as builder

ARG TRUNK_VER=0.12.25

ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
RUN cargo install --version $TRUNK_VER pg-trunk

FROM quay.io/tembo/tembo-pg-slim:${PG_VERSION}
FROM quay.io/tembo/tembo-pg-slim:${PG_VERSION}-${TAG}

USER root

Expand Down

0 comments on commit 76c4f0d

Please sign in to comment.