Closed nthings closed 6 years ago
FYI managed to get output with this command:
time_report:
stage: time_report
image: nthingsm/gtm
script:
- gtm init
- git fetchgtm
- git log --pretty=%H --since="last month" | gtm report -format timeline-hours -this-month
UPDATE: Running the command in my local gives different times for the report. Local
[0;0m
00.01.02.03.04.05.06.07.08.09.10.11.12.01.02.03.04.05.06.07.08.09.10.11.
------------------------------------------------------------------------
Fri Feb 09 | ▁▁▁██████▃▃▃▂▂▂███▁▁▁ | 3h 27m 0s
------------------------------------------------------------------------
Mon Feb 12 | ▅▅▅███▃▃▃ ▁▁▁▆▆▆ | 2h 27m 0s
------------------------------------------------------------------------
Tue Feb 13 | ▁▁▁ ▂▂▂ ▃▃▃ ▅▅▅▃▃▃ | 1h 14m 0s
------------------------------------------------------------------------
Wed Feb 14 | ▃▃▃ ▂▂▂▄▄▄▁▁▁██████▂▂▂ | 3h 16m 0s
------------------------------------------------------------------------
Thu Feb 15 | ▁▁▁▃▃▃▆▆▆▂▂▂▄▄▄▁▁▁▃▃▃▁▁▁ | 2h 8m 0s
------------------------------------------------------------------------
Fri Feb 16 | ▂▂▂▁▁▁ | 16m 0s
------------------------------------------------------------------------
Tue Feb 20 | ▁▁▁ | 5m 0s
------------------------------------------------------------------------
Wed Feb 21 | ▅▅▅▄▄▄ ▃▃▃ | 1h 20m 0s
------------------------------------------------------------------------
Thu Feb 22 | ▁▁▁▁▁▁▂▂▂▁▁▁▃▃▃ | 39m 0s
------------------------------------------------------------------------
Fri Feb 23 | ▃▃▃▁▁▁ | 24m 0s
------------------------------------------------------------------------
15h 16m 0s
[0m
Gitlab Pipeline:
[0;0m
00.01.02.03.04.05.06.07.08.09.10.11.12.01.02.03.04.05.06.07.08.09.10.11.
------------------------------------------------------------------------
Fri Feb 09 | ▁▁▁██████▃▃▃▂▂▂███▁▁▁ | 3h 27m 0s
------------------------------------------------------------------------
Mon Feb 12 | ▅▅▅███▃▃▃ ▁▁▁▆▆▆ | 2h 27m 0s
------------------------------------------------------------------------
Tue Feb 13 | ▁▁▁ ▂▂▂ ▃▃▃ ▅▅▅▃▃▃ | 1h 14m 0s
------------------------------------------------------------------------
Wed Feb 14 | ▃▃▃ ▂▂▂▄▄▄▁▁▁██████▂▂▂ | 3h 16m 0s
------------------------------------------------------------------------
Thu Feb 15 | ▁▁▁▃▃▃▆▆▆▂▂▂▄▄▄▁▁▁▃▃▃▁▁▁ | 2h 8m 0s
------------------------------------------------------------------------
Fri Feb 16 | ▂▂▂▁▁▁ | 16m 0s
------------------------------------------------------------------------
Tue Feb 20 | ▁▁▁ | 5m 0s
------------------------------------------------------------------------
Wed Feb 21 | ▅▅▅▄▄▄ ▃▃▃ | 1h 20m 0s
------------------------------------------------------------------------
Thu Feb 22 | ▁▁▁▁▁▁▂▂▂▁▁▁▁▁▁ | 24m 0s
------------------------------------------------------------------------
14h 37m 0s
[0m
This gets the time from the system?
Correct, the difference in time would be the timezone of the system you ran it on.
I tested gtm in your Docker container and it seems to work fine. I assume you are cloning the git repo within the Docker container. I would guess there is a problem with how the pipeline is executing the command. Could also be a timing issue between git fetchgtm and gtm report commands. You could try sleeping for a bit before executing the gtm report command.
I can confirm that the timezone of the Docker container affected the timeline. Seems to be working now. Thanks 👍
I am playing around with the project into my Gitlab Pipeline for automating the reports and maybe exporting them. I created a docker image with gtm for running the commands into the pipeline https://hub.docker.com/r/nthingsm/gtm/ and in my .gitlab-ci.yml I have the next stage:
But the gtm report command doesn't output anything. Am I missing something?