Skip to content

Commit ef70e49

Browse files
authored
Create missing resources that were removed. (#3025)
* Create bump-golang.yml * Create bump-elastic-stack-snapshot.yml
1 parent 8331096 commit ef70e49

File tree

2 files changed

+155
-0
lines changed

2 files changed

+155
-0
lines changed

.ci/bump-elastic-stack-snapshot.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Bump elastic-stack to latest snapshot version
3+
pipelineid: 'bump-elastic-stack-snapshot-{{ requiredEnv "BRANCH" }}'
4+
5+
actions:
6+
default:
7+
title: '[updatecli] update elastic stack version for testing {{ source "latestVersion" }}-SNAPSHOT'
8+
kind: github/pullrequest
9+
spec:
10+
labels:
11+
- automation
12+
- dependency
13+
- backport-skip
14+
scmid: default
15+
16+
scms:
17+
default:
18+
kind: github
19+
spec:
20+
user: '{{ requiredEnv "GIT_USER" }}'
21+
email: '{{ requiredEnv "GIT_EMAIL" }}'
22+
owner: elastic
23+
repository: fleet-server
24+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
25+
username: '{{ requiredEnv "GIT_USER" }}'
26+
branch: '{{ requiredEnv "BRANCH" }}'
27+
28+
sources:
29+
latestVersion:
30+
name: Get latest snapshot build
31+
kind: json
32+
spec:
33+
file: https://storage.googleapis.com/artifacts-api/snapshots/{{ requiredEnv "BRANCH" }}.json
34+
key: .build_id
35+
36+
targets:
37+
update-snapshot:
38+
name: "Update snapshot.yml"
39+
kind: file
40+
sourceid: latestVersion
41+
scmid: default
42+
spec:
43+
file: dev-tools/integration/.env
44+
matchpattern: '(ELASTICSEARCH_VERSION)=\d+.\d+.\d+-.*-SNAPSHOT'
45+
replacepattern: '$1={{ source "latestVersion" }}-SNAPSHOT'

.ci/bump-golang.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
name: Bump golang-version to latest version
3+
4+
scms:
5+
githubConfig:
6+
kind: github
7+
spec:
8+
user: '{{ requiredEnv "GIT_USER" }}'
9+
email: '{{ requiredEnv "GIT_EMAIL" }}'
10+
owner: elastic
11+
repository: fleet-server
12+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
13+
username: '{{ requiredEnv "GIT_USER" }}'
14+
branch: main
15+
16+
actions:
17+
fleet-server:
18+
kind: github/pullrequest
19+
scmid: githubConfig
20+
sourceid: latestGoVersion
21+
spec:
22+
automerge: false
23+
labels:
24+
- dependencies
25+
- backport-skip
26+
title: '[Automation] Bump Golang version to {{ source "latestGoVersion" }}'
27+
28+
sources:
29+
minor:
30+
name: Get minor version in .go-version
31+
kind: shell
32+
transformers:
33+
- findsubmatch:
34+
pattern: '^\d+.(\d+).\d+$'
35+
captureindex: 1
36+
spec:
37+
command: cat .go-version
38+
39+
latestGoVersion:
40+
name: Get Latest Go Release
41+
kind: githubrelease
42+
dependson:
43+
- minor
44+
transformers:
45+
- trimprefix: go
46+
spec:
47+
owner: golang
48+
repository: go
49+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
50+
username: '{{ requiredEnv "GIT_USER" }}'
51+
versionfilter:
52+
kind: regex
53+
pattern: go1\.{{ source "minor" }}\.(\d*)$
54+
55+
gomod:
56+
dependson:
57+
- latestGoVersion
58+
name: Get version in go.mod format
59+
kind: shell
60+
transformers:
61+
- findsubmatch:
62+
pattern: '^(\d+.\d+).\d+'
63+
captureindex: 1
64+
spec:
65+
command: echo {{ source "latestGoVersion" }}
66+
67+
conditions:
68+
dockerTag:
69+
name: Is docker image golang:{{ source "latestGoVersion" }} published
70+
kind: dockerimage
71+
spec:
72+
image: golang
73+
tag: '{{ source "latestGoVersion" }}'
74+
sourceid: latestGoVersion
75+
76+
goDefaultVersion-check:
77+
name: Check if defined golang version differs
78+
kind: shell
79+
sourceid: latestGoVersion
80+
spec:
81+
command: 'grep -v -q {{ source "latestGoVersion" }} .go-version #'
82+
83+
targets:
84+
update-go-version:
85+
name: "Update .go-version"
86+
sourceid: latestGoVersion
87+
scmid: githubConfig
88+
kind: file
89+
spec:
90+
content: '{{ source "latestGoVersion" }}'
91+
file: .go-version
92+
matchpattern: '\d+.\d+.\d+'
93+
update-golang.ci:
94+
name: "Update .golangci.yml"
95+
sourceid: latestGoVersion
96+
scmid: githubConfig
97+
kind: file
98+
spec:
99+
content: '{{ source "latestGoVersion" }}'
100+
file: .golangci.yml
101+
matchpattern: '\d+.\d+.\d+'
102+
update-gomod:
103+
name: "Update go.mod"
104+
sourceid: gomod
105+
scmid: githubConfig
106+
kind: file
107+
spec:
108+
content: 'go {{ source "gomod" }}'
109+
file: go.mod
110+
matchpattern: 'go \d+.\d+'

0 commit comments

Comments
 (0)