diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..0a5a4d6 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,45 @@ +name: Build and Push Image + +on: + push: + branches: + - main # This ensures the action only runs on pushes to the main branch + +env: + REGISTRY_USER: ${{ secrets.QUAY_USER }} + IMAGE_REGISTRY: quay.io + REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + +jobs: + build: + name: Build and push image + runs-on: ubuntu-22.04 + + steps: + - name: Log in to Quay.io + uses: redhat-actions/podman-login@v1 + with: + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_PASSWORD }} + registry: ${{ env.IMAGE_REGISTRY }} + + - uses: actions/checkout@v4 + + - name: Build Image + id: build-image + uses: redhat-actions/buildah-build@v2 + with: + image: quay.io/kuadrant/console-plugin + tags: latest,${{ github.sha }} + containerfiles: | + ./Dockerfile + + - name: Push To Quay.io + id: push-to-quay + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + + - name: Print image URL + run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" diff --git a/Dockerfile b/Dockerfile index 456d949..f1175f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/nodejs-16:latest AS build +FROM registry.access.redhat.com/ubi8/nodejs-20 AS build USER root RUN command -v yarn || npm i -g yarn @@ -6,9 +6,9 @@ ADD . /usr/src/app WORKDIR /usr/src/app RUN yarn install && yarn build -FROM registry.access.redhat.com/ubi8/nginx-120:latest +FROM registry.access.redhat.com/ubi9/nginx-124:1-10 COPY --from=build /usr/src/app/dist /usr/share/nginx/html USER 1001 -ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file +ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index 4e17e6d..49318ac 100644 --- a/README.md +++ b/README.md @@ -122,19 +122,19 @@ push it to an image registry. 1. Build the image: ```sh - docker build -t quay.io/my-repository/my-plugin:latest . + docker build -t quay.io/kuadrant/console-plugin:latest . ``` 2. Run the image: ```sh - docker run -it --rm -d -p 9001:80 quay.io/my-repository/my-plugin:latest + docker run -it --rm -d -p 9001:80 quay.io/kuadrant/console-plugin:latest ``` 3. Push the image: ```sh - docker push quay.io/my-repository/my-plugin:latest + docker push quay.io/kuadrant/console-plugin:latest ``` NOTE: If you have a Mac with Apple silicon, you will need to add the flag diff --git a/package-lock.json b/package-lock.json index 10e9b56..d1ac422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "console-plugin-template", - "version": "0.0.1", + "name": "kuadrant-console", + "version": "0.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "console-plugin-template", - "version": "0.0.1", + "name": "kuadrant-console", + "version": "0.0.2", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.25.2", @@ -16,7 +16,6 @@ "babel-loader": "^8.2.0", "graphlib": "^2.1.8", "graphlib-dot": "^0.6.4", - "js-yaml": "^4.1.0", "react-policy-topology": "^0.1.10" }, "devDependencies": { @@ -24,7 +23,7 @@ "@openshift-console/dynamic-plugin-sdk": "^1.6.0", "@openshift-console/dynamic-plugin-sdk-webpack": "^1.2.0", "@patternfly/react-core": "^5.3.3", - "@patternfly/react-icons": "^5.1.1", + "@patternfly/react-icons": "^5.4.0", "@patternfly/react-styles": "^5.1.1", "@types/node": "^18.0.0", "@types/react": "^17.0.37", @@ -4335,9 +4334,10 @@ } }, "node_modules/@patternfly/react-icons": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-5.3.2.tgz", - "integrity": "sha512-GEygYbl0H4zD8nZuTQy2dayKIrV2bMMeWKSOEZ16Y3EYNgYVUOUnN+J0naAEuEGH39Xb1DE9n+XUbE1PC4CxPA==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-5.4.0.tgz", + "integrity": "sha512-2M3qN/naultvRHeG2laJMmoIroFCGAyfwTVrnCjSkG6/KnRoXV0+dqd+Xrh7xzpzvIJB1klvifC0oX42cEkDrA==", + "license": "MIT", "peerDependencies": { "react": "^17 || ^18", "react-dom": "^17 || ^18" @@ -33990,9 +33990,9 @@ } }, "@patternfly/react-icons": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-5.3.2.tgz", - "integrity": "sha512-GEygYbl0H4zD8nZuTQy2dayKIrV2bMMeWKSOEZ16Y3EYNgYVUOUnN+J0naAEuEGH39Xb1DE9n+XUbE1PC4CxPA==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-5.4.0.tgz", + "integrity": "sha512-2M3qN/naultvRHeG2laJMmoIroFCGAyfwTVrnCjSkG6/KnRoXV0+dqd+Xrh7xzpzvIJB1klvifC0oX42cEkDrA==", "requires": {} }, "@patternfly/react-styles": { diff --git a/package.json b/package.json index 1d90c35..9b169de 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "console-plugin-template", - "version": "0.0.1", - "description": "Template project for OpenShift Console plugins", + "name": "kuadrant-console", + "version": "0.0.2", + "description": "Kuadrant OpenShift Console plugin", "private": true, "license": "Apache-2.0", "repository": { "type": "git", - "url": "https://github.com/openshift/console-plugin-template.git" + "url": "https://github.com/kuadrant/console-plugin.git" }, "scripts": { "clean": "rm -rf dist", @@ -19,7 +19,7 @@ "test-cypress": "cd integration-tests && cypress open", "test-cypress-headless": "cd integration-tests && node --max-old-space-size=4096 ../node_modules/.bin/cypress run --browser ${BRIDGE_E2E_BROWSER_NAME:=electron}", "cypress-merge": "mochawesome-merge ./integration-tests/screenshots/cypress_report*.json > ./integration-tests/screenshots/cypress.json", - "cypress-generate": "marge -o ./integration-tests/screenshots/ -f cypress-report -t 'OpenShift Console Plugin Template Cypress Test Results' -p 'OpenShift Cypress Plugin Template Test Results' --showPassed false --assetsDir ./integration-tests/screenshots/cypress/assets ./integration-tests/screenshots/cypress.json", + "cypress-generate": "marge -o ./integration-tests/screenshots/ -f cypress-report -t 'Kuadrant OpenShift Console Plugin Cypress Test Results' -p 'OpenShift Cypress Plugin Template Test Results' --showPassed false --assetsDir ./integration-tests/screenshots/cypress/assets ./integration-tests/screenshots/cypress.json", "cypress-postreport": "yarn cypress-merge && yarn cypress-generate", "webpack": "node -r ts-node/register ./node_modules/.bin/webpack" }, @@ -69,10 +69,10 @@ "webpack-dev-server": "^4.7.4" }, "consolePlugin": { - "name": "console-plugin-template", - "version": "0.0.1", - "displayName": "OpenShift Console Plugin Template", - "description": "Template project for OpenShift Console plugins. Edit package.json to change this message and the plugin name.", + "name": "kuadrant-console", + "version": "0.0.2", + "displayName": "Kuadrant OpenShift Console Plugin", + "description": "Kuadrant OpenShift Console Plugin", "exposedModules": { "KuadrantOverviewPage": "./components/KuadrantOverviewPage", "PolicyTopologyPage": "./components/PolicyTopologyPage", diff --git a/yarn.lock b/yarn.lock index 2ce6bbb..ea0da6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2012,14 +2012,9 @@ resolved "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-4.93.7.tgz" integrity sha512-3kr35dgba7Qz5CSzmfH0rIjSvBC5xkmiknf3SvVUVxaiVA7KRowID8viYHeZlf3v/Oa3sEewaH830Q0t+nWsZQ== -"@patternfly/react-icons@^5.3.2": - version "5.3.2" - resolved "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-5.3.2.tgz" - integrity sha512-GEygYbl0H4zD8nZuTQy2dayKIrV2bMMeWKSOEZ16Y3EYNgYVUOUnN+J0naAEuEGH39Xb1DE9n+XUbE1PC4CxPA== - -"@patternfly/react-icons@^5.4.0": +"@patternfly/react-icons@^5.3.2", "@patternfly/react-icons@^5.4.0": version "5.4.0" - resolved "https://registry.yarnpkg.com/@patternfly/react-icons/-/react-icons-5.4.0.tgz#bc6aebfdce79a2fb1b50ffdc7fd7d171c719c25b" + resolved "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-5.4.0.tgz" integrity sha512-2M3qN/naultvRHeG2laJMmoIroFCGAyfwTVrnCjSkG6/KnRoXV0+dqd+Xrh7xzpzvIJB1klvifC0oX42cEkDrA== "@patternfly/react-styles@^4.92.8": @@ -3062,21 +3057,11 @@ acorn@^7.1.1: resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.7.1, acorn@^8.8.2: +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2: version "8.11.3" resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== -acorn@^8.4.1: - version "8.5.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== - -acorn@^8.8.0: - version "8.8.2" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== - address@^1.0.1, address@^1.1.2: version "1.2.2" resolved "https://registry.npmjs.org/address/-/address-1.2.2.tgz" @@ -5303,7 +5288,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.6.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -5317,13 +5302,6 @@ debug@^3.0.0, debug@^3.0.1, debug@^3.1.0, debug@^3.1.1, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.3.2: - version "4.3.2" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - decamelize-keys@^1.0.0, decamelize-keys@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz" @@ -7340,12 +7318,7 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -has-bigints@^1.0.2: +has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== @@ -7382,16 +7355,11 @@ has-proto@^1.0.1, has-proto@^1.0.3: resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz" integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== -has-symbols@^1.0.1, has-symbols@^1.0.3: +has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz" @@ -11737,15 +11705,6 @@ react-dropzone@9.0.0: prop-types "^15.6.2" prop-types-extra "^1.1.0" -react-dropzone@^14.2.3: - version "14.2.3" - resolved "https://registry.npmjs.org/react-dropzone/-/react-dropzone-14.2.3.tgz" - integrity sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug== - dependencies: - attr-accept "^2.2.2" - file-selector "^0.6.0" - prop-types "^15.8.1" - react-error-overlay@^6.0.11: version "6.0.11" resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz" @@ -12622,17 +12581,17 @@ semver-diff@^2.0.0: "semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0: version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@6.x, semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3: version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== send@0.18.0: @@ -13081,7 +13040,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -13098,6 +13057,15 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -13183,7 +13151,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -13204,6 +13172,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.0: version "7.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz" @@ -15013,7 +14988,7 @@ workbox-window@6.6.0: "@types/trusted-types" "^2.0.2" workbox-core "6.6.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -15031,6 +15006,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz"