To fetch the Jenkins Secret from a Jenkins Server to EC2 instance under the specific location

0

Hi AWS,

I have deployed a backend application written in NodeJS on EC2 instance. Post that I have created the CI/CD pipeline for the same using Jenkins pipeline. I don't want to store the .env file on the source control (Bitbucket in my case), rather want to create it on the fly and use them as Jenkins secrets.

However when the pipeline completes and resulted into the SUCCESS state the .env file is not getting stored on the EC2 instance where the repository is cloned. Can you please tell me what's the reason for that.

profile picture
質問済み 1年前209ビュー
1回答
1
承認された回答

If I interpret correctly, the .env is not part of the source control and so it is not intended to be present on EC2 as part of git clone (unless you mean it to be present there through git clone and have not specified the file under .gitignore). With a gitignore file, all files that start with a period ( . ) will be ignored.

If you are creating a .env file on the fly in a jenkins workspace, you will need to copy the file across to EC2 explicitly by using something like "execute command over SSH" and then using "scp" or through "Publish Over SSH plugin" in Jenkins.

AWS
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ