0

I'm using the below template to create a Directory and copy the git source code. Im using a self hosted Gitlab on a Linux machine.

stages:
  - build
build-Betaware:
  image: docker
  stage: build
  script:
- echo "the project directory is - $CI_PROJECT_DIR"
- echo "and where am I? - $PWD"
- mkdir /gitlab-test
- cp -rf /builds/root/cms/.git /gitlab-test
 environment:
name: Betaware
tags:
- build_client_app

The Pipeline is getting executed successfully.Pls refer to the attached image

but when I check the Linux VM directory it's Empty. Pls refer to the attached image.

Below is the

config.toml file

concurrent = 1
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]
  name = “test”
  url = "http://gitlab.test.org/"
  token = "ixBUsRe2UgerGqo2fHR3"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0

1 Answers1

0

You're using docker to build, so that's the path in the container.
If you want to see the path on your linux host, here's one way:

stages:
  - build
build-Betaware:
  stage: build
  script:
    - echo "the project directory is - $CI_PROJECT_DIR"
    - echo "and where am I? - $PWD"
    - mkdir /gitlab-test
    - cp -rf $PWD /gitlab-test
  environment:
    name: Betaware
  tags:
    - build_client_app

And config.toml file

concurrent = 1
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]
  name = “test”
  url = "http://gitlab.test.org/"
  token = "ixBUsRe2UgerGqo2fHR3"
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
quoc9x
  • 1,423
  • 2
  • 9
  • 26