Documentation
¶
Index ¶
- Variables
- func AddNowTimestamp(txt string) string
- func JsonListExtractFields(js string, field, filterField, filterRegex string) ([]string, error)
- func JsonListFindObjectValue(list []map[string]interface{}, key, value string) bool
- func LoginToRootOrg()
- func RandStringBytes(n int) string
- func WriteFile(path string, data []byte)
- func WriteTempFile(content string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Note, this url should be accessible by Cycloid API CyTestCatalogRepoURL = "git@github.com:cycloidio/cycloid-cli-test-catalog.git" CyTestCatalogRepoBranch = "master" CyTestConfigRepo = "cycloid-template-catalog-config" TestAPIURL = "https://api-cli-test.staging.cycloid.io/" TestRootOrg = "cycloid" TestAPIKey = "" )
View Source
var ( NowTimestamp = now.UnixNano() TestGitSshKey = []byte(`-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW QyNTUxOQAAACD8O9mhkl5CAiD0NLeQcoPf1duYHImQlTjOXcCOgHmC+AAAAJjCF9jzwhfY 8wAAAAtzc2gtZWQyNTUxOQAAACD8O9mhkl5CAiD0NLeQcoPf1duYHImQlTjOXcCOgHmC+A AAAEC0ryBZ1uJQ2drmjsO+WpsC2E/5SWheJD/r8+Q4LghWxfw72aGSXkICIPQ0t5Byg9/V 25gciZCVOM5dwI6AeYL4AAAAE2N5Y2xvaWRAZXhhbXBsZS5jb20BAg== -----END OPENSSH PRIVATE KEY-----`) TestPipelineSample = []byte(`jobs: - name: job-hello-world build_logs_to_retain: 3 plan: - task: hello-world config: platform: linux image_resource: type: docker-image source: {repository: busybox} run: path: /bin/sh args: - -ec - | echo ${MESSAGE} params: MESSAGE: ((message))`) TestPipelineVariables = []byte(`message: "hello world and especially to ($ organization_canonical $)"`) TestInfraPolicySample = []byte(` package test import input.tfplan as tfplan resource_types = { "aws_instance" } tags_ok(index) { tfplan.resource_changes[index].change.after.tags["env"] == "test" } deny[reason] { resources_not_ok := [resource_not_ok | resource_types[i] == tfplan.resource_changes[j].type not tags_ok(j); resource_not_ok := resource_types[i]] reason = sprintf("tag not in env: %s %s", [(resources_not_ok), test]) } `) )
Functions ¶
func AddNowTimestamp ¶
AddNowTimestamp add a timestamp suffix to a string
func JsonListExtractFields ¶
JsonListExtractFields Extract a field from a json entity
func JsonListFindObjectValue ¶
func LoginToRootOrg ¶
func LoginToRootOrg()
func RandStringBytes ¶
func WriteTempFile ¶
WriteTempFile will write the content to a temporary file and return the file path.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.