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
3 changes: 1 addition & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ plugins:
- "@typescript-eslint"
- simple-import-sort
rules:
"@typescript-eslint/no-unused-vars":
- error
"@typescript-eslint/no-unused-vars": "error"
react/prop-types:
- off
prettier/prettier:
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Builder container
FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-nodejs-openshift-4.15 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 install --no-save @esbuild/linux-x64 && \
npm run build

# Web server container
FROM registry.access.redhat.com/ubi9/nginx-120
Expand Down
18 changes: 5 additions & 13 deletions Dockerfile.art
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ COPY . /opt/app-root/src/app
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR /opt/app-root/src/app

# bootstrap yarn so we can install and run the other tools.
USER 0
ARG YARN_VERSION=v1.22.19
RUN CACHED_YARN=./artifacts/yarn-${YARN_VERSION}.tar.gz; \
if [ -f ${CACHED_YARN} ]; then \
npm install -g ${CACHED_YARN}; \
else \
echo "need yarn at ${CACHED_YARN}"; \
exit 1; \
fi

# use dependencies provided by Cachito
USER 0
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} . \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/{.npmrc,package-lock.json,registry-ca.pem} . \
&& source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env \
&& yarn install --frozen-lockfile && yarn build
&& npm ci && \
npm install --no-save @esbuild/linux-x64 && \
npm run build

# Web server container
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cd nmstate-console-plugin
# edit the code

# start a develoment server on port 9443
yarn dev --port 9443 \
npm run dev -- --port 9443 \
--server-type https \
--server-options-key /var/serving-cert/tls.key \
--server-options-cert /var/serving-cert/tls.crt
Expand All @@ -36,7 +36,7 @@ nmstate-console-plugin development require web development tools, and a kubernet
| requirements | |
| -------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [nodejs](https://nodejs.org/) | JavaScript runtime environment |
| [yarn](https://yarnpkg.com/) | package manager for nodejs |
| [npm](https://www.npmjs.com/) | package manager for nodejs (comes with nodejs) |
| [kubernetes]() | An [Openshift](<(https://www.openshift.com/)>) or kubernetes cluster for development |
| [kubectl](https://kubernetes.io/docs/tasks/tools/) | The Kubernetes command-line tool |

Expand Down Expand Up @@ -65,8 +65,8 @@ See [cli docs](https://github.com/kubev2v/forklift-console-plugin/blob/main/docs

In one terminal window, run:

1. `yarn install`
1. `yarn run start-console`
1. `npm install`
1. `npm run start-console`

This will run the OpenShift console in a container connected to the cluster you are currently logged into. The plugin HTTP server runs on port 9001 with CORS enabled, the development server will be available at http://localhost:9000

Expand Down Expand Up @@ -101,7 +101,7 @@ export BRIDGE_K8S_AUTH_BEARER_TOKEN=$(oc whoami --show-token)
export INVENTORY_SERVER_HOST=https://$(oc get routes -o custom-columns=HOST:.spec.host -A | grep 'nmstate-inventory' | head -n 1)

# start the nmstate console plugin
yarn dev
npm run dev
```

### Deployment on cluster with Openshift templates
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
Loading