Browse Source

Add the CI pipeline file to the repo

OvermindDL1 2 years ago
parent
commit
6ddce29f9e
Signed by: OvermindDL1 <overminddl1@gmail.com> GPG Key ID: 3AB7DC53B6993840
1 changed files with 285 additions and 0 deletions
  1. 285
    0
      .meta/ci/pipeline.yml

+ 285
- 0
.meta/ci/pipeline.yml View File

@@ -0,0 +1,285 @@
1
+groups: []
2
+
3
+
4
+resources:
5
+
6
+- name: git-cache-only
7
+  type: git
8
+  source:
9
+    branch: master
10
+    uri: https://git.gregtech.overminddl1.com/GregTech-6/GT6.git
11
+    paths:
12
+    - "*.gradle"
13
+    - ".meta/*"
14
+    - "*_at.cfg"
15
+
16
+- name: git-compile-only
17
+  type: git
18
+  source:
19
+    branch: master
20
+    uri: https://git.gregtech.overminddl1.com/GregTech-6/GT6.git
21
+    paths:
22
+    - "*.gradle"
23
+    - "CHANGELOG.md"
24
+    - ".meta/*"
25
+    - "src/*"
26
+    - ".defaultconfigs"
27
+
28
+- name: git-versioned
29
+  type: git
30
+  source:
31
+    branch: master
32
+    uri: https://git.gregtech.overminddl1.com/GregTech-6/GT6.git
33
+    tag_filter: 'v[0-9]*'
34
+
35
+- name: .gradle
36
+  type: s3
37
+  source:
38
+    endpoint: ((cache.endpoint))
39
+    disable_ssl: true
40
+    #region_name: us-east-1
41
+    region_name: ((cache.region))
42
+    bucket: ((cache.bucket))
43
+    regexp: (.*).gradle.tgz
44
+    initial_path: v0.0.0.gradle.tgz
45
+    initial_content_binary: "H4sIAMJctlsAA+3BAQ0AAADCoPdPbQ43oAAAAAAAAAAAAIA3A5reHScAKAAA" # Empty tgz file
46
+    #versioned_file: .gradle.tgz
47
+    access_key_id: ((cache.access_key))
48
+    secret_access_key: ((cache.secret_key))
49
+
50
+- name: deploy-snapshot
51
+  type: gradle-uploadArchives
52
+  source:
53
+    url: ((maven.read_url))
54
+    put_url: ((maven.url))
55
+    group: com.gregoriust.gregtech
56
+    name: gregtech_1.7.10
57
+    version: SNAPSHOT
58
+    cmd: "git-compile-only/.meta/ci/deploy.sh"
59
+    env:
60
+      ARTIFACT_VERSION: SNAPSHOT
61
+      MAVEN_PASSWORD: ((maven.password))
62
+      MAVEN_URL: ((maven.url))
63
+      MAVEN_USERNAME: ((maven.username))
64
+
65
+- name: deploy-versioned
66
+  type: gradle-uploadArchives
67
+  source:
68
+    url: ((maven.read_url))
69
+    put_url: ((maven.url))
70
+    group: com.gregoriust.gregtech
71
+    name: gregtech_1.7.10
72
+    cmd: "git-versioned/.meta/ci/deploy.sh"
73
+    env:
74
+      VERSION_FALLBACK: SNAPSHOT
75
+      MAVEN_PASSWORD: ((maven.password))
76
+      MAVEN_URL: ((maven.url))
77
+      MAVEN_USERNAME: ((maven.username))
78
+
79
+- name: notify-build-status
80
+  type: http-api
81
+  source:
82
+    TOKEN: ((webhook.token))
83
+    VERSION: UNKNOWN
84
+    headers:
85
+      Authorization: Bearer {TOKEN}
86
+    json:
87
+      ATC_EXTERNAL_URL: '{ATC_EXTERNAL_URL}'
88
+      BUILD_ID: '{BUILD_ID}'
89
+      BUILD_JOB_NAME: '{BUILD_JOB_NAME}'
90
+      BUILD_NAME: '{BUILD_NAME}'
91
+      BUILD_PIPELINE_NAME: '{BUILD_PIPELINE_NAME}'
92
+      BUILD_STATUS: '{BUILD_STATUS}'
93
+      BUILD_TEAM_NAME: '{BUILD_TEAM_NAME}'
94
+      BUILD_TYPE: '{BUILD_TYPE}'
95
+      BUILD_URL: '{ATC_EXTERNAL_URL}/teams/{BUILD_TEAM_NAME}/pipelines/{BUILD_PIPELINE_NAME}/jobs/{BUILD_JOB_NAME}/builds/{BUILD_NAME}'
96
+      BUILD_VERSION: '{VERSION}'
97
+      TOKEN: '{TOKEN}'
98
+    method: POST
99
+    uri: ((webhook.url))
100
+    no_get: true
101
+
102
+- name: regen-static-maven
103
+  type: http-api
104
+  source:
105
+    headers:
106
+      Authorization: Basic ((maven.token))
107
+    method: PUT
108
+    uri: ((maven.url))/REGEN
109
+    no_get: true
110
+
111
+- name: post-forum-api
112
+  type: http-api
113
+  source:
114
+    method: POST
115
+    ENDPOINT: ((forum.endpoint))
116
+    AUTH: ((forum.auth))
117
+    uri: "{ENDPOINT}/{API}?{AUTH}"
118
+    no_get: true
119
+
120
+- name: gt6-screenshot
121
+  type: http-api
122
+  source:
123
+    uri: https://gregtech.overminddl1.com/gallery/LATEST.image.url
124
+
125
+
126
+resource_types:
127
+
128
+- name: http-api
129
+  type: docker-image
130
+  source:
131
+    repository: overminddl1/concourse-http-api-resource
132
+    tag: 1.0.16
133
+    #repository: aequitas/http-api-resource
134
+    #tag: latest
135
+
136
+- name: gradle-uploadArchives
137
+  type: docker-image
138
+  source:
139
+    repository: overminddl1/concourse-gradle-uploadarchives
140
+    tag: 1.0.20
141
+
142
+jobs:
143
+- name: update-gradle-cache
144
+  public: true
145
+  serial_groups: [deploy-snapshot, deploy-versioned]
146
+  plan:
147
+  - get: git-cache-only
148
+    trigger: true
149
+    version: latest
150
+  - task: cache
151
+    config:
152
+      platform: linux
153
+      image_resource:
154
+        type: docker-image
155
+        source:
156
+          repository: overminddl1/gradle
157
+          tag: 1.0.1
158
+      run:
159
+        path: sh
160
+        args:
161
+          - "-c"
162
+          - "git-cache-only/.meta/ci/prebuild.sh && cd .gradle && tar -cvzf ../.gradle-packed/$(cd ../git-cache-only; git describe).gradle.tgz *"
163
+      inputs:
164
+      - name: git-cache-only
165
+      outputs:
166
+      - name: .gradle-packed
167
+  - put: .gradle
168
+    params:
169
+      file: .gradle-packed/*.gradle.tgz
170
+
171
+- name: compile-snapshot
172
+  public: true
173
+  serial_groups: [gt6-maven, deploy-snapshot]
174
+  plan:
175
+  - get: git-compile-only
176
+    trigger: true
177
+    version: latest
178
+  - get: .gradle
179
+    params:
180
+      unpack: true
181
+  - put: deploy-snapshot
182
+    #params:
183
+    #  version-cmd: "echo -n 'SNAPSHOT-' && cd git-compile-only && git describe"
184
+
185
+- name: compile-versioned
186
+  public: true
187
+  serial_groups: [gt6-maven, deploy-versioned]
188
+  plan:
189
+  - get: git-versioned
190
+    trigger: true
191
+    version: every
192
+  - get: .gradle
193
+    params:
194
+      unpack: true
195
+  - put: deploy-versioned
196
+    #params:
197
+    #  version-cmd: "cd git-versioned && git describe"
198
+
199
+- name: broadcast-update-snapshot
200
+  public: true
201
+  plan:
202
+  - get: deploy-snapshot
203
+    trigger: true
204
+    passed: [compile-snapshot]
205
+  - put: notify-build-status
206
+    params:
207
+      VERSION:
208
+        load_filedata: deploy-snapshot/version
209
+        trim: true
210
+      BUILD_STATUS: success
211
+      BUILD_TYPE: SNAPSHOT
212
+
213
+- name: broadcast-update-versioned
214
+  public: true
215
+  plan:
216
+  - get: deploy-versioned
217
+    trigger: true
218
+    passed: [compile-versioned]
219
+  - put: notify-build-status
220
+    params:
221
+      VERSION:
222
+        load_filedata: deploy-versioned/version
223
+        trim: true
224
+      BUILD_STATUS: success
225
+      BUILD_TYPE: RELEASE
226
+
227
+- name: regen-static-site
228
+  public: true
229
+  plan:
230
+  - get: deploy-snapshot
231
+    trigger: true
232
+    passed: [compile-snapshot]
233
+  - get: deploy-versioned
234
+    trigger: true
235
+    passed: [compile-versioned]
236
+  - put: regen-static-maven
237
+
238
+- name: deploy-forum-post
239
+  public: true
240
+  plan:
241
+  - get: deploy-versioned
242
+    trigger: true
243
+    passed: [compile-versioned]
244
+  - get: git-versioned
245
+    passed: [compile-versioned]
246
+  - task: generate-post
247
+    config:
248
+      platform: linux
249
+      image_resource:
250
+        type: docker-image
251
+        source:
252
+          repository: overminddl1/gradle
253
+          tag: 1.0.1
254
+      run:
255
+        path: sh
256
+        args:
257
+          - "-c"
258
+          - "git-versioned/.meta/ci/forum_post.sh | tee post/data.txt"
259
+      inputs:
260
+      - name: git-versioned
261
+      outputs:
262
+      - name: post
263
+  - put: post-forum-api
264
+    params:
265
+      API: posts.json
266
+      DATA:
267
+        load_filedata: post/data.txt
268
+        trim: true
269
+      json:
270
+        raw: "{DATA}"
271
+        topic_id: 34
272
+
273
+- name: broadcast-gt6-screenshot-test
274
+  public: true
275
+  plan:
276
+  - get: gt6-screenshot
277
+    trigger: true
278
+  - put: notify-build-status
279
+    params:
280
+      VERSION:
281
+        load_filedata: gt6-screenshot/data
282
+        trim: true
283
+      BUILD_STATUS: success
284
+      BUILD_TYPE: SCREENSHOT
285
+

Loading…
Cancel
Save