How to specify wildcard artifacts subdirectories in .gitlab-ci.yml?

The gitlab-ci-multi-runner build runner is built using Go and currently uses filepath.Glob() to scan for any specified artifacts in file_archiver.go. Go doesn’t seem to support the double star glob expression as discussed in another question here at SO. So there seem to be no way to use a full-featured **/bin expression at the moment. Because … Read more

How to access multiple repositories in CI build?

If you are running gitlab version 8.12 or later, the permissions model was reworked. Along with this new permission model comes the the CI environment variable CI_JOB_TOKEN. The premium version of GitLab uses this environment variable for triggers, but you can use it to clone repos. dummy_stage: script: – git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.instance/group/project.git

Run docker-compose build in .gitlab-ci.yml

Docker also provides an official image: docker/compose This is the ideal solution if you don’t want to install it every pipeline. Note that in the latest version of GitLab CI/Docker you will likely need to give privileged access to your GitLab CI Runner and configure/disable TLS. See Use docker-in-docker workflow with Docker executor variables: DOCKER_HOST: … Read more

How to run a gitlab-ci.yml job only on a tagged branch?

This behavior will be introduced in version 12. Open issue was recently update: Jason Lenny @jlenny changed title from {-Update .gitlab-ci.yml to support conjunction logic for build conditions-} to Conjunction logic for build conditions MVC · 2 days ago Jason Lenny @jlenny changed milestone to 12.0 · 2 days ago (fingers crossed) A solution is … Read more

Multiple Docker images in .gitlab-ci.yml

You can define the image to use per job. For instance: before_script: – apt-get install –yes cmake libmatio-dev libblas-dev libsqlite3-dev libcurl4-openssl-dev – apt-get install –yes libarchive-dev liblzma-dev build:precise: image: precise:base script: – mkdir build/ – cd build – cmake -D CMAKE_BUILD_TYPE=Debug ../ – make build:trusty: image: trusty:base script: – mkdir build/ – cd build – … Read more

How to use if-else condition on gitlabci

Hereunder three syntax options for that kind of statement. From gitlab-ci documentation : Using shell variable deploy-dev: image: testimage environment: dev tags: – kubectl script: – if [ “$flag” == “true” ]; then MODULE=”demo1″; else MODULE=”demo2″; fi – kubectl apply -f ${MODULE} –record=true Using shell variable with yaml multiline block deploy-dev: image: testimage environment: dev … Read more

Multiline YAML string for GitLab CI (.gitlab-ci.yml)

I came here preemptively expecting this would be an issue but the following “multi-line” command for readability is working for me: Gitlab Runner: Shell Runner version 1.11.0 / Gitlab version: 8.17.2 myjob: stage: deploy script: # Single line command – az component update –add sql # Multi-line command – az sql server create -n ${variable} … Read more

Terraform: Error acquiring the state lock: ConditionalCheckFailedException

Cause of Error This error usually appears when one process fails running terraform plan or terraform apply. For example if your network connection interrupts or the process is terminated before finishing. Then Terraform “thinks” that this process is still working on the infrastructure and blocks other processes from working with the same infrastructure and state … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)