IlyaSemenov / gitlab-ci-git-push

Gitlab CI runner image that pushes to a remote Git repo (Dokku, Heroku, Deis, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to display `git-push` command output?

JanMikes opened this issue · comments

Hello!

Please is it possible (and how? i am able to send PR) to display output of the git-push command?

I would love to see Dokku's build in my Gitlab CI job log.

So far i have found this answer https://stackoverflow.com/a/2853811/6783051 using set -x but it adds + on each line which is imho ugly.

The output is already returned as is. The script doesn't do any stream redirect/wrapping. What exactly are you missing?

Example GitLab job output:

Running with gitlab-runner 12.0.2 (d0b76032)
  on runner1.acme.com Vx1EEubJ
Using Docker executor with image ilyasemenov/gitlab-ci-git-push ...
Pulling docker image ilyasemenov/gitlab-runner-helper-git-crypt:latest ...
Using docker image sha256:4f11fb7648bb5c34b3376ab3f005eb0e7e13f9e87e31fc5a42ba8a161d2e8363 for ilyasemenov/gitlab-runner-helper-git-crypt:latest ...
Pulling docker image ilyasemenov/gitlab-ci-git-push ...
Using docker image sha256:9835efd69db571e1eb1988d29de8a7f4733764eddd2abbe5076ba2459a062534 for ilyasemenov/gitlab-ci-git-push ...
Running on runner-Vx1EEubJ-project-129-concurrent-0 via runner1.acme.com...
Fetching changes...
Reinitialized existing Git repository in /builds/osago/osago/.git/
From https://git.acme.com/osago/osago
   d21bec3..af5f0cc  master     -> origin/master
Checking out af5f0ccf as master...

Skipping Git submodules setup
$ git-push dokku@runner1.acme.com:osago
# runner1.acme.com:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
# runner1.acme.com:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
# runner1.acme.com:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
Warning: Permanently added the ECDSA host key for IP address '1.2.3.4' to the list of known hosts.
remote: -----> Cleaning up...        
remote: -----> Building osago from dockerfile...        
remote: -----> Setting config vars        
remote:        DOKKU_DOCKERFILE_PORTS:  80        
remote: -----> Setting config vars        
remote:        DOKKU_DOCKERFILE_CMD:  CMD docker/entrypoint.sh        
remote: Sending build context to Docker daemon    343kB        
remote: 
remote: 
remote: Step 1/11 : FROM ubuntu:18.04        
remote:  ---> 94e814e2efa8        
remote: Step 2/11 : WORKDIR /app        
remote:  ---> Using cache        
remote:  ---> 611d3ad36e9e        
remote: Step 3/11 : CMD docker/entrypoint.sh        
remote:  ---> Using cache        
remote:  ---> 8af7738c080f        

....

remote: -----> Shutting down old containers in 60 seconds        
remote: =====> 0a35a8211d5fa10e1f8e6748d2402b594452db1bc3a2cdda25928c33265fa11f        
remote: =====> Application deployed:        
remote:        http://osago.acme.com        
remote:        https://osago.acme.com        
remote:         
To runner1.acme.com:osago
   d21bec3..af5f0cc  af5f0ccfc6ac3f0f50c73163c4327575077d1354 -> master
Job succeeded

God damn, you are right! Thank you very much for your quick answer.

I have checked my log:

Running with gitlab-runner 11.0.0 (5396d320)
  on docker-runner-4gb-fra1-01 da650b8a
Using Docker executor with image ilyasemenov/gitlab-ci-git-push ...
Pulling docker image ilyasemenov/gitlab-ci-git-push ...
Using docker image sha256:9835efd69db571e1eb1988d29de8a7f4733764eddd2abbe5076ba2459a062534 for ilyasemenov/gitlab-ci-git-push ...
Running on runner-da650b8a-project-8223659-concurrent-0 via docker-runner-4gb-fra1-01...
Fetching changes...
Removing .dpl/
HEAD is now at c351828 Deploy DEV to dokku
Checking out c351828d as master...
Skipping Git submodules setup
$ git-push dokku@apps.entry.do:dq-screen-dev
# apps.entry.do:22 SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u6
# apps.entry.do:22 SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u6
# apps.entry.do:22 SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u6
Warning: Permanently added the ECDSA host key for IP address '35.198.101.248' to the list of known hosts.
Everything up-to-date
Job succeeded

And did not realize the output is there, but it does "nothing" because of "Everything up-to-date" (i had to trigger deploy manually before able to use it on CI, because of #9 ).