1. React - Jenkins
- Jenkins 서버 , 배포 서버 구분
https://roomq.tistory.com/m/29
2. Jenkins Pipeline (DSL)
pipeline {
agent any
tools {
maven 'maven3.8.2'
}
stages {
stage('github clone') {
steps {
git 'https://github.com/joneconsulting/one-apigate.git'
}
}
stage('build') {
steps {
sh '''
echo build start
mvn clean compile package -DskipTests=true
'''
// sh 'mvn clean compile package -DskipTests=true'
}
}
stage('deploy') {
steps {
deploy adapters: [tomcat9(credentialsId: 'deployer_user', path: '', url: 'http://192.168.0.8:8080/')], contextPath: null, war: '**/*.war'
}
}
stage('ssh publisher') {
steps {
sshPublisher(publishers: [sshPublisherDesc(configName: 'aws-docker-server', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'docker build -t edowon0623/devops_exam1 -f Dockerfile .', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '.', remoteDirectorySDF: false, removePrefix: 'target', sourceFiles: 'target/devops_demo-0.1.war')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
}
DSL은 외우는 게 아니고 Jenkins에서 변환하는 프로그램을 이용하면 된다.
3. Jenkins - SonarQube 연동
소스코드 Convention
~
<참고>
- https://github.com/joneconsulting/cicd-web-project
- https://github.com/joneconsulting/jenkins_pipeline_script
- https://github.com/joneconsulting/jenkins_cicd_script
'DevOps > Docker, Jenkins, Ansible, Terraform' 카테고리의 다른 글
Docker, UFW, IPTABLES 방화벽 (0) | 2023.05.06 |
---|---|
Apache Tomcat (0) | 2023.02.10 |
Terraform 테라폼, 여러 클라우드의 이기종 환경에서 프로비저닝 위함. (0) | 2023.02.05 |
Ansible-Playbook (0) | 2023.02.04 |
CloudFormation (클라우드 포메이션)으로 인프라 관리하기 (0) | 2023.02.02 |