0

I am using gitlab as repository and want to push my code on ec2 whenever any commit is done on gitlab.
The gitlab CD/CI documentation states that I have to add a file .gitlab-ci.yml at the root directory of my repo.
This is actually a problem for me because, I want project repo to have only code and not any configuration related info like build and deploy etc.
Also when anybody clones the repo, they would have access to location where my code is pushed/deployed on ec2.
Is there any work around for this problem ?

1 Answers1

1

You'll need to use a gitlab-ci.yml filke to deploy your application. The file provides instructions and a pipeline "infrastructure" which, if properly configured, will build, test and automatically deploy your code.

If you are worried about leaking credentials, you should use the built-in instance variables to mask your important bits, like a "$SERVERNAME" or "$DB_PASSWORD" for instance.

Lastly, you can use the power of gitignore, in order to not publish all of your credentials or sensitive bits to your projects' servers or instances.

ababoolal
  • 51
  • 4