elastic / apm-integration-testing

APM Integration Testing
Apache License 2.0
54 stars 68 forks source link

automate: bump elastic stack snapshot #1558

Closed v1v closed 1 year ago

v1v commented 1 year ago

Motivation/summary

Delegate the bump automation to the consumers rather than using a centralised bump automation.

For such it uses an opinionated approach where the current active branches and their snapshot manifests are published to a Google bucket. The original information is defined in the artifacts-api but it requires some jq/bash manipulations hence it has been simplified so consumers can curl any given branch to know the latest built artifact.

Issues

Requires https://github.com/elastic/apm-pipeline-library/pull/2070

Further details

See https://github.com/elastic/apm-pipeline-library/pull/2069

https://github.com/elastic/apm-integration-testing/pull/1549 was created using the old fashion way

Test

I used my forked repo and changed the updatecli pipeline:

     spec:
       user: '{{ requiredEnv "GIT_USER" }}'
       email: '{{ requiredEnv "GIT_EMAIL" }}'
-      owner: elastic
+      owner: v1v
       repository: apm-integration-testing
       token: '{{ requiredEnv "GITHUB_TOKEN" }}'
       username: '{{ requiredEnv "GIT_USER" }}'
-      branch: main
+      branch: test/bump-snapshot-stack

 sources:
   latestVersion:
     name: Get latest snapshot build for main
     kind: json
     spec:
-      file: https://storage.googleapis.com/artifacts-api/snapshots/main.json
+      file: https://storage.googleapis.com/artifacts-api/snapshots/8.5.json
       key: .build_id

so I ran

BRANCH=test/bump-snapshot-stack \
GIT_USER=victormartinezrubio@gmail.com \
GIT_EMAIL=victormartinezrubio@gmail.com \
updatecli apply --config .ci/bump-elastic-stack-snapshot.yml

and it created the PR -> https://github.com/v1v/apm-integration-testing/pull/3