From ede9bb47b6eac04fd7ebb365f0835f3eef43994e Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Tue, 13 Oct 2020 14:13:33 +0200 Subject: [PATCH] Fix codacy --- .codacy.yml | 4 +++- ocis/docker/eos-ocis-dev/README.md | 38 +++++++++++++++--------------- ocis/docker/eos-ocis/Dockerfile | 2 +- ocis/docker/eos-ocis/README.md | 16 ++++++------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.codacy.yml b/.codacy.yml index 4f5704e63f..6bfc61e05b 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -10,5 +10,7 @@ exclude_paths: - 'konnectd/assets/identifier/**' - 'settings/rollup.config.js' - 'accounts/rollup.config.js' + - 'ocis/docker/eos-ocis/Dockerfile' + - 'ocis/docker/eos-ocis-dev/Dockerfile' -... \ No newline at end of file +... diff --git a/ocis/docker/eos-ocis-dev/README.md b/ocis/docker/eos-ocis-dev/README.md index 4e029100bd..6f4b3c384f 100644 --- a/ocis/docker/eos-ocis-dev/README.md +++ b/ocis/docker/eos-ocis-dev/README.md @@ -3,29 +3,29 @@ Image is based on [owncloud/eos-base](https://hub.docker.com/r/owncloud/eos-base) from [eos-stack](https://github.com/owncloud-docker/eos-stack) ## Build -``` +```shell docker build -t owncloud/eos-ocis-dev:latest . ``` ## Publish -``` +```shell docker push owncloud/eos-ocis-dev:latest ``` -## Maintainer +## Maintainer -- [Felix Böhm](https://github.com/felixboehm) +* [Felix Böhm](https://github.com/felixboehm) -## Disclaimer +## Disclaimer Use only for development or testing. Setup is not secured nor tested. -# oCIS development on eos +## oCIS development on eos -## Setup oCIS +### Setup oCIS To build and run your local ocis code with default storage driver -``` +```shell docker run --rm -ti --name ocis -v $PWD:/ocis -p 9200:9200 owncloud/eos-ocis-dev ``` @@ -35,13 +35,13 @@ Data is here: `docker exec -it ocis ll /var/tmp/reva/` Alternative: With the [docker-compose.yml file in ocis repo](https://github.com/owncloud/ocis/blob/master/docker-compose.yml) you can also start ocis via compose: -``` +```shell docker-compose up -d ocis ``` Now try to list the running services -``` +```shell docker-compose exec ocis ./bin/ocis list ``` @@ -49,36 +49,36 @@ docker-compose exec ocis ./bin/ocis list 1. Start the eos cluster and ocis via the compose stack -``` +```shell docker-compose up -d ``` 2. Configure to use eos storage driver instead of default storage driver -- kill the home storage and data providers. we need to switch them to the eoshome driver: +* kill the home storage and data providers. we need to switch them to the eoshome driver: -``` +```shell docker-compose exec ocis ./bin/ocis kill reva-storage-home docker-compose exec ocis ./bin/ocis kill reva-storage-home-data ``` -- restart them with the eoshome driver and a new layout: +* restart them with the eoshome driver and a new layout: -``` +```shell docker-compose exec -e REVA_STORAGE_EOS_LAYOUT="{{substr 0 1 .Username}}/{{.Username}}" -e REVA_STORAGE_HOME_DRIVER=eoshome -d ocis ./bin/ocis run reva-storage-home docker-compose exec -e REVA_STORAGE_EOS_LAYOUT="{{substr 0 1 .Username}}/{{.Username}}" -e REVA_STORAGE_HOME_DATA_DRIVER=eoshome -d ocis ./bin/ocis run reva-storage-home-data ``` -- restart the reva frontend with a new namespace (pointing to the eos storage provider) for the dav files endpoint +* restart the reva frontend with a new namespace (pointing to the eos storage provider) for the dav files endpoint -``` +```shell docker-compose exec ocis ./bin/ocis kill reva-frontend docker-compose exec -e DAV_FILES_NAMESPACE="/eos/" -d ocis ./bin/ocis run reva-frontend ``` -- login with `einstein / relativity`, upload a file to einsteins home and verify the file is there using +* login with `einstein / relativity`, upload a file to einsteins home and verify the file is there using -``` +```shell docker-compose exec ocis eos ls -l /eos/dockertest/reva/users/e/einstein/ -rw-r--r-- 1 einstein users 10 Jul 1 15:24 newfile.txt ``` diff --git a/ocis/docker/eos-ocis/Dockerfile b/ocis/docker/eos-ocis/Dockerfile index ca0b431b11..c59feb3ac7 100644 --- a/ocis/docker/eos-ocis/Dockerfile +++ b/ocis/docker/eos-ocis/Dockerfile @@ -21,7 +21,7 @@ RUN cd ocis && go build -v -o bin/ocis -toolexec '/usr/bin/time -v' ./cmd/ocis # build user lookup test program RUN mkdir -p /build -ADD user.go /build/user.go +COPY user.go /build/user.go RUN cd /build && go build -o user user.go diff --git a/ocis/docker/eos-ocis/README.md b/ocis/docker/eos-ocis/README.md index 17a6690803..bacad37384 100644 --- a/ocis/docker/eos-ocis/README.md +++ b/ocis/docker/eos-ocis/README.md @@ -4,29 +4,27 @@ Image is based on [owncloud/eos-base](https://hub.docker.com/r/owncloud/eos-base ## Build Build owncloud/ocis master branch -``` +```shell docker build -t owncloud/eos-ocis:latest . ``` Or build a certain branch / tag -``` +```shell docker build -t owncloud/eos-ocis:1.0.0 --build-arg BRANCH=v1.0.0./eos-ocis ``` ## Publish -``` +```shell docker push owncloud/eos-ocis:latest ``` -## Maintainer +## Maintainer -- [Felix Böhm](https://github.com/felixboehm) + * [Felix Böhm](https://github.com/felixboehm) -## Disclaimer +## Disclaimer Use only for development or testing. Setup is not secured nor tested. ## Example Usage -See https://github.com/owncloud-docker/compose-playground/tree/master/examples/eos-compose - - +See