forked from forcedotcom/sfdx-travisci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
45 lines (39 loc) · 1.49 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
pool:
vmImage: 'Ubuntu 16.04'
variables:
- name: URL # hardcoded value
value: https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
steps:
# Download Secure File
# Download a secure file to a temporary location on the build or release agent
- task: DownloadSecureFile@1
inputs:
secureFile: server.key
displayName: 'Download server.key from secure location'
- script: |
export SFDX_AUTOUPDATE_DISABLE=false
export SFDX_USE_GENERIC_UNIX_KEYCHAIN=true
export SFDX_DOMAIN_RETRY=300
export SFDX_DISABLE_APP_HUB=true
export SFDX_LOG_LEVEL=DEBUG
displayName: 'Export/set variables'
- script: |
mkdir sfdx
wget -qO- $URL | tar xJ -C sfdx --strip-components 1
"./sfdx/install"
export PATH=./sfdx/$(pwd):$PATH
sfdx --version
sfdx plugins --core
sfdx force:auth:jwt:grant --clientid $(CONSUMERKEY) --username $(USERNAME) --jwtkeyfile $(Agent.TempDirectory)/server.key --setdefaultdevhubusername -a HubOrg
displayName: 'Run sfdx script'
- script: |
sfdx force:org:create -v HubOrg -s -f config/project-scratch-def.json -a ciorg
sfdx force:org:display -u ciorg
sfdx force:source:push -u ciorg
sfdx force:apex:test:run -u ciorg --wait 10
sfdx force:org:delete -u ciorg -p
displayName: 'Run Scratch Org deployment script, Run Tests and Delete'