fix: release tests

This commit is contained in:
Nicolas Meienberger 2022-10-07 13:36:29 +02:00
parent 0e16295dc3
commit 4a5eb2d430
10 changed files with 13 additions and 17 deletions

View file

@ -51,13 +51,10 @@ services:
ports:
- 3001:3001
volumes:
## Docker sock
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/apps:/runtipi/apps:ro
- ${PWD}/repos:/runtipi/repos:ro
- ${PWD}/state:/runtipi/state
- ${PWD}/packages/system-api/src:/api/src
- ${PWD}/logs:/app/logs
- ${STORAGE_PATH}:/app/storage
- ${PWD}/.env.dev:/runtipi/.env
# - /api/node_modules

View file

@ -44,8 +44,6 @@ services:
tipi-db:
condition: service_healthy
volumes:
## Docker sock
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/apps:/runtipi/apps:ro
- ${PWD}/repos:/runtipi/repos:ro
- ${PWD}/state:/runtipi/state

View file

@ -44,8 +44,6 @@ services:
tipi-db:
condition: service_healthy
volumes:
## Docker sock
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/apps:/runtipi/apps:ro
- ${PWD}/repos:/runtipi/repos:ro
- ${PWD}/state:/runtipi/state

View file

@ -11,7 +11,8 @@
"start:rc": "docker-compose -f docker-compose.rc.yml --env-file .env up --build",
"start:prod": "docker-compose --env-file .env up --build",
"start:pg": "docker run --name test-db -p 5433:5432 -d --rm -e POSTGRES_PASSWORD=postgres postgres",
"version": "echo $npm_package_version"
"version": "echo $npm_package_version",
"release:rc": "./scripts/deploy/release-rc.sh"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",

View file

@ -9,7 +9,7 @@ if (process.env.NODE_ENV !== 'production') {
dotenv.config({ path: '.env' });
}
const {
LOGS_FOLDER = 'logs',
LOGS_FOLDER = '/app/logs',
LOGS_APP = 'app.log',
LOGS_ERROR = 'error.log',
NODE_ENV = 'development',

View file

@ -68,7 +68,8 @@ function clean_logs() {
}
function kill_watcher() {
watcher_pid=$(pgrep -f "runtipi/state/events")
watcher_pid="$(ps aux | grep "scripts/watcher" | grep -v grep | awk '{print $2}')"
# kill it if it's running
if [[ -n $watcher_pid ]]; then
# If multiline kill each pid

3
scripts/deploy/release-rc.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t meienberger/runtipi:rc-"$(npm run version --silent)" . --push

View file

@ -4,8 +4,8 @@ source "${BASH_SOURCE%/*}/common.sh"
ROOT_FOLDER="${PWD}"
kill_watcher
"${ROOT_FOLDER}/scripts/watcher.sh" &
chmod -R a+rwx "${ROOT_FOLDER}/state/events"
chmod -R a+rwx "${ROOT_FOLDER}/state/system-info.json"
"${ROOT_FOLDER}/scripts/watcher.sh" &
docker compose -f docker-compose.dev.yml --env-file "${ROOT_FOLDER}/.env.dev" up --build

View file

@ -100,10 +100,11 @@ if [[ "${NGINX_PORT}" != "80" ]] && [[ "${DOMAIN}" != "tipi.localhost" ]]; then
exit 1
fi
kill_watcher
# Configure Tipi
"${ROOT_FOLDER}/scripts/configure.sh"
kill_watcher
chmod -R a+rwx "${ROOT_FOLDER}/state/events"
chmod -R a+rwx "${ROOT_FOLDER}/state/system-info.json"
"${ROOT_FOLDER}/scripts/watcher.sh" &
# Copy the config sample if it isn't here
@ -201,9 +202,6 @@ mv -f "$ENV_FILE" "$ROOT_FOLDER/.env"
# Run system-info.sh
echo "Running system-info.sh..."
bash "${ROOT_FOLDER}/scripts/system-info.sh"
echo "Fixing permissions for events file"
chmod -R a+rwx "${ROOT_FOLDER}/state/events"
chmod -R a+rwx "${ROOT_FOLDER}/state/system-info.json"
## Don't run if config-only
if [[ ! $ci == "true" ]]; then

View file

@ -17,7 +17,7 @@ function set_status() {
write_log "Setting status for ${id} to ${status}"
# Update the status of the event
sed -i '' "s/${id} [a-z]*/${id} ${status}/g" "${WATCH_FILE}"
sed -i "s/${id}.*$/$(echo "${id} ${status}" | sed 's/\//\\\//g')/" "$WATCH_FILE"
}
function run_command() {