Closed devrokket closed 5 months ago
Jenkins-credential로 yml 파일을 등록해서 같이 빌드할 수 있는 방법으로 진행.
Jenkins jobs가 고도화 됨에 따라, 기존 freestyle 형식으로 작성된 item이 한계가 있음. pipeline 문법으로 migration 필요. Converter plugin이 github hook trigger, Discord Notifiler, send over SSH는 지원하지 않아서, convert 된 파이프라인에 추가 작업 필요.
docker exec으로 내부 실행해서 spring boot application아 저장되어 있는 경로 탐색
docker 내부 jenkins item 위치
/var/jenkins_home/workspace/tastezip-cicd
pipeline 내부 현재 경로
쉘 스크립트에서는 - 기호가 변수 이름에 사용되지 않는다. 변수 이름 _으로 하니까 빌드 성공함.
stage('secret.yml download') {
steps {
withCredentials([file(credentialsId: 'application-test', variable: 'application_test')]) {
script {
sh 'cp ${application_test} ./src/main/resources/application-test.yml'
}
}
}
}
이전 성공. 기존의 tastezip-cicd-pipeline item 삭제
++ application.yml 이름을 credential에서 application-test.yml로 대체하여 사용
Describe
After hiding yml files with .gitignore, build failed at Jenkins pipeline.
Problem
Build fail message: couldn't read datasource properties in yml files
Idea
With Github Actions, you create and build only when you build a setup file in Github that should not be exposed through the Secret Actions settings.
string parameter: easy, but application.yml files (secret key is filled variables) should be uploaded on github.
Dockerhub private repository.
other ways...
In this time, We will use Dockerhub private repository. cause I want to be familiar with Docker.