https://jenkins.io/download
Generic Java Package(.war) download
export JENKINS_HOME=/data/nexus/jenkins/webapps
nohup /jdk-11.0.20/bin/java -jar jenkins.war --httpPort=9090 --profix=/jenkins &
/jenkins로 호출시 뒷단 Jenkins 서비스로 포워딩
jenkins.war 살릴때 ContextPath 추가
java -jar jenkins.war --prefix=/jsnkins
cat /data/nexus/jenkins/webapps/secrets/initialAdminPassword
https://updates.jenkins-ci.org/download/plugins/skip-certificate-check
- 다운받아서ㅊ 에 복사후 재실행
- 이렇게 받은 파일을 확자자를 .jpi -> .hpi로 변경해서 내부에 반영
- $JENKINS_HOME/plugins에 복사후 재실행
Jenkins 관리 > Tools > JDK installations
Jenkins 관리 > Tools > Maven installations 또는 Jenkins 관리에서 Maven Plugin 추가
Git설치확인 : Linux의 경우 Git이 설치되어 있어야 함
Jenkins관리 > Security > Authorization : Project-based Matrix Authorization Strategy 선택
Plug-ins에 Role관리 Plugin 추가해야 함
:Matrix Authorization Strategy
:Role-based Authorization Strategy
Build item > 구성 > "Enable project-based security"선택
"Do not inherit permission grants from other ACLs" 선택
pipleline {
agent any
tools {
maven 'maven399'
}
stages {
stage('Git Pull') {
steps {
echo '======== Git_Pull ========='
git branch: 'main', credentialsId: 'gitadmin'
url: 'https://gitea.test.com/test/test.git'
}
}
stage('Build') {
steps {
echo '=========== Maven_Build =========='
sh '''
mvn clean package -DskipTests
ls -l
'''
}
}
stage('Docker Deploy') {
steps {
echo '=========== Docker_Deploy ========='
sh '''
docker build -t test-pjt:1.0 .
docker tag test-pjt:1.0 registry.test.com/test/test-pjt:1.0
docker push registry.test.com/test/test-pjt:1.0
'''
}
}
}
}
Kind : Username with password
: Scope , Username, Password, ID(pipeline에서 사용됨) 입력