Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
junoyoon committed Jun 27, 2023
1 parent fd712e8 commit fb46774
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* 이번 실습은 jenkins 를 public 으로 노출하기 위한 ngrok 필요
* 이번 실습은 jenkins 를 public 으로 노출하기 위한 ngrok 필요 (chapter4 > 2번 실습 참고)

docker run -d --rm --name ngrok --hostname ngrok \
-e NGROK_AUTHTOKEN=[ngrok에서 발급받은 auth key] \
Expand Down Expand Up @@ -30,10 +30,10 @@

* 생성된 instance 에 java 설치
- 생성된 인스턴스의 정보 기록
- 퍼블릭 IP4 DNS
- 서브넷 ID :
- AMI ID :
- 보안 > 보안 그룹 이름 :
- 퍼블릭 IP4 DNS : ec2-13-125-220-158.ap-northeast-2.compute.amazonaws.com
- 서브넷 ID : subnet-59bf2a32
- AMI ID : ami-0462a914135d20297
- 보안 > 보안 그룹 이름 : launch-wizard-7
- https://ap-northeast-2.console.aws.amazon.com/ec2/home?region=ap-northeast-2#Instances:
- 생성된 인스턴스를 클릭하여 연결 클릭 > 다음화면에서 바로 연결
- java 설치
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- 설치 방법
- kubectl 설치
- https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html 를 참고하여 OS 별 설치
- https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html 를 참고하여 OS 별 설치
- kind 설치
- https://kind.sigs.k8s.io/docs/user/quick-start/#installation 참고
- mac
Expand All @@ -32,7 +32,7 @@ type: kubernetes.io/service-account-token
EOF

# 토큰 확인 및 복사
kubectl describe secret jenkins-secret --namespace kind
kubectl describe secret jenkins-secret

# jenkins account 에 admin 권한 부여
kubectl create rolebinding jenkins-admin-binding --clusterrole=admin --serviceaccount=default:jenkins
Expand Down Expand Up @@ -129,7 +129,7 @@ pipeline {

* pod 간 파일 공유 처리
- 다음 커멘트 제거
// stash includes: 'a.txt', name: 'A_TXT'
// stash includes: 'app.jar', name: 'BUILD_OUTPUT'
// unstash 'BUILD_OUTPUT'
- 빌드후 파일 존재함을 확인
- 다음 커멘트 제거
Expand Down Expand Up @@ -169,11 +169,12 @@ pipeline {
}
}
}

* kaniko 를 kubernetes pod template 으로 사용
- pod 템플릿 설정
- http://localhost:8080/manage/configureClouds/ > Kubernetes > Add Pod Template
- Name : kaniko
- Namespace : jenkins
- Namespace :
- Label : kaniko
- Containers > Add Container
- Name: kaniko
Expand Down
34 changes: 17 additions & 17 deletions 실습스크립트/chapter-7/6-빌드cache실습.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pipeline {
branches: [[name: 'origin/main']],
userRemoteConfigs: [[
credentialsId: 'github-ssh',
url : '[email protected]:[각자의 github 계정/fastcampus-jenkins.git']
url : '[email protected]:[각자의 github 계정]/fastcampus-jenkins.git']
],
extensions: [[$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [[path: 'projects/spring-app']]]]
)
Expand All @@ -55,13 +55,13 @@ pipeline {
writeFile(
file:"settings.gradle.kts",
text: """
buildCache {
remote<HttpBuildCache> {
url = uri("http://build-cache-node:5071/cache/")
isPush = true
setAllowInsecureProtocol(true)
}
}
buildCache {
remote<HttpBuildCache> {
url = uri("http://build-cache-node:5071/cache/")
isPush = true
setAllowInsecureProtocol(true)
}
}
"""
) */

Expand Down Expand Up @@ -122,11 +122,11 @@ pipeline {
* gradle remote build cache 사용
- 빌드 캐시 서버 실행

docker run --detach --rm \
docker run -d --rm \
--hostname build-cache-node \
--name build-cache-node \
--network practice \
--volume ~/practice/build-cache-node:/data \
--volume ${HOME}/practice/build-cache-node:/data \
--publish 5071:5071 \
gradle/build-cache-node:15.0 \
start
Expand All @@ -145,13 +145,13 @@ pipeline {
writeFile(
file:"settings.gradle.kts",
text: """
buildCache {
remote<HttpBuildCache> {
url = uri("http://build-cache-node:5071/cache/")
isPush = true
setAllowInsecureProtocol(true)
}
}
buildCache {
remote<HttpBuildCache> {
url = uri("http://build-cache-node:5071/cache/")
isPush = true
setAllowInsecureProtocol(true)
}
}
"""
)

Expand Down

0 comments on commit fb46774

Please sign in to comment.