1

I am working on a plsql project (with a lot of stored procedure(SP)) hosted on my gitlab server, every SP is on a single file. I want create a new file on every build (using gitlab-ci) that contains the changes of the SP. My question is how can I get the list of the files with his status (new, delete or modified) between every build? Remember that I am running gitlab-ci with gitlab-runner, and the runner fetch the changes before that I have the chances of made a git diff.

Thanks.

UPDATE: Log from the build gitlab-ci

Using Shell executor...
Running on rsdesa11...
Fetching changes...
Removing Common/target/
Removing core/target/
Removing loader/target/
Removing model/target/
HEAD is now at 86266c3
emperator
  • 23
  • 1
  • 5

1 Answers1

0

I assume that you already have a runner / shared runner. If not check out: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md

It depends a bit on your gitlab-ci-runner. If you have a shell runner (when you register your runner, select "shell"), you can specify a gitlab-ci.yml with arbitary bash commands you want to execute.

job_title:
  script:
    ls -la
    git diff 12345 > my_diff.txt

The rest is bash magic that highly depends on how your setup looks like, how your folders look like and so on.

Docker runners are a bit more complicated and in general require a bit more knowledege about docker commands and volumes to do what you want to do.

chickahoona
  • 1,914
  • 14
  • 23
  • Thanks. Yes, I already have a runner. I don't want the difference, I need the files that has been modified with his status (new, delete, changed) because I have to execute the entire SP into the database. And the things is that the runner execute the pull before I have the chance of made a git diff... – emperator Feb 07 '16 at 16:06