Giter Site home page Giter Site logo

get-zap's Introduction

Get-zap

What is this?

The immediate purpose of this program is to retrieve releases of zap from the release page on Github.

Under the hood, it is a generic retriever of release assets from github from any project. It also supports Artifactory caching.

So this program can be useful for you in any environment (CI, or personal desktop), where you have a following need:

  • retrieve assets from github project releases
  • download files from Artifactory
  • upload files to Artifactory
  • automate the process of: download a release artifact, if it exists in Artifactory, get it from there, otherwise get it directly from Github releases, along the way caching it to Artifactory for next time

Who should use this?

There are few use cases:

  • Anyone who wants to get the "correct" version of zap, should be able to use this. Whether it's Matter SDK, or something else.
  • Anyone who wants to download release artifacts from github can use it, but there are also other tools just for that.
  • Anyone who wants to upload and download files from/to Artifactory can use this.
  • Anyone who wants to retrieve a file which may be cached on Artifactory, but is originally an asset from Github.

Architecture

This is a Go program. It uses the JFrog Go client library and the Github Go client librariy to perform access to Artifactory and Github. It does not use any other means to talk to Artifactory or Github, so all documentation regarding limitations for those libraries apply.

Build Instructions

You need go toolchain installed to build it from source code. Many platforms (Linuxes, brew) come with Go toolchains easily installable through your package manager of choice, or you can follow instructions here.

Once you have go installed:

  1. You can simply run go run . to execute the program from source.
  2. Or build it using go build and run get-zap executable that gets created.
  3. You can run go install to build and deploy the executable into your Go bin directory.
  4. If you want to build for a different platform than local, then set the GOOS and GOARCH environment variables as described here before you run go build.

When executing get-zap without any arguments, it will by default download the latest stable release of Zap for the local platform.

For all other options, type get-zap --help or go run . --help if you run from source.

Setup

You can configure all the arguments to this program either via command line arguments, through environment variables, or via a configuration file ~/.get-zap.json

Github related environment variables:

  • GET_ZAP_GHTOKEN: Github API access token
  • GET_ZAP_GHOWNER: Owner of the github repo.
  • GET_ZAP_GHREPO: Github repo name.

Artifactory related environment variables in question are:

  • GET_ZAP_RTAPIKEY: Artifactory API key.
  • GET_ZAP_RTPATH: Artifactory path within the repo.
  • GET_ZAP_RTREPO: Artifactory repo..
  • GET_ZAP_RTURL: Artifactory url.
  • GET_ZAP_RTUSER: Artifactory user.

Examples

  1. Default execution without any arguments:
[~/git/get-zap (main)]$ ./get-zap
  1. Download from a different repo than zap (example, latest release of PTI library):
[~/git/get-zap (main)]$ ./get-zap --ghOwner SiliconLabs --ghRepo java_packet_trace_library
  1. List latest zap release:
[~/git/get-zap (main)]$ ./get-zap gh list
  1. List all zap releases:
[~/git/get-zap (main)]$ ./get-zap gh list --ghRelease all
  1. List all releases of a different repo:
[~/git/get-zap (main)]$ ./get-zap gh list --ghRelease all --ghOwner SiliconLabs --ghRepo java_packet_trace_library
  1. Download a specific zap release:
[~/git/get-zap (main)]$ ./get-zap --ghRelease v2024.01.05-nightly
  1. Print help:
[~/git/get-zap (main)]$ ./get-zap --help

get-zap's People

Contributors

dependabot[bot] avatar tecimovic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.