Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zavarat/a405a9469e3a4e2b2b396918495ad49e to your computer and use it in GitHub Desktop.
Save zavarat/a405a9469e3a4e2b2b396918495ad49e to your computer and use it in GitHub Desktop.
Multiline Curl PUT'ing of data with no extra processing (thanks to --data-binary flag). We also use @ with a hyphen, so @- (the hyphen indicates input from stdin)
curl -E $DEV_CERT_PEM https://api.our-service.com/component/component-name/configuration --header 'Content-Type: application/json' --request PUT --data-binary @- <<BODY
[
{
"key": "git_ssh_private_key",
"value": "$(cat pri.key)",
"secure": true
},
{
"key": "git_ssh_public_key",
"value": "$(cat pub.key)",
"secure": true
},
{
"key": "jenkins_master_internal_hostname",
"value": "foo.bar.jenkins.baz.qux.my-domain.com"
},
{
"key": "cloudwatch_log_group_name",
"value": "live-foo-bar-jenkins-baz-main-JenkinsAgentsLogGroup-qux"
},
{
"key": "docker_registry_hostname",
"value": "https://jenkins.foobar.my-domain.com"
}
]
BODY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment