Specify target, move envvars to file, improve mocking

This commit is contained in:
flowgunso
2024-06-07 15:29:44 +02:00
parent 8e01d6758e
commit 18b78a981f
5 changed files with 51 additions and 32 deletions
+10 -7
View File
@@ -1,20 +1,23 @@
TARGET?=unstable
TARGET?=oldstable # or stable, unstable
mock:
docker compose -f tests/mock/compose.yaml up -d
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml up --remove-orphans -d
unmock:
docker compose -f tests/mock/compose.yaml down
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml down
client:
docker compose -f tests/mock/compose.yaml rm -fs client
docker compose -f tests/mock/compose.yaml up -d client
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml rm -fs client
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml up --remove-orphans -d client
shell:
docker compose -f tests/mock/compose.yaml exec client bash
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml run --rm client bash
logs:
docker compose -f tests/mock/compose.yaml logs -f client
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml logs -f client
ps:
TARGET=${TARGET} docker compose -f tests/mock/compose.yaml ps
build:
TARGET=${TARGET} CI_COMMIT_TAG=${CI_COMMIT_TAG} bash scripts/build-images.sh
+4 -1
View File
@@ -15,7 +15,10 @@ RUN apt-get update && \
oathtool \
ca-certificates \
gnupg \
sudo && \
sudo \
# procps \
iputils-ping \
&& \
apt-get clean && apt-get autoclean && \
rm -rf \
/var/log/fsck/*.log \
+12 -24
View File
@@ -1,47 +1,35 @@
name: seafile-client-${TARGET}
services:
mariadb:
image: mariadb:10.11
environment:
- MYSQL_ROOT_PASSWORD=password # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=1
env_file: env
volumes:
- database:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
memcached:
image: memcached:1.6.18
container_name: seafile-memcached
entrypoint: memcached -m 256
seafile:
image: seafileltd/seafile-mc:latest
hostname: seafile-${TARGET}
ports:
- "80:80"
- "80"
volumes:
- seafile:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=mariadb
- DB_ROOT_PASSWD=password # Requested, the value should be root's password of MySQL service.
- TIME_ZONE=Etc/UTC # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=seafile@localhost # Specifies Seafile admin user, default is 'me@example.com'.
- SEAFILE_ADMIN_PASSWORD=password # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
env_file: env
depends_on:
- mariadb
- memcached
client:
image: seafile-client:unstable
volumes:
#- library:/library
- data:/seafile
# user: "1000:1000"
environment:
SEAF_SERVER_URL: "http://seafile"
SEAF_USERNAME: "seafile@localhost"
SEAF_PASSWORD: "password"
SEAF_LIBRARY_UUID: "1b7d4e92-6753-4c4a-85b0-42566eab42c8"
DEBUG: 1
# image: flowgunso/seafile-client:9.0.5
image: seafile-client:${TARGET}
# volumes:
# - library:/library
# - data:/seafile
env_file: env
UID: 1000
GID: 100
depends_on:
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
until curl --output /dev/null --silent --head --fail http://seafile-${TARGET}; do
printf '.'
sleep 5
done
+19
View File
@@ -0,0 +1,19 @@
# Database
MYSQL_ROOT_PASSWORD=password # Requested, set the root's password of MySQL service.
MYSQL_LOG_CONSOLE=true
MARIADB_AUTO_UPGRADE=1
# Seafile
DB_HOST=mariadb
DB_ROOT_PASSWD=password # Requested, the value should be root's password of MySQL service.
TIME_ZONE=Etc/UTC # Optional, default is UTC. Should be uncomment and set to your local time zone.
SEAFILE_ADMIN_EMAIL=seafile@localhost # Specifies Seafile admin user, default is 'me@example.com'.
SEAFILE_ADMIN_PASSWORD=password # Specifies Seafile admin password, default is 'asecret'.
SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
# Client
SEAF_SERVER_URL="http://seafile-${TARGET}"
SEAF_USERNAME="seafile@localhost"
SEAF_PASSWORD="password"
DEBUG=1
# SEAF_LIBRARY_UUID="" # Use this for custom library ID