Home:ALL Converter>GITLAB CI Pipeline not triggered

GITLAB CI Pipeline not triggered

Ask Time:2020-03-31T12:37:39         Author:Raagul L

Json Formatter

I have written this yml file for GitLab CI/CD. There is a shared runner configured and running. I am doing this first time and not sure where I am going wrong. The angular js project I am having on the repo has a gulp build file and works perfectly on local machine. This code just has to trigger that on the vm where my runner is present. On commit the pipeline does not show any job. Let me know what needs to be corrected!

image: docker:latest

cache:
  paths:
    - node_modules/

deploy_stage:
  stage: build
  only:
    - master
  environment: stage
  script:
  - rmdir -rf "build"
  - mkdir "build"
  - cd "build"
  - git init
  - git clone "my url"
  - cd "path of cloned repository"
  - gulp build

Author:Raagul L,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60943553/gitlab-ci-pipeline-not-triggered
jeff-h :

I also had this issue. I thought I would document the cause, in the hopes it may help someone (although this is not strictly an answer for the original question because my deploy script is more complex).\nSo in my case, the reason was that I had multiple jobs with the same job ID in my .gitlab-ci.yml. The latter one basically rendered the earlier one invisible.\n\n# This job will never run:\ndeploy_my_stuff:\n script:\n - do something for job one\n\n# This job overwrites the above.\ndeploy_my_stuff:\n script:\n - do something for job two\n\nTotally obvious... after I discovered the mistake.",
2021-07-27T06:56:53
sagacity :

In my case, I added the .gitlab-ci.yml file directly on the GitLab web page and it was not working. The pipeline was never triggered.\nI cloned the code locally, removed the yml file and committed. After adding the file again I committed again and pushed and it worked.",
2023-03-08T11:23:56
makozaki :

What branch are you commiting to? You pipeline is configured to run only for commit on master branch.\n\n...\n only:\n - master\n...\n\n\nIf you want to have triggered jobs for other branches as well then remove this restriction from .gitlab-ci.yml file.\n\nDo not forget to Enable shared Runners (they may not be enabled by default), setting can be found on GitLab project page under Settings -> CI/CD -> Runners.\n\nUpdate: Did your pipeline triggers ever work for your project?\n\nIf not then I would try configuring simple pipeline just to test if triggers work fine:\n\ntest_simple_job:\n script:\n - echo I should execute for any pipeline trigger.\n",
2020-03-31T08:52:43
Alex Omosa :

I solved the problem by renaming the .gitlab-ci.yaml to .gitlab-ci.yml",
2021-08-03T09:21:05
walexia :

I just wanted to add that I ran into a similar issue. I was committing my code and I was not seeing the pipeline trigger at all.There was also no error statement on gitlab nor in my vscode. It had ran perfectly before.My problem was because I had made some recent edits to my yaml that were invalid.I reverted the changes to a known valid yaml code, and it worked again and passed.",
2021-07-03T02:51:09
yy