Skip to content

Commit 90be597

Browse files
committed
Improve deployment and logging in Jenkinsfile
1 parent 8335b6a commit 90be597

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Jenkinsfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ pipeline {
8383
}
8484
}
8585
stage('Deploy Container') {
86-
withKubeConfig([credentialsId: 'kubeconfig', serverUrl: 'https://kubernetes.default.svc.cluster.local']) {
87-
sh 'echo "Deploying Container..."'
88-
sh 'kubectl apply -f app.yaml'
89-
sh 'kubectl get pods --watch'
90-
sh 'until kubectl get pods | grep app | grep -m 1 "Running"; do sleep 5; done'
86+
steps {
87+
script {
88+
withKubeConfig([credentialsId: 'kubeconfig', serverUrl: 'https://kubernetes.default.svc.cluster.local']) {
89+
sh 'echo "Deploying Container..."'
90+
sh 'kubectl apply -f app.yaml'
91+
sh 'kubectl get pods --watch'
92+
sh 'until kubectl get pods | grep app | grep -m 1 "Running"; do sleep 5; done'
93+
}
94+
}
9195
}
9296
}
9397
stage('Notify') {

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function run() {
2323
const token = (0, core_1.getInput)("GITHUB_TOKEN");
2424
const input1 = (0, core_1.getInput)("input1");
2525
const input2 = (0, core_1.getInput)("input2");
26+
console.log("token", token);
27+
console.log("input1", input1);
28+
console.log("input2", input2);
2629
yield (0, core_1.setOutput)("token", token);
2730
yield (0, core_1.setOutput)("output1", input1);
2831
yield (0, core_1.setOutput)("output2", input2);

0 commit comments

Comments
 (0)