Skip to content

Commit

Permalink
Add endpoint config
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickreimer committed Oct 9, 2019
1 parent fbd64e8 commit a465065
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cmds/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,23 @@ exports.describe = 'Performs a deployment';
exports.builder = yargs => {
yargs.option('config', {
alias: 'c',
describe: `Site configuration`
describe: 'Site configuration'
});

yargs.option('key', {
alias: 'k',
describe: `Deploy key`
describe: 'Deploy key'
});

yargs.option('endpoint', {
alias: 'e',
describe: 'API endpoint'
});
};

exports.handler = async args => {
const rawConfig = getConfig(args);
const endpoint = args.endpoint || 'https://api.statickit.com';
const spinner = ora(chalk.gray('Deploying...'));

if (!rawConfig) {
Expand Down Expand Up @@ -80,7 +86,7 @@ exports.handler = async args => {
try {
const response = await axios({
method: 'post',
url: 'https://api.statickit.com/cli/v1/deployments',
url: `${endpoint}/cli/v1/deployments`,
data: config,
headers: {
'StaticKit-Deploy-Key': deployKey,
Expand Down

0 comments on commit a465065

Please sign in to comment.