aaronemeier / gtt-upload

Small utility for automated Gitlab time tracking reports to OneDrive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gtt-upload

Small utility for automated Gitlab time tracking reports to OneDrive.

Preparation

  • Register a new app on https://apps.dev.microsoft.com
  • Copy config/config.dist.sh to config/config.sh and set it up according to your needs:
    • GITLAB_URL: "http://example.gitlab.com/api/v4/"
    • GITLAB_TOKEN: Personal Access Token from Gitlab
    • GITLAB_PROJECT: Gitlab workspace (e.g. "Group/Project/Repository")
    • GTT_CLIENT_SECRET: Secret from the apps registration for OneDrive upload
    • GTT_CLIENT_ID: Specify a client Id for authentication for OneDrive upload
    • ONEDRIVE_FILE: Set the filename for OneDrive Timetracking.xlsx
  • Copy config/users.dist.csvto config/users.csv and setup user mapping: This will replace usernames in the report
  • Install and setup docker

Run

At first, we have to run interactively to authenticate

docker build --rm -t gtt-upload:latest ./ && docker run  -v $PWD/.root/:/root/ --env-file config/config.cfg -it gtt-upload:latest

After that the session has been saved and we can upload without any interaction.
We can use the following command to run it via cron and we don't have to rebuild the image everytime:

docker run  -v $PWD/.root/:/root/ --env-file config/config.cfg gtt-upload:latest

About

Small utility for automated Gitlab time tracking reports to OneDrive


Languages

Language:Python 86.6%Language:Dockerfile 11.5%Language:Shell 1.9%