Last active
August 17, 2016 18:57
-
-
Save Bogidon/8da9ae29902ad552a51dd4ee31b1fec7 to your computer and use it in GitHub Desktop.
Automate adding environment variables to CircleCI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Go to env vars page in project settings | |
// 2. Fill in info below | |
// 3. Paste contents into your browser's developer console | |
var envs = //your object with KEY:VALUE | |
var i = 0; | |
var keys = Object.keys(envs) | |
function recurse() { | |
var key = keys[i] | |
var value = envs[key]; | |
$.ajax({ | |
type :'POST', | |
url: // the env vars page url as a string, | |
data: {name: key, value: value}, | |
headers: {'X-CSRFToken': window.CSRFToken}, | |
success: function() { | |
i++; | |
recurse() | |
} | |
}); | |
} | |
recurse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment