Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 13 additions & 69 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,13 @@
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 enc -nosalt -aes-256-cbc -d -in assets/server.key.enc -out assets/server.key -base64 -K $DECRYPTION_KEY -iv $DECRYPTION_IV
#- 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 assets/server.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
# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
# Use a package of configuration called an orb.
orbs:
# Declare a dependency on the welcome-orb
welcome: circleci/welcome-orb@0.4.1
# Orchestrate or schedule a set of jobs
workflows:
# Name the workflow "welcome"
welcome:
# Run the welcome/run job in its own container
jobs:
- welcome/run