Updated to properly configure sfdx binary

This commit is contained in:
Wade Wegner 2017-08-01 13:19:48 -07:00
Родитель bfd6f2c170
Коммит 558180942a
2 изменённых файлов: 11 добавлений и 9 удалений

5
.profile Normal file
Просмотреть файл

@ -0,0 +1,5 @@
echo "Updating PATH to include Salesforce CLI ..."
export PATH=$PATH:/app/.local/share/sfdx/cli/bin/
echo "Updating Salesforce CLI plugin ..."
sfdx update

15
app.js
Просмотреть файл

@ -172,8 +172,6 @@ router.post('/deploying', (req, res) => {
const startingDirectory = process.env.STARTINGDIRECTORY;
const directory = `${tokenName}-${timestamp}`;
const cli_path = process.env.CLI_PATH;
let script;
let sfdxurl;
@ -181,8 +179,7 @@ router.post('/deploying', (req, res) => {
case 'clone':
script = `${cli_path}sfdx force --help`;
// script = `${startingDirectory}mkdir ${directory};cd ${directory};git clone ${param} .`;
script = `${startingDirectory}mkdir ${directory};cd ${directory};git clone ${param} .`;
commands.run(command, script, (result) => {
console.log('temp result', result);
@ -196,7 +193,7 @@ router.post('/deploying', (req, res) => {
case 'auth':
sfdxurl = `echo "force://${consumerKey}:${consumerSecret}:${refresh_token}@${instance_url}" > sfdx.key`;
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${sfdxurl};${cli_path}sfdx force:auth:sfdxurl:store -f sfdx.key -d`;
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${sfdxurl};sfdx force:auth:sfdxurl:store -f sfdx.key -d`;
commands.run(command, script, (result) => {
res.json({
@ -208,7 +205,7 @@ router.post('/deploying', (req, res) => {
case 'create':
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${cli_path}sfdx force:config:set instanceUrl=${instance_url};${cli_path}sfdx force:org:create -v '${access_token}' -s -f ${param}`;
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;sfdx force:config:set instanceUrl=${instance_url};sfdx force:org:create -v '${access_token}' -s -f ${param}`;
commands.run(command, script, (result) => {
res.json({
@ -220,7 +217,7 @@ router.post('/deploying', (req, res) => {
case 'push':
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${cli_path}sfdx force:source:push`;
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;sfdx force:source:push`;
commands.run(command, script, (result) => {
res.json({
@ -232,7 +229,7 @@ router.post('/deploying', (req, res) => {
case 'test':
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;${cli_path}sfdx force:apex:test:run -r human --json | jq -r .result | jq -r .summary | jq -r .outcome`;
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;sfdx force:apex:test:run -r human --json | jq -r .result | jq -r .summary | jq -r .outcome`;
commands.run(command, script, (result) => {
res.json({
@ -244,7 +241,7 @@ router.post('/deploying', (req, res) => {
case 'url':
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;echo $(${cli_path}sfdx force:org:display --json | jq -r .result | jq -r .instanceUrl)"/secur/frontdoor.jsp?sid="$(${cli_path}sfdx force:org:display --json | jq -r .result | jq -r .accessToken)`;
script = `${startingDirectory}cd ${directory};export FORCE_SHOW_SPINNER=;echo $(sfdx force:org:display --json | jq -r .result | jq -r .instanceUrl)"/secur/frontdoor.jsp?sid="$(sfdx force:org:display --json | jq -r .result | jq -r .accessToken)`;
commands.run(command, script, (result) => {
res.json({