This repository was archived by the owner on Jun 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
41 lines (35 loc) · 1.65 KB
/
.gitlab-ci.yml
File metadata and controls
41 lines (35 loc) · 1.65 KB
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
#
# Download the Salesforce CLI and install it
#
before_script:
# Set up environment variables
- export CLIURL=https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
- 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
- export DEPLOYDIR=src
- export TESTLEVEL=RunLocalTests
# Create sfdx directory
- mkdir ~/sfdx
# Install Salesforce CLI
# By default, the script installs the current version of Salesforce CLI. To install the release candidate, set the DX_CLI_URL_CUSTOM local variable to the appropriate URL
- wget -qO- ${DX_CLI_URL_CUSTOM-$CLIURL} | tar xJ -C ~/sfdx --strip-components 1
- export PATH=~/sfdx/bin:$PATH
# Output CLI version and plug-in information
- sfdx --version
- sfdx plugins --core
# Decrypt server key
- openssl enc -nosalt -aes-256-cbc -d -in assets/server.key.enc -out assets/server.key -base64 -K $DECRYPTION_KEY -iv $DECRYPTION_IV
#
# The script step authenticates to the target deployment org and deploys the metadata
#
deploy:
script:
# Authorize target deployment org
- sfdx auth:jwt:grant --instanceurl $ENDPOINT --clientid $CONSUMER_KEY --jwtkeyfile assets/server.key --username $USER_NAME --setalias UAT
# Deploy to target deployment org and run unit tests
- sfdx force:mdapi:deploy --wait 10 --deploydir $DEPLOYDIR --targetusername UAT --testlevel $TESTLEVEL
# Example shows how to run a check-only deploy
#- sfdx force:mdapi:deploy --checkonly --wait 10 --deploydir $DEPLOYDIR --targetusername UAT --testlevel $TESTLEVEL