A
A
akdes2019-09-20 16:59:59
GitLab
akdes, 2019-09-20 16:59:59

How to update a variable in Gitlab CI during CI/CD?

Hi all.
I use gitlab to build and then upload docker images to kubernetes.
Gitlab-Runner, sits in the docker, on the local machine - we don’t want to shove runner into k8s yet, or rather we want, but the issue has not yet been agreed, so do not suggest this.
Access-Config(~/.kube/config) from k8s I wrote in project variables gitlab/settings/CI CD/Variables
Problem:
As many people know, k8s updates the config after some time, it is updated during operation, but the container then rolls over and follows. since the config is taken from the old one, again from the gitlab variables. Accordingly, kubectl stops working until the config is updated.
Before I start inventing a wheel, and writing (and even worse, sending via http) a config somewhere to take it from there, I want to ask you how this problem is solved, except for manually updating the variable through the UI gitlab . I did not find an API for updating variables during the pipeline, or rather I found a statement that this is not possible.
If not at all, I will probably make a Volume for the Runner, and write the path to the file into the variable, but all the same, what if there is a more logical solution ..., without a physical link to the memory of the Runner?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Vokhmyanin, 2020-06-18
@Delagen

You can forward any data through tasks through artifacts, in principle, the standard deploy in Gitlab worked for some time.
That is, in the first stage, some tasks create a file that is specified in artifacts
. In the following tasks, it is used, but you also need to take into account the lifetime of this file if there are tasks that are started manually with a very delayed time

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question