Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/push-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
user: ${{ secrets.GREENBONE_REGISTRY_USER }}
password: ${{ secrets.GREENBONE_REGISTRY_TOKEN }}
repository: opensight-postgres
namespace: opensight
namespace: opensight-dev
compare-repository: postgres
tag: ${{ inputs.postgres-major-version }}
mode: lt
Expand All @@ -63,17 +63,17 @@ jobs:
user: ${{ secrets.GREENBONE_REGISTRY_USER }}
password: ${{ secrets.GREENBONE_REGISTRY_TOKEN }}
repository: opensight-postgres
namespace: opensight
namespace: opensight-dev

- name: Increment opensight-postgres service version
if: ${{ steps.compare.outputs.output == 'true' }}
id: version
shell: bash
run: |
set +e
# Get latest minor version from dockerhub
# Get latest postgres minor version from dockerhub filtered by major version.
dt="$(echo -e '${{ steps.dtags.outputs.output }}' | grep -E '^${{ inputs.postgres-major-version }}.[0-9]+$' | sort -Vr | sed q)"
echo "New postgres version on dockerhub: $dt"
echo "Current postgres version on dockerhub: $dt"
if ! [ "$dt" ]; then
echo 'No postgres release on dockerhub found for major version: ${{ inputs.postgres-major-version }}'
exit 1
Expand All @@ -85,9 +85,8 @@ jobs:
echo "No postgres minor version found on dockerhub: $dt"
exit 2
fi
echo "New minor version: $minor"

# Get the latest tag filtered by postgres major version.
# Get the latest opensight-postgres tag filtered by dockerhub postgres minor version.
t="$(echo -e '${{ steps.tags.outputs.output }}' | grep -E "^${{ inputs.postgres-major-version }}.$minor.[0-9]+$" | sort -Vr | sed q)"
if [ "$t" ]; then
echo "Current opensight-postgres version: $t"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
cosign-key: ${{ secrets.COSIGN_KEY_OPENSIGHT }}
cosign-key-password: ${{ secrets.COSIGN_KEY_PASSWORD_OPENSIGHT }}
cosign-tlog-upload: "false"
image-url: opensight/opensight-postgres
image-url: opensight-dev/opensight-postgres
image-labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=postgres:${{ inputs.postgres-major-version }}
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Service upgrade matrix
id: upgrade
run: |
echo "matrix=$(echo '${{ inputs.services }}' | jq -r '{include:[.[] | {service: ., "image-url": "opensight/opensight-postgres", digest: "${{ steps.build.outputs.digest }}", version: "${{ inputs.version }}" }]} | @json')" >> $GITHUB_OUTPUT
echo "matrix=$(echo '${{ inputs.services }}' | jq -r '{include:[.[] | {service: ., "image-url": "opensight-dev/opensight-postgres", digest: "${{ steps.build.outputs.digest }}", version: "${{ inputs.version }}" }]} | @json')" >> $GITHUB_OUTPUT

outputs:
matrix: ${{ steps.upgrade.outputs.matrix }}
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
needs: push-postgres
uses: greenbone/workflows/.github/workflows/generate-and-push-sbom-with-trivy-3rd-gen.yml@main
with:
image-url: "${{ vars.GREENBONE_REGISTRY}}/opensight/opensight-postgres:${{ inputs.version }}"
image-url: "${{ vars.GREENBONE_REGISTRY}}/opensight-dev/opensight-postgres:${{ inputs.version }}"
image-registry-username-secret-name: "GREENBONE_REGISTRY_READ_USER"
image-registry-password-secret-name: "GREENBONE_REGISTRY_READ_TOKEN"
output-file-name: 'opensight-postgres.${{ inputs.version }}.sbom.json'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release New Major Version

on:
workflow_dispatch:
Expand Down
Loading