Skip to content

Commit

Permalink
Add namespace variable to generate k8s resources, upload resources
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Edgar <[email protected]>
  • Loading branch information
MikeEdgar committed Aug 22, 2024
1 parent 2fedc63 commit 4a8b4d0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
export QUARKUS_CONTAINER_IMAGE_TAG="${{ env.PROJECT_VERSION }}"
export QUARKUS_KUBERNETES_VERSION="${{ env.PROJECT_VERSION }}"
mvn verify -P container-image -B --no-transfer-progress \
-Dquarkus.kubernetes.namespace='$${NAMESPACE}' \
-Dquarkus.package.write-transformed-bytecode-to-build-output=true \
-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64
Expand Down Expand Up @@ -97,6 +98,15 @@ jobs:
tags: |
streamshub/console-operator-catalog:${{ env.PROJECT_VERSION }}
- name: Attach Kubernetes Resources
uses: actions/upload-artifact@v4
with:
name: k8s-resources
path: |
operator/target/bundle/
operator/target/catalog/
operator/target/kubernetes/*.yml
- name: Archive Results
uses: actions/upload-artifact@v4
if: failure()
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ jobs:
export QUARKUS_CONTAINER_IMAGE_ADDITIONAL_TAGS=latest
export GIT_REVISION=$(git rev-parse --short release)
# Build and push the release images using the commit tagged in `release:prepare`
mvn -B -P container-image release:perform --no-transfer-progress '-Drelease.arguments=-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64'
mvn -B -P container-image release:perform --no-transfer-progress \
-Dquarkus.kubernetes.namespace='$${NAMESPACE}' \
'-Drelease.arguments=-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64'
- name: Login to Quay
uses: docker/login-action@v3
Expand Down Expand Up @@ -135,8 +137,17 @@ jobs:
milestone-title: ${{steps.metadata.outputs.current-version}}
milestone-next: ${{steps.metadata.outputs.next-version}}

- name: Image Update
uses: renovatebot/[email protected]
- name: Prepare Operator Resources
run: |
cat operator/target/kubernetes/consoles.console.streamshub.github.com-v1.yml \
operator/target/kubernetes/kubernetes.yml \
> operator/target/console-operator-${{ steps.metadata.outputs.current-version }}.yaml
- uses: meeDamian/[email protected]
name: Attach Operator Resources to Release
with:
configurationFile: .github/gitops-config.json
token: ${{ secrets.RELEASE_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.metadata.outputs.current-version }}
allow_override: true
gzip: false
files: operator/target/console-operator-${{ steps.metadata.outputs.current-version }}.yaml
13 changes: 12 additions & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
export QUARKUS_KUBERNETES_VERSION="${{ env.NEXT_VERSION }}"
export GIT_REVISION=$(git rev-parse --short HEAD)
# Build and push the snapshot images
mvn -B -P container-image verify --no-transfer-progress -DskipTests -Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64
mvn -B -P container-image verify --no-transfer-progress -DskipTests \
-Dquarkus.kubernetes.namespace='$${NAMESPACE}' \
-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64
- name: Login to Quay
uses: docker/login-action@v3
Expand Down Expand Up @@ -102,6 +104,15 @@ jobs:
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-operator-catalog:${{ env.NEXT_VERSION }}
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-operator-catalog:snapshot-${{github.ref_name}}
- name: Attach Kubernetes Resources
uses: actions/upload-artifact@v4
with:
name: k8s-resources
path: |
operator/target/bundle/
operator/target/catalog/
operator/target/kubernetes/*.yml
- name: Build UI
working-directory: ui
run: |
Expand Down
3 changes: 3 additions & 0 deletions operator/bin/modify-bundle-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ done

echo "[INFO] Modify values and replace placeholders in ${CSV_FILE_PATH}"

# Delete any namespaces set on the CSV deployment(s), possibly added by `quarkus.kubernetes.namespace`
${YQ} eval -o yaml -i 'del(.spec.install.spec.deployments[0].spec.template.metadata.namespace)' "${CSV_FILE_PATH}"

yq_image_expression=".spec.install.spec.deployments[0] | (select (.name ==\"${OPERATOR_NAME}\")).spec.template.spec.containers[].image"

full_image=$(${YQ} eval "${yq_image_expression}" "${CSV_FILE_PATH}")
Expand Down

0 comments on commit 4a8b4d0

Please sign in to comment.