diff --git a/.devcontainer/Dockerfile.console b/.devcontainer/Dockerfile.console deleted file mode 100644 index 2d6f3c83..00000000 --- a/.devcontainer/Dockerfile.console +++ /dev/null @@ -1,20 +0,0 @@ -FROM quay.io/openshift/origin-console:latest -COPY --from=openshift/origin-cli:latest /usr/bin/oc /usr/local/bin/oc - -ENV OC_URL=$OC_URL -ENV OC_PASS=$OC_PASS -ENV OC_USER=$OC_USER -ENV OC_PLUGIN_NAME=$OC_PLUGIN_NAME - -USER root -CMD eval "oc login $OC_URL -u $OC_USER -p $OC_PASS --insecure-skip-tls-verify" && \ - /opt/bridge/bin/bridge -public-dir=/opt/bridge/static \ - -i18n-namespaces plugin__$OC_PLUGIN_NAME \ - -plugins $OC_PLUGIN_NAME=http://localhost:9001 \ - -k8s-mode-off-cluster-thanos=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.thanosPublicURL}') \ - -k8s-mode-off-cluster-endpoint=$(oc whoami --show-server) \ - -k8s-mode-off-cluster-skip-verify-tls=true \ - -k8s-auth-bearer-token=$(oc whoami --show-token) \ - -k8s-auth="bearer-token" \ - -user-auth="disabled" \ - -k8s-mode="off-cluster" diff --git a/.devcontainer/Dockerfile.plugin b/.devcontainer/Dockerfile.plugin deleted file mode 100644 index 59d4d0c8..00000000 --- a/.devcontainer/Dockerfile.plugin +++ /dev/null @@ -1,2 +0,0 @@ -FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:16 as build -COPY --from=openshift/origin-cli:latest /usr/bin/oc /usr/local/bin/oc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index d438aa83..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "Console + Plugin", - "dockerComposeFile": "docker-compose.yml", - "service": "plugin", - "workspaceFolder": "/workspace", - - "initializeCommand": ".devcontainer/init.sh", - "postCreateCommand": "yarn && eval 'oc login $OC_URL -u $OC_USER -p $OC_PASS --insecure-skip-tls-verify'", - "forwardPorts": [9000, 9001], - "portsAttributes": { - "9000": { - "label": "Console" - }, - "9001": { - "label": "Plugin static files", - "onAutoForward": "silent" - } - }, - "features": {}, - "customizations": { - "vscode": { - "settings": {}, - "extensions": [ - "ms-azuretools.vscode-docker", - "ms-vscode.vscode-typescript-next", - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode" - ] - } - } -} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml deleted file mode 100644 index 57071ed2..00000000 --- a/.devcontainer/docker-compose.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: '3.8' -# create dev.env with the following values: -# OC_URL -# OC_USER -# OC_PASS -# OC_PLUGIN_NAME -services: - console: - build: - context: .. - dockerfile: .devcontainer/Dockerfile.console - env_file: dev.env - restart: unless-stopped - healthcheck: - test: oc whoami - interval: 1m30s - timeout: 10s - retries: 5 - - plugin: - build: - context: .. - dockerfile: .devcontainer/Dockerfile.plugin - env_file: dev.env - depends_on: - - console - network_mode: service:console - # Overrides default command so things don't shut down after the process ends. - command: sleep infinity - # Cache local workspace and copy shell history. - volumes: - - ..:/workspace:cached - - ~/.bash_history:/root/.bash_history - - ~/.zsh_history:/root/.zsh_history diff --git a/.devcontainer/init.sh b/.devcontainer/init.sh deleted file mode 100755 index 4ddee379..00000000 --- a/.devcontainer/init.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -if [[ ! -f .devcontainer/dev.env ]] -then - cat << EOF - env file 'dev.env' does not exist in .devcontainer, please create it and add the the correct values for your cluster. - OC_PLUGIN_NAME=my-plugin - OC_URL=https://api.example.com:6443 - OC_USER=kubeadmin - OC_PASS= -EOF - exit 2 -else - echo 'found 'dev.env' in .devcontainer' -fi - -# if one of the variables are missing, abort the build. -success=1 -! grep -q OC_PLUGIN_NAME= ".devcontainer/dev.env" && success=0 -! grep -q OC_URL= ".devcontainer/dev.env" && success=0 -! grep -q OC_USER= ".devcontainer/dev.env" && success=0 -! grep -q OC_PASS= ".devcontainer/dev.env" && success=0 - -if ((success)); then - echo 'dev.env is formatted correctly, proceeding.' -else - cat << EOF - dev.env is not formatted correctly, please add the the correct values for your cluster. - OC_PLUGIN_NAME=my-plugin - OC_URL=https://api.example.com:6443 - OC_USER=kubeadmin - OC_PASS= -EOF -exit 2 -fi diff --git a/.github/renovate.json b/.github/renovate.json index f0a2d60b..85115fb4 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,10 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:recommended"], + "extends": [ + "github>konflux-ci/mintmaker//config/renovate/renovate.json", + "config:best-practices" + ], + "enabledManagers": ["maven", "tekton", "gomod", "npm", "dockerfile"], "timezone": "UTC", "schedule": ["before 7am"], "minimumReleaseAge": "7 days", @@ -101,6 +105,19 @@ "matchPackageNames": ["k8s.io/*", "sigs.k8s.io/*", "knative.dev/*"], "matchUpdateTypes": ["major", "minor"], "enabled": false + }, + { + "groupName": "images", + "matchManagers": ["dockerfile"] + }, + { + "matchPackageNames": ["/^quay\\.io\\/konflux-ci\\//"], + "minimumReleaseAge": "0 days", + "addLabels": [ + "ok-to-test", + "approved", + "lgtm" + ] } ] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index c125370c..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: CI - -permissions: - id-token: write # Required for signing - contents: read - packages: write - attestations: write - pages: write - -on: - push: - branches: - - master - pull_request: - branches: - - master - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -env: - IMAGE: ghcr.io/${{ github.repository_owner }}/console-functions-plugin - -jobs: - # -------- - # CHECKS - # -------- - checks: - name: Lint and Test - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v6 - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: "22" - cache: yarn - - - name: Enable Corepack - run: corepack enable - - - name: Install Dependencies - run: yarn install --immutable - - - name: Lint - run: yarn lint - - - name: Test - run: yarn test - - # ----------- - # BUILD IMAGE - # ----------- - build-image: - name: Build Image - needs: checks - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v6 - - uses: docker/setup-qemu-action@v4 - - uses: docker/setup-buildx-action@v4 - - - name: Build Image - uses: docker/build-push-action@v7 - env: - SOURCE_DATE_EPOCH: 0 - with: - context: . - push: false - provenance: false - # Multi-arch is required for OCP. - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x - cache-from: type=gha - cache-to: type=gha,mode=max - - # ------------- - # PUBLISH IMAGE - # ------------- - publish: - name: Publish Image - needs: build-image - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - runs-on: ubuntu-latest - timeout-minutes: 30 - outputs: - digest: ${{ steps.build-and-push.outputs.digest }} - steps: - - uses: actions/checkout@v6 - - uses: docker/setup-qemu-action@v4 - - uses: docker/setup-buildx-action@v4 - - - name: Login to GHCR - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and Push Image - id: build-and-push - uses: docker/build-push-action@v7 - env: - SOURCE_DATE_EPOCH: 0 - with: - context: . - push: true - provenance: false - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x - tags: | - ${{ env.IMAGE }}:latest - ${{ env.IMAGE }}:sha-${{ github.sha }} - cache-from: type=gha - annotations: | - index:org.opencontainers.image.description=Serverless Functions Console Plugin for OpenShift - index:org.opencontainers.image.source=https://github.com/${{ github.repository }} - index:org.opencontainers.image.vendor=https://github.com/${{ github.repository }} - index:org.opencontainers.image.url=https://github.com/${{ github.repository }}/pkgs/container/console-functions-plugin - - # Attestation is required for OCP. - - name: Attest Build Provenance - uses: actions/attest-build-provenance@v4 - with: - subject-name: ${{ env.IMAGE }} - subject-digest: ${{ steps.build-and-push.outputs.digest }} - push-to-registry: true - - # ------------ - # DEPLOY PAGES - # ------------ - deploy-pages: - name: Deploy Pages - needs: publish - runs-on: ubuntu-latest - timeout-minutes: 5 - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - uses: actions/checkout@v6 - - - name: Setup Helm - uses: azure/setup-helm@v5 - - - name: Generate deployment YAML and landing page - run: | - mkdir public - helm template console-functions-plugin charts/openshift-console-plugin \ - -n console-functions-plugin \ - --set "plugin.image=${{ env.IMAGE }}@${{ needs.publish.outputs.digest }}" \ - > public/plugin.yaml - cp pages/index.html public/index.html - - - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v5 - with: - path: ./public - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v5