Code Monkey home page Code Monkey logo

sd-cmd's Introduction

sd-cmd

Build Status Go Report Card
Screwdriver commands (Sharing Binaries)

Usage

Install

$ go get github.com/screwdriver-cd/sd-cmd
$ cd $GOPATH/src/github.com/screwdriver-cd/sd-cmd
$ go build -a -o sd-cmd

Execute

Executing a published command. The arguments for published command can be specified by the following arguments.

USAGE:
   sd-cmd exec [options] [namespace/name@version] [arguments...]

OPTIONS:
   -debug, --debug    Output debug logs to a file
   -v, --v            Output verbose log to console

EXAMPLE:
   sd-cmd exec foo/bar@stable arg1 arg2

Debug mode

In debug mode, the debug log can be output to a file.
It can be used in one of the following ways.

  • Use -debug of --debug option
  • Set SD_CMD_DEBUG_LOG environment variable to true

Validate

Validating if yaml is correct as sd-cmd format.

USAGE:
   sd-cmd validate [options]

OPTIONS:
   -f, --f string    Specify the path of yaml to validate (default: sd-command.yaml)

EXAMPLE:
   sd-cmd validate -f ./sd-command.yaml

Publish

Publishing a command specified by a yaml.

USAGE:
   sd-cmd publish [options]

OPTIONS:
   -f, --f string    Specify the path of yaml to publish (default: sd-command.yaml)
   -t, --t string    Specify the tag given to the command (default: latest)

EXAMPLE:
   sd-cmd publish -f ./sd-command.yaml -t latest

Promote

Giving a tag to a targetVersion of command. If a tag is already set to another version, that tag will be moved to targetVersion. targetVersion can be set exact version or tag (e.g. 1.0.1, latest).

USAGE:
   sd-cmd promote [namespace/name] [targetVersion] [tag]

EXAMPLE:
   sd-cmd promote foo/bar latest stable
   sd-cmd promote foo/bar 1.0.1 stable

Remove tag

Removing a tag from a version of published command.

USAGE:
   sd-cmd removeTag [namespace/name] [tag]

EXAMPLE:
   sd-cmd removeTag foo/bar stable

Testing

go get github.com/screwdriver-cd/sd-cmd
go test -cover github.com/screwdriver-cd/sd-cmd/...

Local configuration

We can run sd-cmd locally by setting the environment variable as follows. Only execute and validate can be used in local, but not publish, promote, and remove tag.

# e.g. https://api.screwdriver.cd/v4/
$ export SD_API_URL=${YOUR_SD_API_HOST}/v4/
# e.g. https://store.screwdriver.cd/v1/
$ export SD_STORE_URL=${YOUR_SD_STORE_HOST}/v1/
$ export SD_TOKEN=${YOUR_USER_ACCESS_TOKEN_JWT}
$ export SD_ARTIFACTS_DIR=${DIRECTORY_TO_OUTPUT_LOGS}
$ export SD_BASE_COMMAND_PATH=${DIRECTORY_TO_INSTALL_COMMAND}

Refer to our doc on how to get the JWT.

License

Code licensed under the BSD 3-Clause license. See LICENSE file for terms.

sd-cmd's People

Contributors

catto avatar d2lam avatar dependabot[bot] avatar dmitris avatar fenrirunbound avatar itleigns avatar jithine avatar kirk-patton avatar klu909 avatar kumada626 avatar minzcmu avatar pritamstyz4ever avatar s-yoshika avatar stjohnjohnson avatar tanoda avatar tk3fftk avatar tkyi avatar wdstar avatar y-oksaku avatar yokawara avatar yoshwata avatar yuichi10 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.