edbizarro / gitlab-ci-pipeline-php

:coffee: Docker images for test PHP applications with Gitlab CI (or any other CI platform!)
https://hub.docker.com/r/edbizarro/gitlab-ci-pipeline-php
MIT License
529 stars 167 forks source link

[FEATURE] consider adding jq to image #69

Closed tenken closed 5 years ago

tenken commented 5 years ago

Hi -- I am using this image to automate gitlab CI tasks (using gitlab ce self hosted, not a paid-for gitlab customer). My build tasks require me to have multi-project pipelines. I can create and call pipelines via the API quite easily via the gitlab api documentaiton:

https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline

Create a new pipeline curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipeline?ref=master"

In alot of github and gitlab examples of gitlab-ci files developers use jq and tee alot to interact with the json responses and manipulate them as artifacts between job stages. For example see here https://zerotoprod.com/posts/gitlab-ci-advanced/

I do not see jq as an available utility in the image and I think it's very useful for scripting tasks within the container.

I do see tee in the container:

$ which tee
/usr/bin/tee

For ad-hoc purposes I can easily add jq to my toolchain via the below approach, but it has an APT package that could be added to the Dockerfile.

    - curl -L --insecure https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 --output artifacts/jq
    - chmod +x artifacts/jq; PATH=$PATH:artifacts
    - jq --version
edbizarro commented 5 years ago

Hi @tenken

Done!

tenken commented 5 years ago

Thank you @edbizarro I am using it as we speak!