CleverCloud / clever-tools-dockerhub

Dockerfile for clever-tools CLI
0 stars 1 forks source link

Error on gitlab ci #3

Open g-apparence opened 2 years ago

g-apparence commented 2 years ago

Hi, maybe I'm doing it wront but starting this image is not working using Gitlab

Used this :

deploy-staging:
  stage: deploy
  image: clevercloud/clever-tools:latest
  variables:
    APP_NAME: staging
    APP_ID: XXXXX
 script:
    - clever login --token $CLEVER_TOKEN --secret $CLEVER_SECRET
    - clever link ${APP_ID}
    - clever deploy -a ${APP_NAME}
  environment:
    name: staging
    url: https://staging-server.cleverapps.io

Error :

Using docker image sha256:62b45ec640ad8456d78a38176f2d151df4d8983baa016884ab7d7f80ea28a1b0 for clevercloud/clever-tools:latest with digest clevercloud/clever-tools@sha256:fba465eeafa1a91c8b20239a69dc5725478c619dbc48f70d5e559e958bbc6bf7 ...
Too many arguments: sh
Unknown option: c
Usage: clever

Tried without anything in the script part makes the same result, So I guess it's related directly to the docker image.

t-fritsch commented 1 year ago

Not sure this is still needed since your issue is quite old, but looking for documentation on the right way to use gitlab-ci with clever-cloud I stumbled upon your issue and this article :

https://k33g.gitlab.io/articles/2020-05-31-CI-CD-CLEVER-EN.html#%F0%9F%96%90%EF%B8%8F-if-you-used-the-gitlab-shared-runner-on-gitlab-com

I've not tested it (I don't use clevercloud docker image) but maybe it'll help someone one day so I leave it here (BTW if someone at clever-cloud reads this, it would be great to have an up to date documentation on the best way to integrate with Gitlab CI since there are many ressources out there)

If you used the GitLab shared runner on GitLab.com

replace:

image: clevercloud/clever-tools:latest

by

image: 
  name: clevercloud/clever-tools:latest
  entrypoint: ["/bin/sh", "-c"]