Skip to content

Commit 953c528

Browse files
committed
update for jenkins ci
1 parent a71f7f1 commit 953c528

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Jenkinsfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def PROJECT_NAME = "simple-api"
22
def gitUrl = "https://github.com/oscka/${PROJECT_NAME}.git"
33
def imgRegistry = "https://registry.hub.docker.com"
4-
def gitOpsUrl = "github.com/oscka/simple-gitops.git"
4+
def gitOpsUrl = "https://github.com/oscka/simple-gitops.git"
55
def opsBranch = "main"
66
/////////////////////////////
77
pipeline {
@@ -23,7 +23,7 @@ pipeline {
2323
sh "skaffold build -p dev -t ${TAG}"
2424
}
2525
// mac local 일때만 사용 linux 환경에서는 docker.withRegistry 사용
26-
sh "skaffold build -p dev -t ${TAG}"
26+
// sh "skaffold build -p dev -t ${TAG}"
2727
}
2828
}
2929
}
@@ -35,20 +35,22 @@ pipeline {
3535
stage('GitOps update') {
3636
steps{
3737
print "======kustomization.yaml tag update====="
38-
git url: "https://${gitOpsUrl}", branch: "main" , credentialsId: "git-credential"
39-
script{
40-
sh """
41-
cd ./simple-api/blue-green
42-
kustomize edit set image skaqud/simple-api:${TAG}
38+
withCredentials([
39+
gitUsernamePassword(credentialsId: 'git-credential', gitToolName: 'Default')
40+
]) {
41+
sh """
42+
git clone ${gitOpsUrl}
43+
cd ./simple-gitops/simple-api/rolling-update-no-istio
44+
kustomize edit set image oscka/simple-api:${TAG}
4345
# 로컬외에는 주석 제거한다
4446
git config --global user.email "admin@demo.com"
4547
git config --global user.name "admin"
4648
git add .
4749
git commit -am 'update image tag ${TAG}'
48-
git remote set-url --push origin https://${gitOpsUrl}
50+
git remote set-url --push origin ${gitOpsUrl}
4951
git push origin ${opsBranch}
50-
"""
51-
}
52+
"""
53+
}
5254
print "git push finished !!!"
5355
}
5456
}

skaffold.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ profiles:
66
local:
77
push: true # false는 로컬 테스트
88
artifacts:
9-
- image: skaqud/simple-api # on dev server
9+
- image: oscka/simple-api # on dev server
1010
# - image: simple-api # local
1111
jib:
1212
args:
1313
- -DskipTests
1414
- "-Djib.container.environment=SPRING_PROFILES_ACTIVE=dev"
15-
fromImage: eclipse-temurin:17.0.4.1_1-jre-alpine
15+
fromImage: eclipse-temurin:17.0.2_8-jre
1616
deploy:
1717
kubectl:
1818
manifests:

0 commit comments

Comments
 (0)