Gitlab-CI Date variable for test file name

My program has a log file that it outputs when it exits. I would like this output file to be named after the date it was run.

I tried to set the date variable and also add it to the string. This post says it works inline, but I had no luck with this method.

My current gitlab-ci.yml is

variables:
    MyProjectEXE: My\Project\myproject.exe
    MSBuild: C:\Path\to\my\MSBuild.exe
    Solution: C:\Path\to\my\project.sln

stages:
    - build
    - test

build:
    stage: build
    script: '"%MSBuild%" "%Solution%"'

test:
    stage: test
    script:
    - '"%MSBuild%" "%Solution%"'
    - '%MyProjectEXE%" --results C:\path\to\my\results\log-$(date + \"%Y%m%d-%H%M%S\").csv

      

The second test script just outputs a file named

C:\path\to\my\results\log-$(date

      

I tried to create a variable containing the date at the top and put it there, and I tried almost every form of quotes around that log file name.

+3


source to share





All Articles