0

im new comer in gitlab ci cd this is my .gitlab-ci.yml in my project and i want to test it how it works . i have registered gitlab runner that is ok but my problem is when i add a file to my project it will run pipelines and they are successfully passed but nothing changes in my project in server? what is the problem? it is not dockerized project

image: php:7.2

stages:
  - preparation
  - building

cache:
  key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"

composer:
  stage: preparation
  script:
    - mkdir test5
  when: manual
pull:
  stage: building
  script:
    - mkdir test6
sina
  • 226
  • 3
  • 11
  • Can you make the question clear? What do you want to use the pipelines for? Is it for running unit tests and coverage (CI)? Or is it used for deploying to your server(CD)? – Jeffy Mathew Jun 01 '21 at 06:56
  • @JeffyMathew i know i want to pull my changes in server . when any changes happens in gitlab project . in this sample case i want to create folder for just test – sina Jun 01 '21 at 07:05

1 Answers1

0

CI/CD Pipelines like GitLab CI/CD are nothing different than virtual environments, usually docker, that can operate on the basis of your code as you do on your own host system.

Your mkdir operations definitely have an effect but the changes remain inside the virtual environment because they are not reflected to your remote repository. For this to work, you have to setup your repository from inside the CI/CD runner and commit to your repository, (again) just like you do from your own host system. To execute custom commands, GitLab CI/CD has the script parameter. I am sure, reading this will get you up and running.

alexanderdavide
  • 1,487
  • 3
  • 14
  • 22
  • i copied id_rsa.pub and created a variable named SSH in my project in CI CD section . would you guiding me about this? its unclear – sina Jun 01 '21 at 07:57
  • Any reason why you don't follow the most popular answer on the given link outlining instructions for a GitLab access token? – alexanderdavide Jun 01 '21 at 09:16