81 lines
2.6 KiB
YAML
81 lines
2.6 KiB
YAML
# This small test makes sure that updatecli is working properly on a repo.
|
|
# To test this:
|
|
# have "UPDATECLI_GITHUB_ACTOR" env set to your github username
|
|
# have "UPDATECLI_GITHUB_TOKEN" env set to your github token
|
|
# have the latest version of updatecli installed
|
|
# 'updatecli diff -v updatecli/values.yaml -c updatecli/updatecli.d/updatecli.yml'
|
|
# In the future, more useful files should be added to this directory.
|
|
---
|
|
name: "Introduce updatecli to repo and validate basic functionality"
|
|
# Make sure we can pull in github repos from multiple orgs
|
|
scms:
|
|
rke2:
|
|
kind: "github"
|
|
spec:
|
|
user: "{{ .github.user }}"
|
|
email: "{{ .github.email }}"
|
|
username: "{{ requiredEnv .github.username }}"
|
|
token: '{{ requiredEnv .github.token }}'
|
|
owner: rancher
|
|
repository: terraform-aws-access
|
|
branch: main
|
|
go:
|
|
kind: "github"
|
|
spec:
|
|
user: "{{ .github.user }}"
|
|
email: "{{ .github.email }}"
|
|
username: "{{ requiredEnv .github.username }}"
|
|
token: '{{ requiredEnv .github.token }}'
|
|
owner: golang
|
|
repository: go
|
|
branch: main
|
|
|
|
sources:
|
|
# validate gittag parsing external public repos
|
|
goTag:
|
|
name: "Get Go 1.20.2 tag"
|
|
kind: "gittag"
|
|
scmid: "go"
|
|
spec:
|
|
versionfilter:
|
|
kind: "regex"
|
|
pattern: '^go1\.20\.2$'
|
|
|
|
# Validate read access to local repo
|
|
## continue to targets if the go version in the validate file doesn't match the goTag source
|
|
conditions:
|
|
testVersionShouldMatchGoTag:
|
|
name:
|
|
kind: yaml
|
|
sourceid: goTag
|
|
spec:
|
|
file: "updatecli/validate.yml"
|
|
key: version
|
|
failwhen: true #if set to true, continue to targets when condition is true rather than false
|
|
|
|
# Validate the ability to generate branches, commits, what the commits look like, and what branches look like
|
|
## allow validation of workflow to delete unused branch after merge
|
|
## generate a commit on a branch named updatecli_<256 sha of change>
|
|
## the commit message will be automatically generated by updatecli based on the change
|
|
targets:
|
|
updateValidateFile:
|
|
name: "Update the version in the validate file"
|
|
kind: "yaml"
|
|
scmid: "terraform-aws-access"
|
|
sourceid: goTag
|
|
spec:
|
|
file: "updatecli/validate.yml"
|
|
key: version
|
|
|
|
# Validate generating a pull request
|
|
actions:
|
|
# create a pull request which is not allowed to automerge
|
|
# the title matches the commit message
|
|
github:
|
|
kind: "github/pullrequest"
|
|
scmid: "terraform-aws-access"
|
|
spec:
|
|
automerge: false
|
|
draft: false
|
|
mergemethod: squash
|
|
parent: false # this would allow for making a PR to an upstream fork, if we ran updatecli from a fork |