1

Using docToolchain with GitLab CICD pipeline:

I want to use the doctoolchain (http://doctoolchain.org/docToolchain/v2.0.x/index.html) in my GitLab Projekt in a ci pipeline. I found this example project (https://github.com/docToolchain/ci-cd-demo) and copied the .gitlab-ci.yml file in my project.

This is my .gitlab-ci.yml file:

image: doctoolchain/doctoolchain:v2.2.1
pages:
  stage: build
  script:
    - export DTC_HEADLESS=true
    - ./dtcw.bat generateSite #I changed here the command from ./dtcw to ./dtcw.bat
    - mkdir public
    - cp -r build/microsite/output/. public/.
  artifacts:
    paths:
      - public/

But when I am running the pipeline the pipeline failes and the following error is shown:

$ ./dtcw generateSite
/bin/bash: line 135: ./dtcw.bat: Permission denied

I installed the doctoolchain first in my local project and then pushed to my gitlab project. The project has the following files: dtcw.ps1, dtcw.bat, docToolchainconfig.groovy. The example project has also a file dtcw which i do not have in my project. Thats why i changed the .gitlab-ci.yml file to ./dtcw.bat, I also tried ./dtcw.ps1. But in both cases the error messages: Permission denied is shown. Do I need to add the file dtcw? What file is this?

Thank you for your help

Cat
  • 13
  • 3

1 Answers1

1

dtcw is the doctoolchain wrapper script. It is responsible for retrieving and correctly executing the doctoolchain binaries for your build. You will need to use the correct one which corresponds to the image you're using (i.e. doctoolchain/doctoolchain:v2.2.1 which is based on Alpine Linux, therefore you will need to use the plain dtcw file - the dtcw.bat file would be used on windows).

To execute it you can either

  1. make the file executable using chmod +x dtcw in your job's script section
  2. call the shell explicitly like this: /bin/sh dtcw
VeryDogeWow
  • 142
  • 7
  • Thank you, now i added the file dtcw to my project. I tried to use chmod +x dtcw in my script, but I get the following error: chmod: dtcw: Operation not permitted. Do you know, how I can solve this issue? – Cat Jun 05 '23 at 13:12
  • 1
    I found a solution: i used "git update-index --chomd-+x dtcw" and pushed then to my repository, know i have the rights to execute this file. Thank you – Cat Jun 05 '23 at 14:29
  • here is a demo for gitlab and github: https://github.com/docToolchain/ci-cd-demo – rdmueller Jun 06 '23 at 14:05