-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-deploy.sh
38 lines (29 loc) · 923 Bytes
/
pkg-deploy.sh
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
#!/bin/sh
# This script deploys and configures the package to the sandbox or dev org by the provided username or alias
# Example: ./scripts/pkg-deploy.sh [email protected]
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
org_alias=$1
info() {
echo
echo "${green}$1${reset}"
}
error() {
echo "${red}$1${reset}"
exit 1
}
if [[ -z "$org_alias" ]]
then
error "Specify the org alias or username as the first parameter"
fi
info "Deploying components..."
sfdx force:source:deploy -u "$org_alias" -p ./src \
|| (\
info "Please login to the org" \
&& sfdx force:auth:web:login -a "$org_alias" \
&& sfdx force:source:deploy -u "$org_alias" -p ./src \
) || { exit 1; }
info "Assigning permissions..."
sfdx force:user:permset:assign -n GraphQLApexClientUser -u "$org_alias"
info "Deployment has been finished.\\nOpen the org with 'sfdx force:org:open -u $org_alias'"