-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
version: 2 | ||
|
||
general: | ||
# Uncomment the following to specify only a specific branch | ||
# branches: | ||
# only: | ||
# - dev # specific branch | ||
# - /dev-.*/ # or regexes | ||
|
||
jobs: | ||
build: | ||
machine: true | ||
working_directory: ~/ci_app | ||
environment: | ||
# from https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli_standalone.htm | ||
# and https://developer.salesforce.com/media/salesforce-cli/manifest.json | ||
- DX_CLI_URL: https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz | ||
steps: | ||
- checkout | ||
- run: | ||
name: Download CLI | ||
command: | | ||
mkdir sfdx | ||
wget -qO- $DX_CLI_URL | tar xJ -C sfdx --strip-components 1 | ||
- run: | ||
name: Install CLI | ||
command: | | ||
./sfdx/install | ||
sfdx | ||
mkdir tmp | ||
- run: | ||
name: Create hub key | ||
command: | | ||
echo 'make hub key' | ||
mkdir keys | ||
echo $HUB_SERVER_KEY_HEX | xxd -r -ps >> keys/hub.key | ||
openssl rsa -in keys/hub.key -check -noout | ||
### Uncomment the following if performing deployments | ||
#- echo 'make deploy key' | ||
#- echo $DEPLOY_SERVER_KEY_HEX | xxd -r -ps >> keys/deploy.key | ||
#- openssl rsa -in keys/deploy.key -check -noout | ||
#- sfdx force:auth:jwt:grant --clientid $DEPLOY_CONSUMER_KEY --jwtkeyfile keys/deploy.key --username $DEPLOY_SFDC_USER -a deploy | ||
- run: | ||
name: Setup Org | ||
command: | | ||
echo 'Running tests' | ||
sfdx force:auth:jwt:grant --clientid $HUB_CONSUMER_KEY --jwtkeyfile keys/hub.key --username $HUB_SFDC_USER --setdefaultdevhubusername -a hub | ||
sfdx force --help | ||
sfdx force:org:create -s -f ~/ci_app/config/project-scratch-def.json -a circle_build_$CIRCLE_BUILD_NUM --wait 2 | ||
sfdx force:source:push -u circle_build_$CIRCLE_BUILD_NUM | ||
- run: | ||
name: Run Apex Tests | ||
command: | | ||
mkdir -p ~/junit | ||
sfdx force:apex:test:run -c -d ~/junit -r junit --wait 5 | ||
- store_test_results: | ||
path: ~/junit | ||
- run: | ||
name: Delete Useless Scratch Org | ||
command: | | ||
sfdx force:org:delete -u circle_build_$CIRCLE_BUILD_NUM -p | ||
### Uncomment the following if performing deployments | ||
#deployment: | ||
# override: | ||
# - sfdx force:source:convert -r force-app -d testDeploy | ||
# - . cleanupDeploy.sh | ||
# - sfdx force:mdapi:deploy -d testDeploy/ -u deploy -w 2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ node_modules | |
.settings | ||
selenium-client-jars/ | ||
test/artifacts | ||
.circleci/* |