From e1e36f68edb7325c15818b34c7b147fad1aa37b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Fri, 1 Nov 2024 13:24:49 +0100 Subject: [PATCH] reenable updatecli --- Makefile | 14 +++-- src/main.js | 2 +- updatecli-compose.yaml | 14 +++++ updatecli/updatecli.d/npm.yaml | 31 ----------- updatecli/updatecli.d/updatecli.yaml | 77 ++++++++++++++-------------- updatecli/values.d/scm.yaml | 8 +++ 6 files changed, 72 insertions(+), 74 deletions(-) create mode 100644 updatecli-compose.yaml delete mode 100644 updatecli/updatecli.d/npm.yaml create mode 100644 updatecli/values.d/scm.yaml diff --git a/Makefile b/Makefile index 458c1c8..fb6068f 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,14 @@ prepare: npm run prepare -.PHONY:act -act: prepare - act pull_request -j test +PHONY: updatecli-diff +updatecli-diff: ## Run updatecli in diff mode + updatecli compose diff + +PHONY: updatecli-apply +updatecli-apply: ## Run updatecli in apply mode + updatecli compose apply + +PHONY: updatecli-show +updatecli-show: ## Run updatecli in show mode + updatecli compose show diff --git a/src/main.js b/src/main.js index 1b02ec5..edd834d 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,7 @@ export async function fslabscliDownload() { { arch: 'x64', platform: 'linux', - name: 'fslabscli-x86_64-linux', + name: 'cargo-fslabscli-x86_64-linux', }, ] diff --git a/updatecli-compose.yaml b/updatecli-compose.yaml new file mode 100644 index 0000000..813b10a --- /dev/null +++ b/updatecli-compose.yaml @@ -0,0 +1,14 @@ +policies: + - name: Local Updatecli Policies + config: + - updatecli/updatecli.d + values: + - updatecli/values.d/scm.yaml + - name: Handle Updatecli Policy Updates + policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.8.0@sha256:99e9e61b501575c2c176c39f2275998d198b590a3f6b1fe829f7315f8d457e7f + values: + - updatecli/values.d/scm.yaml + - name: Handle NPM + policy: ghcr.io/updatecli/policies/autodiscovery/npm:0.11.0 + values: + - updatecli/values.d/scm.yaml diff --git a/updatecli/updatecli.d/npm.yaml b/updatecli/updatecli.d/npm.yaml deleted file mode 100644 index 2314807..0000000 --- a/updatecli/updatecli.d/npm.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Bump All NPM package version" -pipelineid: npm - -actions: - default: - kind: github/pullrequest - scmid: default - spec: - labels: - - "dependencies" - -scms: - default: - kind: github - spec: - branch: main - email: devops@fslabs.ca - owner: ForesightMiningSoftwareCorporation - repository: fslabsci-action - token: '{{requiredEnv "UPDATECLI_GITHUB_TOKEN"}}' - user: ForesightMiningSoftwareCorporation - username: github-actions - - -autodiscovery: - scmid: default - actionid: default - groupby: all - crawlers: - npm: - diff --git a/updatecli/updatecli.d/updatecli.yaml b/updatecli/updatecli.d/updatecli.yaml index 55368b9..15003b5 100644 --- a/updatecli/updatecli.d/updatecli.yaml +++ b/updatecli/updatecli.d/updatecli.yaml @@ -1,45 +1,44 @@ pipelineid: version name: Bump fslabscli version actions: - default: - title: Bump fslabscli version to {{ source "fslabscli" }} - kind: github/pullrequest - spec: - automerge: true - mergemethod: squash - usetitleforautomerge: true - labels: - - dependencies - - updatecli - scmid: default + default: + title: Bump fslabscli version to {{ source "fslabscli" }} + kind: github/pullrequest + spec: + automerge: true + mergemethod: squash + usetitleforautomerge: true + labels: + - dependencies + - updatecli + scmid: default scms: - default: - kind: github - spec: - branch: v1 - email: devops@fslabs.ca - owner: ForesightMiningSoftwareCorporation - repository: fslabsci-action - token: '{{requiredEnv "UPDATECLI_GITHUB_TOKEN"}}' - user: ForesightMiningSoftwareCorporation - username: github-actions - disabled: false + default: + kind: github + spec: + branch: "{{ .scm.branch }}" + email: "{{ .scm.email }}" + owner: "{{ .scm.owner }}" + repository: "{{ .scm.repository }}" + username: '{{ requiredEnv "GITHUB_ACTOR" }}' + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + commitusingapi: true sources: - fslabscli: - name: Get latest fslabscli version - kind: githubrelease - spec: - owner: ForesightMiningSoftwareCorporation - repository: fslabscli - token: '{{requiredEnv "UPDATECLI_GITHUB_TOKEN"}}' - transformers: - - trimprefix: "cargo-fslabscli-" + fslabscli: + name: Get latest fslabscli version + kind: githubrelease + spec: + owner: ForesightMiningSoftwareCorporation + repository: fslabscli + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + transformers: + - trimprefix: "cargo-fslabscli-" targets: - action: - name: Bump fslabscli version in action.yaml - kind: yaml - spec: - file: action.yaml - key: inputs.version.default - scmid: default - sourceid: fslabscli + action: + name: Bump fslabscli version in action.yaml + kind: yaml + spec: + file: action.yaml + key: $.inputs.version.default + scmid: default + sourceid: fslabscli diff --git a/updatecli/values.d/scm.yaml b/updatecli/values.d/scm.yaml new file mode 100644 index 0000000..c56d05e --- /dev/null +++ b/updatecli/values.d/scm.yaml @@ -0,0 +1,8 @@ +scm: + enabled: true + user: fmsc-bot + username: fmsc-bot + email: updatecli@fslabs.ca + owner: ForesightMiningSoftwareCorporation + repository: fslabscli-action + branch: v1