generated from openshift/console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f64b76e
Showing
55 changed files
with
10,468 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build_root_image: | ||
name: nodejs-16 | ||
namespace: openshift | ||
tag: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:16 as build | ||
COPY --from=openshift/origin-cli:latest /usr/bin/oc /usr/local/bin/oc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"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" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/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=<password> | ||
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=<password> | ||
EOF | ||
exit 2 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
env: | ||
browser: true | ||
es2021: true | ||
extends: | ||
- eslint:recommended | ||
- plugin:react/recommended | ||
- plugin:@typescript-eslint/recommended | ||
- prettier | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
ecmaFeatures: | ||
jsx: true | ||
ecmaVersion: 2016 | ||
sourceType: module | ||
plugins: | ||
- prettier | ||
- react | ||
- '@typescript-eslint' | ||
rules: | ||
prettier/prettier: | ||
- error | ||
settings: | ||
react: | ||
version: detect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/node_modules | ||
**/dist | ||
**/.DS_Store | ||
.devcontainer/dev.env | ||
integration-tests/videos | ||
integration-tests/screenshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
arrowParens: always | ||
printWidth: 100 | ||
singleQuote: true | ||
trailingComma: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
extends: | ||
- stylelint-config-standard | ||
rules: | ||
# Disallow color names and hex colors as these don't work well with dark mode. | ||
# Use PF global variables instead: | ||
# https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables | ||
color-named: never | ||
color-no-hex: true | ||
# PatternFly CSS vars don't conform to stylelint's regex. Disable this rule. | ||
custom-property-pattern: null | ||
function-disallowed-list: | ||
- rgb | ||
# Disable the standard rule to allow BEM-style classnames with underscores. | ||
selector-class-pattern: null | ||
# Disallow CSS classnames prefixed with .pf- or .co- as these prefixes are | ||
# reserved by PatternFly and OpenShift console. | ||
selector-disallowed-list: | ||
- "*" | ||
- /\.(pf|co)-/ | ||
# Plugins should avoid naked element selectors like `table` and `li` since | ||
# this can impact layout of existing pages in console. | ||
selector-max-type: | ||
- 0 | ||
- ignore: | ||
- compounded | ||
- descendant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"typescript.tsdk": "./node_modules/typescript/lib", | ||
"search.exclude": { | ||
"**/node_modules": true | ||
}, | ||
"files.watcherExclude": { | ||
"**/node_modules/**": true | ||
}, | ||
"files.associations": { | ||
"**/console-extensions.json": "jsonc" | ||
}, | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": ["**/console-extensions.json"], | ||
"url": "./node_modules/@openshift-console/dynamic-plugin-sdk-webpack/schema/console-extensions.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM registry.access.redhat.com/ubi8/nodejs-16:latest AS build | ||
USER root | ||
RUN command -v yarn || npm i -g yarn | ||
|
||
ADD . /usr/src/app | ||
WORKDIR /usr/src/app | ||
RUN yarn install && yarn build | ||
|
||
FROM registry.access.redhat.com/ubi8/nginx-120:latest | ||
|
||
COPY --from=build /usr/src/app/dist /usr/share/nginx/html | ||
USER 1001 | ||
|
||
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
Oops, something went wrong.