From 07cd783a650c028005edaf13d80b16376cc344ed Mon Sep 17 00:00:00 2001 From: attiasas Date: Sun, 21 Jan 2024 09:48:14 +0200 Subject: [PATCH 1/3] Add release automation --- audit_test.go | 2 -- release/pipelines.yml | 68 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 release/pipelines.yml diff --git a/audit_test.go b/audit_test.go index c83f25c1..951f6bc4 100644 --- a/audit_test.go +++ b/audit_test.go @@ -24,8 +24,6 @@ import ( "github.com/jfrog/jfrog-client-go/xray/services" ) -// XrayCli -> PlatformCli - func TestXrayAuditNpmJson(t *testing.T) { output := testXrayAuditNpm(t, string(format.Json)) securityTestUtils.VerifyJsonScanResults(t, output, 0, 1, 1) diff --git a/release/pipelines.yml b/release/pipelines.yml new file mode 100644 index 00000000..04f72d14 --- /dev/null +++ b/release/pipelines.yml @@ -0,0 +1,68 @@ +resources: + - name: securityCliGit + type: GitRepo + configuration: + path: jfrog/jfrog-cli-security + branches: + include: dev + gitProvider: il_automation + +pipelines: + - name: release_security_cli + configuration: + runtime: + type: image + image: + custom: + name: releases-docker.jfrog.io/jfrog-ecosystem-integration-env + tag: latest + environmentVariables: + readOnly: + NEXT_VERSION: 0.0.0 + + steps: + - name: Release + type: Bash + configuration: + inputResources: + - name: securityCliGit + trigger: false + integrations: + - name: il_automation + - name: ecosys_entplus_deployer + execution: + onExecute: + - cd $res_frogbotGit_resourcePath + + # Set env + - export CI=true + + # Make sure version provided + - echo "Checking variables" + - test -n "$NEXT_VERSION" -a "$NEXT_VERSION" != "0.0.0" + + # Configure Git and merge from the dev + - git checkout main + - git remote set-url origin https://$int_il_automation_token@github.com/jfrog/jfrog-cli-security.git + - git merge origin/dev + - git tag v${NEXT_VERSION} + + # Download JFrog CLI + - curl -fL https://install-cli.jfrog.io | sh + - jf c rm --quiet + - jf c add internal --url=$int_ecosys_entplus_deployer_url --user=$int_ecosys_entplus_deployer_user --password=$int_ecosys_entplus_deployer_apikey + + # Audit + - jf audit --fail=false + + # Push to main + - git clean -fd + - git push + - git push --tags + + # Merge changes to dev + - git checkout dev + - git merge origin/main + - git push + onComplete: + - jf c rm --quiet \ No newline at end of file From 92f641e01aeb12730b29d5139957e8e407fe04b7 Mon Sep 17 00:00:00 2001 From: attiasas Date: Sun, 21 Jan 2024 10:12:43 +0200 Subject: [PATCH 2/3] fix path --- release/pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/pipelines.yml b/release/pipelines.yml index 04f72d14..f3643d29 100644 --- a/release/pipelines.yml +++ b/release/pipelines.yml @@ -32,7 +32,7 @@ pipelines: - name: ecosys_entplus_deployer execution: onExecute: - - cd $res_frogbotGit_resourcePath + - cd $res_securityCliGit_resourcePath # Set env - export CI=true From a3c5d64c159c269515ef0b948b2fe197ca35a0eb Mon Sep 17 00:00:00 2001 From: attiasas Date: Sun, 21 Jan 2024 10:29:08 +0200 Subject: [PATCH 3/3] change to expected folder name --- {release => .jfrog-pipelines}/pipelines.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {release => .jfrog-pipelines}/pipelines.yml (100%) diff --git a/release/pipelines.yml b/.jfrog-pipelines/pipelines.yml similarity index 100% rename from release/pipelines.yml rename to .jfrog-pipelines/pipelines.yml