spm

command module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2017 License: MIT Imports: 25 Imported by: 0

README

Build Status

SPM

Salesforce Package Manager

Install

Download binary file from release page and copy it to executable path.

If you want to use latest version, execute following command.

$ go get -u github.com/tzmfreedom/spm

If you use macOS, home brew is available for installation.

$ brew tap tzmfreedom/spm
$ brew install spm

Usage

$ spm [global options] command [command options] [arguments...]

COMMANDS:
     install, i  Install salesforce metadata on public remote repository(i.g. github) or salesforce org
     clone, c    Download metadata from salesforce organization
     help, h     Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version
Install Package
$ spm install [command options] [arguments...]

OPTIONS:
   --username value, -u value   [$SF_USERNAME]
   --password value, -p value   [$SF_PASSWORD]
   --endpoint value, -e value  (default: "login.salesforce.com") [$SF_ENDPOINT]
   --apiversion value          (default: "38.0") [$SF_APIVERSION]
   --pollSeconds value         (default: 5) [$SF_POLLSECONDS]
   --timeoutSeconds value      (default: 0) [$SF_TIMEOUTSECONDS]
   --packages value, -P value
  • Install from remote repository
$ spm install https://github.com/{USER}/{REPOSITORY} -u {USERNAME} -p {PASSWORD}

example:
$ spm install https://github.com/tzmfreedom/apex_tdclient -u hoge -p fuga

You can specify repository with following format.

{REMOTE_REPOSITORY_BASE}/{USER}/{REPOSITORY} # i.g. https://github.com/tzmfreedom/apex_tdclient
{REMOTE_REPOSITORY_BASE}/{USER}/{REPOSITORY}/{SUB_DIRECTORY} # i.g. https://github.com/tzmfreedom/apex_tdclient/sample/repositories/dependencies
{USER}/{REPOSITORY} # i.g. tzmfreedom/apex_tdclient
{USER}/{REPOSITORY}/{SUB_DIRECTORY} # i.g. tzmfreedom/spm/sample/repositories/dependencies
  • Install from salesforce
$ spm install sf://{username}:{password}@{salesforce endpoint}?path={package file path}&version={version}

example:
$ spm install sf://hoge:fuga@login.salesforce.com?path=./package.toml&version=38.0
  • Install from package.yml
$ spm install -u {USERNAME} -p {PASSWORD} -P package.yml

Dependency package yaml format

packages:
  - tzmfreedom/apex-util1
  - tzmfreedom/apex-util2
  - tzmfreedom/apex-util3

Sandbox

$ spm install https://github.com/{USER}/{REPOSITORY} -u {USERNAME} -p {PASSWORD} -e test.salesforce.com

Download metadata from salesforce

$ spm clone sf://{username}:{password}@{salesforce endpoint}?path={package file path}&version={version}

example:
$ spm clone sf://hoge:fuga@login.salesforce.com
Package File Format

The package file format for downloading from salesforce is toml.

  • example
version = 37.0

[[types]]
name = "ApexClass"
members = ["Hoge", "Fuga"]

[[types]]
name = "CustomObject"
members = ["Account", "Contact"]

[[types]]
name = "ApexPage"
members = ["HogePage"]

[[types]]
name = "ApexTrigger"
members = ["HogeTrigger"]

[[types]]
name = "Layout"
members = ["Task-Task Layout"]

[[types]]
name = "Profile"
members = ["Admin"]

Contribute

Just send pull request if needed or fill an issue!

License

The MIT License See LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL