X Tutup
Skip to content

Commit 99b2cec

Browse files
authored
Update Jenkinsfile
1 parent 634314e commit 99b2cec

File tree

1 file changed

+45
-23
lines changed

1 file changed

+45
-23
lines changed

Jenkinsfile

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
1-
node {
2-
stage "Create build output"
3-
git 'https://github.com/webweb04/python-scripts.git'
4-
// Make the output directory.
5-
sh "mkdir -p output"
6-
7-
sh "ls -r"
8-
9-
10-
11-
sh "pwd"
12-
13-
14-
// Write an useful file, which is needed to be archived.
15-
writeFile file: "output/usefulfile.txt", text: "This file is useful, need to archive it."
16-
17-
// Write an useless file, which is not needed to be archived.
18-
writeFile file: "output/uselessfile.md", text: "This file is useless, no need to archive it."
19-
20-
stage "Archive build output"
21-
22-
// Archive the build output artifacts.
23-
archiveArtifacts artifacts: 'output/*.txt', excludes: 'output/*.md'
1+
2+
pipeline {
3+
agent any
4+
stages {
5+
stage('Build') {
6+
steps {
7+
8+
echo "checkout from SCM"
9+
10+
git 'https://github.com/webweb04/python-scripts.git'
11+
// Make the output directory.
12+
13+
echo "debug"
14+
sh "mkdir -p output"
15+
16+
sh "ls -r"
17+
18+
19+
20+
sh "pwd"
21+
22+
23+
// Write an useful file, which is needed to be archived.
24+
writeFile file: "output/usefulfile.txt", text: "This file is useful, need to archive it."
25+
26+
// Write an useless file, which is not needed to be archived.
27+
writeFile file: "output/uselessfile.md", text: "This file is useless, no need to archive it."
28+
29+
echo "Archive build output"
30+
31+
// Archive the build output artifacts.
32+
archiveArtifacts artifacts: 'output/*.txt', excludes: 'output/*.md'
33+
}
34+
}
35+
stage('Test') {
36+
steps {
37+
//
38+
}
39+
}
40+
stage('Deploy') {
41+
steps {
42+
//
43+
}
44+
}
45+
}
2446
}

0 commit comments

Comments
 (0)
X Tutup