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

Expand Contributing guide #154

Open
benjaminapetersen opened this issue Feb 14, 2025 · 0 comments
Open

Expand Contributing guide #154

benjaminapetersen opened this issue Feb 14, 2025 · 0 comments

Comments

@benjaminapetersen
Copy link

benjaminapetersen commented Feb 14, 2025

I imagine there may be some tips and tricks relevant to those who are interested in contributing. I experimented a bit the other day, and wrote up this script for myself, to do some local dev work:

#!/bin/bash

# root dir, next to Dockerfile

DEV_TAG="0.0.1"
DEV_NAME="tasks-dev.md"
DEV_REGISTRY="benjaminapetersen" # change to your own name
DEV_IMAGE="${DEV_REGISTRY}/${DEV_NAME}:${DEV_TAG}"
DEV_PORT="8125"
DEV_TITLE="Tasks.md Dev | My Dev Tasks"

# stop, delete, clean local file system to avoid a cached image
# and also wipe weird configs if dev work writes a messy file
echo "STOPPING ${DEV_NAME}..."
docker stop "$DEV_NAME"

echo "DELETING ${DEV_NAME}..."
docker rm "$DEV_NAME"
sleep .5

echo "CLEANING UP DEV..."
rm -rf dev_tasks_files
rm -rf dev_config_files
sleep .5
mkdir dev_tasks_files
mkdir dev_config_files
sleep .5

# rebuild the image in local registry
echo "BUILDING ${DEV_IMAGE}..."
docker build -t "${DEV_IMAGE}" .
sleep .5

# run it again after a rebuild
echo "STARTING ${DEV_IMAGE}..."
docker run -d \
  --name "${DEV_NAME}" \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TITLE="${DEV_TITLE}" \
  -e BASE_PATH="/tasks.md/" \
  -e LOCAL_IMAGES_CLEANUP_INTERVAL=1440 \
  -p ${DEV_PORT}:8080 \
  -v $PWD/dev_tasks_files/:/tasks/ \
  -v $PWD/dev_config_files/:/config/ \
  --restart unless-stopped \
  "${DEV_IMAGE}"


# just some output
echo "Running Task.md...."
echo "If killed, can restart without running this script again:"
echo " - find the pid of the image"
echo " - then run:"
echo "    docker start <pid>"
echo "Visit in browser:"
echo "  http://localhost:${DEV_PORT}/tasks.md/"
echo ""
echo "View official releases: https://github.com/BaldissaraMatheus/Tasks.md/releases"
echo ""
echo "Running dev version as: ${DEV_IMAGE}"

# check the logs immediately
echo "LOGS FOR ${DEV_NAME}..."
docker logs -f "${DEV_NAME}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant