|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| main.go | ||
README.md
semvalidator
This allows running validations on semaphore pipeline files.
Usage
The help give all the required options.
$ docker run --rm calico/go-build:${GOBUILD_VERSION} semvalidator --help
Usage of semvalidator:
-debug
enable debug logging
-dirs string
comma separated list of directories to search for Semaphore pipeline files
-files string
comma separated list of Semaphore pipeline files
-org string
Semaphore organization
-org-url string
Semaphore organization URL
-skip-dirs string
comma separated list of directories to skip when searching for Semaphore pipeline files
-token string
Semaphore API token
You can specify dirs that contain semaphore pipeline files (using -dirs)
and/or files that are semphore pipeline files (using -files).
If using -dirs, this tool assumes all YAML files in the folder recursively are Semaphore pipeline files.
To skip specific folders in the directories specified, use -skip-dirs
Set the organization using either -org or -org-url as it is needed to determine
where to send the validation requests.
The token needs to be a valid Semaphore API token.
It will try to use the SEMAPHORE_API_TOKEN environment variable if flag is empty.
Examples
Using latest as ${GOBUILD_VERSION}
- Give a project
<path-to-dir>with semaphore files in<path-to-dir>/.semaphoredirectory, below is how to validate the files in that directory.
docker run --rm -v <path-to-dir>:<location-in-container>:ro calico/go-build:latest semvalidator -dirs <location-in-container>/.semaphore -org <semaphore-organization> -token <semaphore-token>
- Give a project
<path-to-dir>with semaphore files in<path-to-dir>/.semaphoredirectory, below is how to validate the files in that directory using-org-urlflag with$SEMAPHORE_ORGANIZATION_URLenvironment variable.
docker run --rm -v <path-to-dir>:<location-in-container>:ro calico/go-build:latest semvalidator -dirs <location-in-container>/.semaphore -org-url ${SEMAPHORE_ORGANIZATION_URL} -token <semaphore-token>
- Give a project
<path-to-dir>with semaphore file in<path-to-dir>/.semaphore/semaphore.ymldirectory, below is how to validate the files in that directory.
docker run --rm -v <path-to-dir>:<location-in-container>:ro calico/go-build:latest semvalidator -files <path-to-dir>/.semaphore/semaphore.yml -org <semaphore-organization> -token <semaphore-token>