teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

サンプル小修正

2018/10/23 05:40

投稿

FKD
FKD

スコア268

answer CHANGED
@@ -6,14 +6,14 @@
6
6
  [https://qiita.com/kumagi/items/70f3c8498a0777078cca](https://qiita.com/kumagi/items/70f3c8498a0777078cca)
7
7
 
8
8
  ```jenkinsfile
9
- //pipeline{}の外に記述
9
+ def projects = ["Entity.20", "Extensions.35", "Forms.40"]
10
10
  def configs = [:]
11
- for (conf in ["Entity.20", "Extensions.35", "Forms.40"])
11
+ for (proj in projects)
12
12
  {
13
- def c = conf // これで解決
13
+ def copyproj = proj // ここ重要
14
- configs[c] = {
14
+ configs[copyproj] = {
15
15
  //実行内容記述
16
- echo c
16
+ echo copyproj
17
17
  }
18
18
  }
19
19
 

1

サンプル追加しました

2018/10/23 05:40

投稿

FKD
FKD

スコア268

answer CHANGED
@@ -3,4 +3,30 @@
3
3
  ですので、プロジェクト名の一覧を定義し、そこからmapを作成すると良いのではないでしょうか。
4
4
 
5
5
  参考URL
6
- [https://qiita.com/kumagi/items/70f3c8498a0777078cca](https://qiita.com/kumagi/items/70f3c8498a0777078cca)
6
+ [https://qiita.com/kumagi/items/70f3c8498a0777078cca](https://qiita.com/kumagi/items/70f3c8498a0777078cca)
7
+
8
+ ```jenkinsfile
9
+ //pipeline{}の外に記述
10
+ def configs = [:]
11
+ for (conf in ["Entity.20", "Extensions.35", "Forms.40"])
12
+ {
13
+ def c = conf // これで解決
14
+ configs[c] = {
15
+ //実行内容記述
16
+ echo c
17
+ }
18
+ }
19
+
20
+ pipeline {
21
+ agent any
22
+ stages {
23
+ stage('Test') {
24
+ steps {
25
+ script {
26
+ parallel configs
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```