From 3c9b0b77b52d9a28e308d840073a997a135b9ebe Mon Sep 17 00:00:00 2001 From: Assaf Attias <49212512+attiasas@users.noreply.github.com> Date: Sun, 21 Jan 2024 11:57:00 +0200 Subject: [PATCH] Add release automation (#6) --- .jfrog-pipelines/pipelines.yml | 68 ++++++++++++++++++++++++++++++++++ audit_test.go | 2 - 2 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .jfrog-pipelines/pipelines.yml diff --git a/.jfrog-pipelines/pipelines.yml b/.jfrog-pipelines/pipelines.yml new file mode 100644 index 00000000..f3643d29 --- /dev/null +++ b/.jfrog-pipelines/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_securityCliGit_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 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)