Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Builder container
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.19 AS build

# Install yarn
RUN npm install -g yarn -s &>/dev/null
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.22 AS build

# Copy app source
COPY . /opt/app-root/src/app
WORKDIR /opt/app-root/src/app

# Run install as supper tux
USER 0
RUN yarn install --frozen-lockfile --network-timeout 600000 && yarn build
RUN npm ci && npm run build

# Web server container
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9

RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.art
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN CACHED_YARN=./artifacts/yarn-${YARN_VERSION}.tar.gz; \
RUN test -d ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps || exit 1; \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/{.npmrc,.yarnrc,yarn.lock,registry-ca.pem} . \
&& source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env \
&& yarn install --frozen-lockfile && yarn build
&& npm ci && npm run build

# Web server container
FROM registry.ci.openshift.org/ocp/4.21:base-rhel9
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and higher. For using old `v1alpha1` API version us OpenShift version 4.10 or 4.
For an example of a plugin that works with OpenShift 4.11, see the `release-4.11` branch.
For a plugin that works with OpenShift 4.10, see the `release-4.10` branch.

[Node.js](https://nodejs.org/en/) and [yarn](https://yarnpkg.com) are required
[Node.js](https://nodejs.org/en/) and [npm](https://www.npmjs.com/) are required
to build and run the example. To run OpenShift console in a container, either
[Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io) and
[oc](https://console.redhat.com/openshift/downloads) are required.
Expand Down Expand Up @@ -56,21 +56,21 @@ to deploy it to a cluster.

In one terminal window, run:

1. `yarn install`
2. `yarn run start`
1. `npm install`
2. `npm run start`

In another terminal window, run:

1. `oc login` (requires [oc](https://console.redhat.com/openshift/downloads) and an [OpenShift cluster](https://console.redhat.com/openshift/create))
2. `yarn run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))
2. `npm run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))

This will run the OpenShift console in a container connected to the cluster
you've logged into. The plugin HTTP server runs on port 9001 with CORS enabled.
Navigate to <http://localhost:9000/example> to see the running plugin.

#### Running start-console with Apple silicon and podman

If you are using podman on a Mac with Apple silicon, `yarn run start-console`
If you are using podman on a Mac with Apple silicon, `npm run start-console`
might fail since it runs an amd64 image. You can workaround the problem with
[qemu-user-static](https://github.com/multiarch/qemu-user-static) by running
these commands:
Expand Down Expand Up @@ -101,7 +101,7 @@ OC_PASS=<password>
```

2. `(Ctrl+Shift+P) => Remote Containers: Open Folder in Container...`
3. `yarn run start`
3. `npm run start`
4. Navigate to <http://localhost:9000/example>

## Docker image
Expand Down Expand Up @@ -186,13 +186,13 @@ namespace. For example:
}
```

Running `yarn i18n` updates the JSON files in the `locales` folder of the
Running `npm run i18n` updates the JSON files in the `locales` folder of the
plugin template when adding or changing messages.

## Linting

This project adds prettier, eslint, and stylelint. Linting can be run with
`yarn run lint`.
`npm run lint`.

The stylelint config disallows hex colors since these cause problems with dark
mode (starting in OpenShift console 4.11). You should use the
Expand All @@ -210,8 +210,8 @@ break console styles!

Steps to generate reports

1. In command prompt, navigate to root folder and execute the command `yarn run cypress-merge`
2. Then execute command `yarn run cypress-generate`
1. In command prompt, navigate to root folder and execute the command `npm run cypress-merge`
2. Then execute command `npm run cypress-generate`
The cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory

## References
Expand Down
2 changes: 1 addition & 1 deletion i18n-scripts/export-pos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source ./i18n-scripts/languages.sh
for f in locales/en/* ; do
for i in "${LANGUAGES[@]}"
do
yarn i18n-to-po -f "$(basename "$f" .json)" -l "$i"
npm run i18n-to-po -- -f "$(basename "$f" .json)" -l "$i"
done
done

4 changes: 2 additions & 2 deletions i18n-scripts/memsource-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ do
# We don't treat zh-cn as a dialect in i18next right now, so we need to alter it to zh
if [ "$i" == 'zh-cn' ]
then
yarn po-to-i18n -d "$DOWNLOAD_PATH/$i" -l 'zh'
npm run po-to-i18n -- -d "$DOWNLOAD_PATH/$i" -l 'zh'
else
yarn po-to-i18n -d "$DOWNLOAD_PATH/$i" -l "$i"
npm run po-to-i18n -- -d "$DOWNLOAD_PATH/$i" -l "$i"
fi
done

Expand Down
2 changes: 1 addition & 1 deletion i18n-scripts/memsource-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PROJECT_INFO=$(memsource project create --name "[OCP $VERSION] UI Localization n
PROJECT_ID=$(echo "$PROJECT_INFO" | jq -r '.uid')

echo "Exporting PO files"
yarn export-pos
npm run export-pos
echo "Exported all PO files"

echo "Creating jobs for exported PO files"
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module.exports = (on, config) => {
module: {
rules: [
{
loader: 'ts-loader',
options: { happyPackMode: true, transpileOnly: true },
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'esbuild-loader',
test: /\.ts$/,
},
],
},
Expand Down
Loading