Skip to content

Macaron docker breaks in CI with default entry point #342

Open
@jgsuess

Description

@jgsuess

Compare L21

Executing "step_script" stage of the job script
00:00
Using docker image sha256:e90e8ba0[18](https://gitlab.com/committed-consulting/mde-devops/macaron-example/-/jobs/4555123889#L18)ae4bbbc6cfcde6518561bce7aa040[19](https://gitlab.com/committed-consulting/mde-devops/macaron-example/-/jobs/4555123889#L19)a05df976b9a28217f64321c for ghcr.io/oracle/macaron:latest with digest ghcr.io/oracle/macaron@sha256:5e1c888e45d14f5b1d396f493b457e88a4385aaf09c39a0edf92754f06b8983c ...
Cannot find the GID and UID of the host machine's user. The output files generated could not be modifiable from the host machine.
Consider providing the GID and UID via the env variables USER_GID and USER_UID respectively.
bash: -c: line 1: syntax error near unexpected token `then'
bash: -c: line 1: `cd /home/macaron && . .venv/bin/activate && sh -c if [ -x /usr/local/bin/bash ]; then'

Seems this is due to a broken expansion of ${MACARON_PARAMS[*]}.

COMMAND="cd /home/macaron && . .venv/bin/activate && ${MACARON_PARAMS[*]}"

It is this issue

And this from the doco:

The runner expects that the image has no entrypoint or that the entrypoint is prepared to start a shell command.
(Emphasis me)

The following works in Gitlab ci, but is not pretty. Note that you will need to set the GITHUB_TOKEN in the environment variables of the run.

run_macaron:
    stage: build
    image:
      name: ghcr.io/oracle/macaron:latest
      entrypoint: [""]
    script:
      - /bin/bash /home/macaron/user.sh macaron analyze -rp https://github.com/micronaut-projects/micronaut-core -b 4.0.x -d 82d115b4901d10226552ac67b0a10978cd5bc603

Metadata

Metadata

Assignees

No one assigned

    Labels

    integrationThe issues about integrating Macaron with other systems.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions