From 461ae34be868d9764fbe0eb63d570f1c01c628ab Mon Sep 17 00:00:00 2001 From: Sabin Date: Tue, 26 Nov 2024 17:19:11 +0545 Subject: [PATCH 1/2] added dockerfile for ocis deployment --- .dockerignore | 4 ++++ Dockerfile | 12 ++++++++++++ README.md | 8 ++++++++ mdviewer.yml | 16 ++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 mdviewer.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..86705dc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +tests +dist +node_modules +.github diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..89dd49e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:alpine AS stage + +WORKDIR /extension + +COPY . . +RUN npm install -g pnpm +RUN pnpm install +RUN pnpm build + +FROM node:alpine +WORKDIR /app +COPY --from=stage /extension/dist ./ diff --git a/README.md b/README.md index 6e52309..bcd1469 100644 --- a/README.md +++ b/README.md @@ -73,3 +73,11 @@ docker compose up ``` oCIS URL: [localhost:9200](https://localhost:9200) + + +### Adding Md-Viewer to the oCIS Deployment Example + +1. Navigate to the `deployments/examples/ocis_full/web_extensions` folder of your installation and copy [`mdviewer.yml`] into the [`web_extensions`](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full/web_extensions) subfolder. + +2. Add `MDVIEWER=:web_extensions/mdviewer.yml` to the `## oCIS Web Extensions ##` section of the `.env` file of your installation (file is located in `deployments/examples/ocis_full`).\ Add that variable in the `COMPOSE_FILE` variable at the last line. + 3. Run `docker compose up` to run the extension with oCIS diff --git a/mdviewer.yml b/mdviewer.yml new file mode 100644 index 0000000..d4f3197 --- /dev/null +++ b/mdviewer.yml @@ -0,0 +1,16 @@ + +--- +services: + ocis: + depends_on: + md-viewer: + condition: service_completed_successfully + + md-viewer: + image: jankaritechnepal/md-viewer:latest + user: root + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ["-c", "cp -R /app/* /apps"] From 823d6454c98ddc48f5acbdf715a2d464d1168566 Mon Sep 17 00:00:00 2001 From: Sabin Date: Wed, 27 Nov 2024 14:09:38 +0545 Subject: [PATCH 2/2] fixed selector for login --- Dockerfile | 5 ++--- README.md | 16 ++++++++-------- mdviewer.yml | 2 +- tests/e2e/pageObjects/OcisPage.js | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89dd49e..bbc03a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ -FROM node:alpine AS stage +FROM owncloudci/nodejs:20 AS stage WORKDIR /extension COPY . . -RUN npm install -g pnpm RUN pnpm install RUN pnpm build -FROM node:alpine +FROM alpine:3.20 WORKDIR /app COPY --from=stage /extension/dist ./ diff --git a/README.md b/README.md index bcd1469..5c8b3a8 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,14 @@ It allows users to: Apps directory is set using the `WEB_ASSET_APPS_PATH` environment variable. +### Installating Md-Viewer to the oCIS Deployment + +1. Navigate to the `deployments/examples/ocis_full/web_extensions` folder of your installation and copy [`mdviewer.yml`] into the [`web_extensions`](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full/web_extensions) subfolder. + +2. Add `MDVIEWER=:web_extensions/mdviewer.yml` to the `## oCIS Web Extensions ##` section of the `.env` file of your installation (file is located in `deployments/examples/ocis_full`).\ Add that variable in the `COMPOSE_FILE` variable at the last line. +3. Run `docker compose up` to run the extension with oCIS + oCIS URL: [ocis.owncloud.test](https://ocis.owncloud.test) + ## Creating Presentation Please, refer to the [documentation](https://revealjs.com/markdown/) for more information about creating a presentation using markdown. @@ -73,11 +81,3 @@ docker compose up ``` oCIS URL: [localhost:9200](https://localhost:9200) - - -### Adding Md-Viewer to the oCIS Deployment Example - -1. Navigate to the `deployments/examples/ocis_full/web_extensions` folder of your installation and copy [`mdviewer.yml`] into the [`web_extensions`](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full/web_extensions) subfolder. - -2. Add `MDVIEWER=:web_extensions/mdviewer.yml` to the `## oCIS Web Extensions ##` section of the `.env` file of your installation (file is located in `deployments/examples/ocis_full`).\ Add that variable in the `COMPOSE_FILE` variable at the last line. - 3. Run `docker compose up` to run the extension with oCIS diff --git a/mdviewer.yml b/mdviewer.yml index d4f3197..e02c0f9 100644 --- a/mdviewer.yml +++ b/mdviewer.yml @@ -7,7 +7,7 @@ services: condition: service_completed_successfully md-viewer: - image: jankaritechnepal/md-viewer:latest + image: sabinpanta/md-viewer:latest user: root volumes: - ocis-apps:/apps diff --git a/tests/e2e/pageObjects/OcisPage.js b/tests/e2e/pageObjects/OcisPage.js index ecad2fb..3e87a34 100644 --- a/tests/e2e/pageObjects/OcisPage.js +++ b/tests/e2e/pageObjects/OcisPage.js @@ -7,7 +7,7 @@ class Ocis { this.loginFormSelector = '.oc-login-form' this.usernameInputFieldSelector = '#oc-login-username' this.passwordInputFieldSelector = '#oc-login-password' - this.loginBtnSelector = '.jss8 .oc-button-primary' + this.loginBtnSelector = 'button[type="submit"]' this.filesContainerSelector = '#files-view' this.contextMenuBtnSelector = '.resource-table-btn-action-dropdown' this.openInPresentationViewerBtnSelector = '.oc-files-actions-presentation-viewer-trigger'