DopplerHQ / cli

The official CLI for interacting with your Doppler secrets and configuration.
https://docs.doppler.com
Apache License 2.0
219 stars 44 forks source link

[BUG] unknown shorthand flag: 'c' in -c #246

Closed designamx closed 2 years ago

designamx commented 3 years ago

Describe the bug I'm using a Gitlab CICD to manage a project, I have created a job to get the env variables into a dotenv file to deploy a docker container, how ever it fails to get the secrets

To Reproduce Steps to reproduce the behavior. Please include output from running the command with --debug. This is what I have in my .gitlab-ci.yml

image: dopplerhq/cli:3.31
  script:
    - doppler secrets download --format=env-no-quotes --no-file > .env
  artifacts:
    paths:
      - .env

However I'm getting this error in the terminal Executing "step_script" stage of the job script 00:01 Using docker image sha256:5d3bba437f2ec4624e61f573eef5b2d3869b81bfef959174a08ca4c240a60e05 for dopplerhq/cli:3.31 with digest dopplerhq/cli@sha256:6061cf338badf1a88950f9e7da2c3b6a9da3653136e393bab2e2fd50154e51b7 ... Error: unknown shorthand flag: 'c' in #-c

Expected behavior As a workaround I'm using a custom docker image with Doppler installed so I'm getting a dotenv file as artifact

Desktop (please complete the following information):

CLI Version: 3.31

Additional context Add any other context about the problem here.

designamx commented 2 years ago

I want to share my findings in case people are using CI pipelines, the problem I was facing was with the entrypoint, so I overwrite it

prep:
  stage: deploying
  only:
    - main
    - master
  when: manual
  variables:
    DOPPLER_TOKEN: $DOPPLER_TOKEN
  tags:
    - build
  image:
    name: dopplerhq/cli:3.37
    entrypoint: [""]
  script:
    - doppler secrets download --format=env-no-quotes --no-file > .env
  artifacts:
    paths:
      - .env
    expire_in: 1 hour