Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 972
    • Issues 972
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 88
    • Merge requests 88
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar

Do not update/delete: Banner broadcast message test data

Do not update/delete: Notification broadcast message test data

  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #1918
Closed
Open
Issue created Nov 26, 2016 by username-removed-750459@jsonc

CI_PROJECT_DIR is not respected when set in the gitlab-ci.yml

When setting the CI_PROJECT_DIR variable within a job, I expected to have my code checked out in that directory.

I'm basing my assumptions on this document: https://docs.gitlab.com/ce/ci/variables/README.html

My gitlab runner is configured as executor = "docker"

My .gitlab-ci.yml file contains the following:

stages:
  - build
  - package
  - test
  - deploy

build:linux:
  image: golang:1.7.1
  stage: build
  variables:
    CI_PROJECT_DIR: /go/src/$CI_PROJECT_PATH/
  script:
    - git submodule init
    - git submodule update --recursive
    - go build -v -x -o build/$CI_PROJECT_NAME

Upon inspecting the environment of the newly created container, I can see that the environment variable persists, but It simply will not affect where the code is checked out / cloned.

This presents a problem for me because the golang docker image sets the $GOPATH to /go/ and I do not wish to junk up my CI file with moves, copies, symlinks, etc.

It would be nice if I could, per job, set the CI_PROJECT_DIR to determine where the code actually gets checked out.

Assignee
Assign to
Time tracking