Skip to content

Commit

Permalink
Merge branch 'main' into unit-test-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kahboom committed Mar 18, 2024
2 parents 0302256 + 7273f47 commit 70caa06
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
workflow_dispatch:
schedule:
# Every M-F at 12:00am run this job
- cron: "0 0 * * 1-5"
- cron: "0 0 * * 1-5"

jobs:
check-image-version:
uses: securesign/actions/.github/workflows/check-image-version.yaml@main
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/trigger-konflux-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Trigger Konflux build
on:
workflow_dispatch:

jobs:
trigger-konflux-build:
uses: securesign/actions/.github/workflows/trigger-konflux-build.yaml@main
with:
branch: main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .tekton/rekor-search-ui-1-0-gamma-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
- name: name
value: summary
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.1@sha256:789b3b20a7de149213d6fa7ac05af13229b1c34f74e1b93d1b42eb3d3df2d0d8
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.2@sha256:6a54bf5cee74c54ed5e08d4b11476cc29fa119d02a2d715005496737de885d49
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -255,7 +255,7 @@ spec:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:e831f3e10362ecb21910f45ff48c3af1c0c8bea4858ca25f4f436153499f9802
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:de78aa846dd6a73242c7f93c981ee2ff4ceb5cf97e6a2aaaf3a87ef2e3599798
- name: kind
value: task
resolver: bundles
Expand Down
4 changes: 2 additions & 2 deletions .tekton/rekor-search-ui-1-0-gamma-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
- name: name
value: summary
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.1@sha256:789b3b20a7de149213d6fa7ac05af13229b1c34f74e1b93d1b42eb3d3df2d0d8
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.2@sha256:6a54bf5cee74c54ed5e08d4b11476cc29fa119d02a2d715005496737de885d49
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:e831f3e10362ecb21910f45ff48c3af1c0c8bea4858ca25f4f436153499f9802
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:de78aa846dd6a73242c7f93c981ee2ff4ceb5cf97e6a2aaaf3a87ef2e3599798
- name: kind
value: task
resolver: bundles
Expand Down
4 changes: 2 additions & 2 deletions .tekton/rekor-search-ui-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
- name: name
value: summary
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.1@sha256:789b3b20a7de149213d6fa7ac05af13229b1c34f74e1b93d1b42eb3d3df2d0d8
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.2@sha256:6a54bf5cee74c54ed5e08d4b11476cc29fa119d02a2d715005496737de885d49
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -247,7 +247,7 @@ spec:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:e831f3e10362ecb21910f45ff48c3af1c0c8bea4858ca25f4f436153499f9802
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:de78aa846dd6a73242c7f93c981ee2ff4ceb5cf97e6a2aaaf3a87ef2e3599798
- name: kind
value: task
resolver: bundles
Expand Down
4 changes: 2 additions & 2 deletions .tekton/rekor-search-ui-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
- name: name
value: summary
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.1@sha256:789b3b20a7de149213d6fa7ac05af13229b1c34f74e1b93d1b42eb3d3df2d0d8
value: quay.io/redhat-appstudio-tekton-catalog/task-summary:0.2@sha256:6a54bf5cee74c54ed5e08d4b11476cc29fa119d02a2d715005496737de885d49
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -244,7 +244,7 @@ spec:
- name: name
value: source-build
- name: bundle
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:e831f3e10362ecb21910f45ff48c3af1c0c8bea4858ca25f4f436153499f9802
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:de78aa846dd6a73242c7f93c981ee2ff4ceb5cf97e6a2aaaf3a87ef2e3599798
- name: kind
value: task
resolver: bundles
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
FROM registry.access.redhat.com/ubi9/nodejs-18@sha256:773645c3eae02529e09c04a843a0c6783de45b084b325685b043b7818c7a8bf6 as Build
#
COPY . .
USER root
USER root
ENV NODE_ENV production
EXPOSE 3000
RUN echo "export PATH=${PATH}:$HOME/node_modules/.bin" >> ~/.bashrc && \
npm install --ignore-scripts && \
npm run build && \
chmod -R 777 /opt/app-root/src/.npm && \
echo "NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN = ${NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN}" && \
npm cache clean --force
USER 1001
CMD ["npm", "run", "start"]
CMD ["node_modules/.bin/next", "start"]

LABEL \
com.redhat.component="trusted-artifact-signer-rekor-ui" \
name="trusted-artifact-signer-rekor-ui" \
version="0.0.1" \
summary="User Interface for checking Rekor Entries" \
description="Provides a user interface for checking Rekor Entries through an Node App" \
io.k8s.description="Provides a user interface for checking Rekor Entries through an Node App" \
io.k8s.display-name="Provides a user interface for checking Rekor Entries through an Node App" \
description="Provides a user interface for checking Rekor Entries through a Node App" \
io.k8s.description="Provides a user interface for checking Rekor Entries through a Node App" \
io.k8s.display-name="Provides a user interface for checking Rekor Entries through a Node App" \
io.openshift.tags="rekor-ui, rekor, cli, rhtas, trusted, artifact, signer, sigstore" \
maintainer="trusted-artifact-signer@redhat.com"
14 changes: 13 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: ["@patternfly/react-core", "@patternfly/react-styles"],
publicRuntimeConfig: {
// remove private env variables
processEnv: Object.fromEntries(
Object.entries(process.env).filter(([key]) =>
key.includes("NEXT_PUBLIC_"),
),
),
},
transpilePackages: [
"@patternfly/react-core",
"@patternfly/react-icons",
"@patternfly/react-styles",
],
};

module.exports = nextConfig;
20 changes: 20 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
import Document, { Head, Html, Main, NextScript } from "next/document";

const nextPublicENV = Object.keys(process.env)
.filter(key => key.startsWith("NEXT_PUBLIC_"))
.reduce(
(env, key) => {
env[key] = process.env[key] ?? "";
return env;
},
{} as { [key: string]: string },
);

class AppDocument extends Document {
render() {
return (
<Html lang="en">
<Head></Head>
<script
dangerouslySetInnerHTML={{
__html: `
console.table(${JSON.stringify(nextPublicENV)});
window.process = window.process || {};
window.process.env = window.process.env || {};
Object.assign(window.process.env, ${JSON.stringify(nextPublicENV)});
`,
}}
></script>
<body>
<Main />
<NextScript />
Expand Down
11 changes: 10 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { RekorClientProvider } from "../modules/api/context";
import { Explorer } from "../modules/components/Explorer";
import { Settings } from "../modules/components/Settings";
import { CogIcon, GithubIcon } from "@patternfly/react-icons";
import { CogIcon } from "@patternfly/react-icons";
import Link from "next/link";
import Image from "next/image";
import NOSSRWrapper from "../modules/utils/noSSR";
Expand Down Expand Up @@ -112,3 +112,12 @@ const PageComponent: NextPage = () => (
</RekorClientProvider>
);
export default PageComponent;

export async function getServerSideProps() {
return {
props: {
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN:
process.env.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN,
}, // will be passed to the page component as props
};
}

0 comments on commit 70caa06

Please sign in to comment.