leap_salesforce 1.2.2 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +25 -17
- data/ChangeLog +6 -0
- data/leap_salesforce.gemspec +1 -0
- data/lib/leap_salesforce/get_prod_auth.sh +2 -2
- data/lib/leap_salesforce/get_scratch_auth_jwt.sh +2 -2
- data/lib/leap_salesforce/get_scratch_auth_url.sh +2 -2
- data/lib/leap_salesforce/rake/sfdx.rake +4 -4
- data/lib/leap_salesforce/version.rb +1 -1
- data/lib/leap_salesforce.rb +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b3796e62552604c5d65b95ae7fb7e8771038772ccabb7c7251e792baa27de5a
|
4
|
+
data.tar.gz: 9f0904a42010ee3844e46554f8a1dbd85883bf69afedb43b2e828c8090194b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dffa3ad733919a61f09d07f06b396055a4d70453988bec12817d627be9633f65a7c785f852d772b62642ad789113385ab3fe1beefbd41a3811fb7595de28f15
|
7
|
+
data.tar.gz: 2eddc54342f6d2b32c26765c7072903e2481ba26265fd28aa6c33f282cd91d23a0204d160a3cfcdeeed7e429f12c3ab168eb941b987bc7b8b98bd2ba170c2542
|
data/.gitlab-ci.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
include:
|
2
2
|
- template: Code-Quality.gitlab-ci.yml
|
3
3
|
|
4
|
-
image: ruby:3.
|
4
|
+
image: ruby:3.3
|
5
5
|
|
6
6
|
stages:
|
7
7
|
- test
|
@@ -13,7 +13,12 @@ variables:
|
|
13
13
|
client_id: $client_id
|
14
14
|
client_secret: $client_secret
|
15
15
|
SERVER_KEY_PASSWORD: $SERVER_KEY_PASSWORD
|
16
|
-
|
16
|
+
# LANG: 'UTF-8'
|
17
|
+
LC_CTYPE: en_US
|
18
|
+
LANG: en_US.UTF-8
|
19
|
+
LANGUAGE: en_US.UTF-8
|
20
|
+
LC_ALL: en_US.UTF-8
|
21
|
+
RUBYOPT: "-KU -E utf-8:utf-8"
|
17
22
|
|
18
23
|
pages:
|
19
24
|
stage: deploy
|
@@ -208,7 +213,7 @@ pages:
|
|
208
213
|
|
209
214
|
local file=$(mktemp)
|
210
215
|
echo $org_auth_url > $file
|
211
|
-
local cmd="sfdx force:auth:sfdxurl:store --sfdxurlfile $file --
|
216
|
+
local cmd="sfdx force:auth:sfdxurl:store --sfdxurlfile $file --alias $alias_to_set --json" && (echo $cmd >&2)
|
212
217
|
local output=$($cmd)
|
213
218
|
|
214
219
|
sfdx force:config:set defaultusername=$alias_to_set
|
@@ -231,7 +236,7 @@ pages:
|
|
231
236
|
echo "org_username=$org_username" >&2
|
232
237
|
|
233
238
|
# Parse the SFDX Auth URL for the given org
|
234
|
-
local cmd="sfdx force:org:display --verbose --
|
239
|
+
local cmd="sfdx force:org:display --verbose --target-org $org_username --json" && (echo $cmd >&2)
|
235
240
|
local output=$($cmd)
|
236
241
|
org_auth_url="$(jq -r '.result.sfdxAuthUrl' <<< $output)"
|
237
242
|
|
@@ -258,7 +263,7 @@ pages:
|
|
258
263
|
echo "org_username=$org_username" >&2
|
259
264
|
echo "limit_name=$limit_name" >&2
|
260
265
|
|
261
|
-
local cmd="sfdx force:limits:api:display --
|
266
|
+
local cmd="sfdx force:limits:api:display --target-org $org_username --json" && (echo $cmd >&2)
|
262
267
|
local limits=$($cmd) && (echo $limits | jq '.' >&2)
|
263
268
|
local limit=$(jq -r '.result[] | select(.name == env.limit_name)' <<< $limits)
|
264
269
|
|
@@ -426,7 +431,7 @@ pages:
|
|
426
431
|
fi
|
427
432
|
|
428
433
|
# install the package
|
429
|
-
local cmd="sfdx force:package:install --
|
434
|
+
local cmd="sfdx force:package:install --target-org $org_username --package $package_version_id --wait 10 --publishwait 10 --noprompt --json" && (echo $cmd >&2)
|
430
435
|
local output=$($cmd) && (echo $output | jq '.' >&2)
|
431
436
|
|
432
437
|
# assert no error response
|
@@ -470,7 +475,7 @@ pages:
|
|
470
475
|
exit 1;
|
471
476
|
fi
|
472
477
|
|
473
|
-
local cmd="sfdx force:org:open --
|
478
|
+
local cmd="sfdx force:org:open --target-org $org_username --urlonly --json" && (echo $cmd >&2)
|
474
479
|
local output=$($cmd) # don't echo/expose the output which contains the auth url
|
475
480
|
local url=$(jq -r ".result.url" <<< $output)
|
476
481
|
|
@@ -517,7 +522,7 @@ pages:
|
|
517
522
|
echo $scratch_org_username > SCRATCH_ORG_USERNAME.txt
|
518
523
|
|
519
524
|
# Get the auth URL
|
520
|
-
local cmd="sfdx force:org:display --verbose --
|
525
|
+
local cmd="sfdx force:org:display --verbose --target-org $org_username --json" && (echo $cmd >&2)
|
521
526
|
local output=$($cmd)
|
522
527
|
org_auth_url="$(jq -r '.result.sfdxAuthUrl' <<< $output)"
|
523
528
|
echo $org_auth_url > SCRATCH_ORG_AUTH_URL.txt
|
@@ -535,7 +540,7 @@ pages:
|
|
535
540
|
function get_scratch_org_usernames() {
|
536
541
|
local devhub=$1
|
537
542
|
local orgname=$2
|
538
|
-
local result=$(sfdx force:data:soql:query --
|
543
|
+
local result=$(sfdx force:data:soql:query --target-org $devhub --query "SELECT SignupUsername FROM ScratchOrgInfo WHERE OrgName='$orgname'" --json)
|
539
544
|
local usernames=$(jq -r ".result.records|map(.SignupUsername)|.[]" <<< $result)
|
540
545
|
echo $usernames
|
541
546
|
}
|
@@ -595,29 +600,32 @@ pages:
|
|
595
600
|
local usernames=$(get_scratch_org_usernames $devhub_username $scratch_org_name)
|
596
601
|
for scratch_org_username in $usernames; do
|
597
602
|
echo "Deleting $scratch_org_username"
|
598
|
-
local cmd="sfdx force:data:record:delete --sobjecttype ScratchOrgInfo --
|
603
|
+
local cmd="sfdx force:data:record:delete --sobjecttype ScratchOrgInfo --target-org $devhub_username --where "'"SignupUsername='$scratch_org_username'"'" --json" && (echo $cmd >&2)
|
599
604
|
local output=$($cmd) && (echo $output | jq '.' >&2)
|
600
605
|
done
|
601
606
|
}
|
602
607
|
|
603
608
|
function setup_integration_env() {
|
604
|
-
|
609
|
+
echo "Decrypt server key"
|
605
610
|
openssl aes-256-cbc -d -md md5 -in assets/server.key.enc -out assets/server.key -k $SERVER_KEY_PASSWORD
|
606
611
|
ls -la assets
|
607
|
-
install_jq
|
608
|
-
install_salesforce_cli
|
612
|
+
#install_jq
|
613
|
+
#install_salesforce_cli
|
609
614
|
# Integrated test
|
610
|
-
|
611
|
-
|
612
|
-
sfdx force:auth:jwt:grant --clientid "$SF_CONSUMER_KEY" --jwtkeyfile assets/server.key --username "$SF_USERNAME" --setdefaultdevhubusername --setalias HubOrg
|
615
|
+
|
616
|
+
sfdx force:auth:jwt:grant --client-id "$SF_CONSUMER_KEY" --jwt-key-file assets/server.key --username "$SF_USERNAME" --set-default-dev-hub --alias HubOrg
|
613
617
|
}
|
614
618
|
|
615
619
|
test:
|
616
|
-
image:
|
620
|
+
image: registry.gitlab.com/iqa_public/labs/salesforce_cicd_demo:latest
|
617
621
|
script:
|
618
622
|
# Decrypt server key
|
619
623
|
- *sfdx_helpers
|
620
624
|
- setup_integration_env
|
625
|
+
#- openssl aes-256-cbc -d -md md5 -in assets/server.key.enc -out assets/server.key -k $SERVER_KEY_PASSWORD
|
626
|
+
#- ls -la assets
|
627
|
+
- gem install bundler rake
|
628
|
+
- bundle install
|
621
629
|
- bundle exec rake check_oauth # Check OAuth
|
622
630
|
- bundle exec rake leaps:create_soql_objects
|
623
631
|
- bundle exec rake leaps:create_enums
|
data/ChangeLog
CHANGED
data/leap_salesforce.gemspec
CHANGED
@@ -35,6 +35,7 @@ It reads the Metadata from Salesforce and creates the foundation for API tests.'
|
|
35
35
|
spec.add_development_dependency 'yard-doctest'
|
36
36
|
spec.add_dependency 'activerecord', '7'
|
37
37
|
spec.add_dependency 'colorize'
|
38
|
+
spec.add_dependency 'facets'
|
38
39
|
spec.add_dependency 'factory_bot'
|
39
40
|
spec.add_dependency 'faker', '>= 2.0'
|
40
41
|
spec.add_dependency 'humanize'
|
@@ -1,2 +1,2 @@
|
|
1
|
-
sfdx force:auth:jwt:grant --
|
2
|
-
sfdx force:org:display --
|
1
|
+
sfdx force:auth:jwt:grant --client-id "$SF_CONSUMER_KEY" --jwt-key-file "$JWT_FOLDER"/server.key --username "$SF_USERNAME" --set-default-dev-hub --alias HubOrg
|
2
|
+
sfdx force:org:display --target-org "$SF_USERNAME"
|
@@ -1,3 +1,3 @@
|
|
1
1
|
# Get scratch ORG logging in via jwtkeyfile
|
2
|
-
sfdx force:auth:jwt:grant --
|
3
|
-
sfdx force:org:display --
|
2
|
+
sfdx force:auth:jwt:grant --client-id "$SF_CONSUMER_KEY" --jwt-key-file "$JWT_FOLDER"/server.key --username "$SF_USERNAME" --set-default-dev-hub --alias HubOrg
|
3
|
+
sfdx force:org:display --target-org "$SCRATCH_ORG_ALIAS"
|
@@ -1,4 +1,4 @@
|
|
1
1
|
# Get scratch ORG logging in via Auth url
|
2
2
|
#echo $org_auth_url > $file
|
3
|
-
sfdx force:auth:sfdxurl:store --sfdxurlfile "$file" --
|
4
|
-
sfdx force:org:display --
|
3
|
+
sfdx force:auth:sfdxurl:store --sfdxurlfile "$file" --alias HubOrg --json
|
4
|
+
sfdx force:org:display --target-org "$SCRATCH_ORG_ALIAS"
|
@@ -4,7 +4,7 @@
|
|
4
4
|
namespace :sfdx do
|
5
5
|
def login
|
6
6
|
puts 'Note these tasks are a work in progress'
|
7
|
-
puts `sfdx force:auth:jwt:grant --
|
7
|
+
puts `sfdx force:auth:jwt:grant --client-id $SF_CONSUMER_KEY --jwt-key-file "$JWT_FOLDER"/server.key --username $SF_USERNAME --set-default-dev-hub --alias HubOrg`
|
8
8
|
end
|
9
9
|
|
10
10
|
desc 'Login with credentials'
|
@@ -13,13 +13,13 @@ namespace :sfdx do
|
|
13
13
|
desc 'Display details about user'
|
14
14
|
task :display do
|
15
15
|
login
|
16
|
-
puts `sfdx force:org:display --
|
16
|
+
puts `sfdx force:org:display --target-org samuel.garratt@brave-otter-ttxype.com`
|
17
17
|
end
|
18
18
|
|
19
19
|
desc 'Create dev environment'
|
20
20
|
task :create_dev do
|
21
21
|
login
|
22
|
-
puts `sfdx force:org:create --targetdevhubusername HubOrg --setdefaultusername --definitionfile config/project-scratch-def.json --
|
22
|
+
puts `sfdx force:org:create --targetdevhubusername HubOrg --setdefaultusername --definitionfile config/project-scratch-def.json --alias $SCRATCH_ORG_ALIAS --wait 10 --durationdays 7`
|
23
23
|
end
|
24
24
|
|
25
25
|
desc 'Open environment in browser'
|
@@ -31,6 +31,6 @@ namespace :sfdx do
|
|
31
31
|
desc 'Delete dev environment'
|
32
32
|
task :delete_dev do
|
33
33
|
login
|
34
|
-
puts `sfdx force:org:delete --
|
34
|
+
puts `sfdx force:org:delete --target-org $SCRATCH_ORG_ALIAS --noprompt`
|
35
35
|
end
|
36
36
|
end
|
data/lib/leap_salesforce.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leap_salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IQA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -137,6 +137,20 @@ dependencies:
|
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: facets
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :runtime
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: factory_bot
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|