Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(service/webdav): Add docker-compose file to simplify the CI #2873

Merged
merged 6 commits into from
Aug 27, 2023
Merged
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
43 changes: 8 additions & 35 deletions .github/workflows/service_test_webdav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,10 @@ jobs:
with:
need-nextest: true

- name: Install nginx full for dav_ext modules
run: sudo apt install nginx-full

- name: Start nginx
shell: bash
working-directory: core
run: |
mkdir -p /tmp/static
nginx -c `pwd`/src/services/webdav/fixtures/nginx.conf
working-directory: core/src/services/webdav/fixtures
run: docker compose -f docker-compose-webdav.yml up -d

- name: Test
shell: bash
Expand All @@ -73,16 +68,10 @@ jobs:
with:
need-nextest: true

- name: Install nginx full for dav_ext modules
run: sudo apt install nginx-full

- name: Start nginx
shell: bash
working-directory: core
run: |
mkdir -p /tmp/static
cp `pwd`/src/services/webdav/fixtures/htpasswd /tmp/htpasswd
nginx -c `pwd`/src/services/webdav/fixtures/nginx-with-basic-auth.conf
working-directory: core/src/services/webdav/fixtures
run: docker compose -f docker-compose-webdav-with-auth.yml up -d

- name: Test with password
shell: bash
Expand All @@ -103,16 +92,10 @@ jobs:
with:
need-nextest: true

- name: Install nginx full for dav_ext modules
run: sudo apt install nginx-full

- name: Start nginx
shell: bash
working-directory: core
run: |
mkdir -p /tmp/static
cp `pwd`/src/services/webdav/fixtures/htpasswd /tmp/htpasswd
nginx -c `pwd`/src/services/webdav/fixtures/nginx-with-basic-auth.conf
working-directory: core/src/services/webdav/fixtures
run: docker compose -f docker-compose-webdav-with-empty-passwd.yml up -d

- name: Test empty password
shell: bash
Expand All @@ -132,20 +115,10 @@ jobs:
with:
need-nextest: true

- name: Install nginx full for dav_ext modules
run: sudo apt install nginx-full

- name: Start nginx
shell: bash
working-directory: core
run: |
mkdir -p /tmp/static
mkdir -p /var/lib/nginx
# make nginx worker has permission to operate it
chmod a+rw /tmp/static/
# make nginx worker has permission to operate it
sudo chmod 777 /var/lib/nginx/body
nginx -c `pwd`/src/services/webdav/fixtures/nginx.conf
working-directory: core/src/services/webdav/fixtures
run: docker compose -f docker-compose-webdav.yml up -d

- name: Test with redirect
shell: bash
Expand Down
13 changes: 13 additions & 0 deletions core/src/services/webdav/fixtures/config/nginx/http.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# the following configuration is for redirect test
server {
listen 81;
server_name localhost;
access_log /tmp/forward-access.log;
error_log /tmp/forward-error.log;

location / {
client_max_body_size 1024M;
# forward all other requests to port 80
proxy_pass http://127.0.0.1:80;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3.8'

services:
webdav:
image: dgraziotin/nginx-webdav-nononsense
ports:
- "8080:80"
volumes:
- webdav-data:/data
environment:
- WEBDAV_USERNAME=bar
- WEBDAV_PASSWORD=bar

volumes:
webdav-data:
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3.8'

services:
webdav:
image: dgraziotin/nginx-webdav-nononsense
ports:
- "8080:80"
volumes:
- webdav-data:/data
environment:
- WEBDAV_USERNAME=foo

volumes:
webdav-data:
34 changes: 34 additions & 0 deletions core/src/services/webdav/fixtures/docker-compose-webdav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3.8'

services:
webdav:
image: dgraziotin/nginx-webdav-nononsense
ports:
- "8080:80"
# the following port is used by the test redirect
- "8081:81"
volumes:
- webdav-data:/data
# the following volume is used to redirect 81 port to 80 port
# ./config/nginx/http.conf will be appended to the default nginx.conf
- ./config:/config

volumes:
webdav-data:
2 changes: 0 additions & 2 deletions core/src/services/webdav/fixtures/htpasswd

This file was deleted.

28 changes: 0 additions & 28 deletions core/src/services/webdav/fixtures/nginx-with-basic-auth.conf

This file was deleted.

43 changes: 0 additions & 43 deletions core/src/services/webdav/fixtures/nginx.conf

This file was deleted.

Loading