Gitlab runner does not always update environment
I have a gitlab job that does not seem to update the repository before being run. Sometimes it leaves some files in their old states and run the script... Any idea ?
For instance when I have a
packagePython: stage: package script: - .\scripts\PackagePython.ps1 tags: - myServer cache: paths: - .\python\cache\ only: changes: - python/**/*
do you know?
how many words do you know
See also questions close to this topic
Allow an application to list the gitlab projects of the authenticated user (via OAuth2)
I'm working on a project where I want to ask the users to authenticate via Gitlab(OAuth2). Then list the projects of that authenticated user. any propositions for that flow?
Why does GitLab Ci not find my cached folder?
I have a list of CI jobs running in my GitLab and the Caching does not work as expected:
This is how my docu-generation job ends:
[09:19:33] Documentation generated in ./documentation/ in 4.397 seconds using gitbook theme Creating cache angular... 00:02 WARNING: frontend/node_modules: no matching files frontend/documentation: found 136 matching files No URL provided, cache will be not uploaded to shared cache server. Cache will be stored only locally. Created cache Job succeeded
I then start a deployment Job (to GitLab Pages) but it fails because it doesn't find the documentation-folder:
$ cp -r frontend/documentation .public/frontend cp: cannot stat 'frontend/documentation': No such file or directory
this is the cache config of the generation:
generate_docu_frontend: image: node:12.19.0 stage: build cache: key: angular paths: - frontend/node_modules - frontend/documentation needs: ["download_angular"]
and this is for deployment:
deploy_documentation: stage: deploy cache: - key: angular paths: - frontend/node_modules - frontend/documentation policy: pull - key: laravel paths: - backend/vendor - backend/public/docs policy: pull
does anyone know why my documentation folder is missing?
Detect added packages in CI/CD pipeline using docker and GitLab
i am currently working on deploying an R application via a CI/CD pipeline. Right now i have an DockerfileBase, which builds to an image containing all the R libraries needed for the project. Now i want to somehow integrate the functionality that somehow it is detected when a library is added to the DockerfileBase and only then this image is rebuild. Does anybody have an idea on how to do a thing like that?
Thank you for your help!
currrent time showing always utc while utc+2 zone is setting
i want to add the timestamp to container logs. i did in my build stage but im gotting always the timestamp UTC and not UTC+2(paris local time):
stage: build script: - docker info - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - echo "ETL_IMAGE = \""$CI_IMAGE_COMMIT_TAG"\"" > version.py - docker build --pull --tag $CI_IMAGE_COMMIT_TAG . - export current_date=$(TZ="Europe/Paris" date +"%m-%d-%Y_%H:%M:%S") - echo $current_date - docker push $CI_IMAGE_COMMIT_TAG
Please who can help me?? print_current°date
Run oracle image in gitlab pipeline
I want to run the oracle DB along with project, so I have an oracle image that i'm using as service image and my project's image as the base image. Both these image reside in AWS ECR.
test: stage: test image: ***.dkr.ecr.us-east-2.amazonaws.com/project:latest services: - name: ***.dkr.ecr.us-east-2.amazonaws.com/oracle-db:latest alias: oracleDB tags: - [runner]
I get the below message in logs -
*** WARNING: Service runner-3d2f0-***.dkr.ecr.us-east-2.amazonaws.com__oracle-db-0 probably didn't start properly. Health check error: service "runner-3d2f0-***.dkr.ecr.us-east-2.amazonaws.com__oracle-db-0-wait-for-service" health check: exit code 1 Health check container logs: 2021-09-23T03:44:16.658615888Z FATAL: No HOST or PORT found
However if I do
docker run ***.dkr.ecr.us-east-2.amazonaws.com/oracle-db:latestI see that the oracle container has successfully launched.
Is there any problem with the runner? Or is there any other way to run both the applications and connect them somehow? Kindly help, new to world of gitlab. Thanks!
Official aws-cli image does not accept scripts commands from gitlab
I am using amazon/aws-cli:2.2.40 in a gitlab pipeline to publish a static site on a S3.
deploy_front: image: amazon/aws-cli:2.2.40 variables: AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION stage: publish script: - s3 sync ./front/build s3://some-bucket-name
ends up in
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument command: Invalid choice, valid choices are: accessanalyzer | acm acm-pca | alexaforbusiness amp | amplify amplifybackend | apigateway ....... ..........
I managed to replicate this error by running
docker run -it amazon/aws-cli:2.2.40 aws s3locally. However
docker run -it amazon/aws-cli:2.2.40 s3works so I do not understand why I get the same error no matter what I use in
script. Is it a some escaping issue?
Gitlab-Runner Certificate invalid
I am trying to register my gitlab-runner, I installed using this guide.
When trying to execute the gitlab-runner register command, I am running into this error message:
gitlab-runner register Runtime platform arch=amd64 os=linux pid=87218 revision=b37d3da9 version=14.3.0 Checking runtime mode GOOS=linux uid=0 Running in system-mode. Enter the GitLab instance URL (for example, https://gitlab.com/): https://server1.domain.com/ Enter the registration token: token Enter a description for the runner: [runner.domain.com]: Enter tags for the runner (comma-separated): Dialing: tcp proxy.domain.com:8080 ... ERROR: Registering runner... failed runner= status=couldn't execute POST against https://server.domain.com/api/v4/runners: Post https://server1.domain.com/api/runners: x509: certificate is valid for server1, not server1.domain.com PANIC: Failed to register the runner. You may be having network problems.
Any idea why the certificate is valid for the hostname, but not for the fqdn? I am using a proxy.
Thank you for your help
Can someone explain how to write self hosted runner?
Currenlty i am learning CI/CD from Gitlab, I heard that gitlab runner is limited in time for free edition but we can bypass by using a self hosted runner.
The thing is i found lots of tuto, website about how to add a self hosted runner into gitlab or github but i found nowhere how to create a self hosted runner, writing the comand build, test, prod in details etc.
Can someone give me right indications, tuto or anything that could bring me a better understanding , please ?
Thank a lot.