leap_salesforce 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5da0baf19ea7e71976cfeaf25f36c892ccadfb080f0753151cc8a79d17e1f0a0
4
- data.tar.gz: 2c4c357f1350fd03bb462d682b7a3f85502763a05aade8e6f60df48d029cf9f6
3
+ metadata.gz: 91e7d68b35916d600c053d7ec95f01bc26694eebf0bf176da4fa595b07506087
4
+ data.tar.gz: c3466149eaef469e70359c88c6d3ea3e125adea0f6b1bffbcdf5415699088d98
5
5
  SHA512:
6
- metadata.gz: 76e282452781f8905f96810ae8f56e2862b9df511496fe0d0bef080d0aee43691e5f6069feaf049233c995b4af08cdf13dfd765ef76df93ee1cb5df0e6e2cac4
7
- data.tar.gz: 9ddae61c0dc0cbc4e338e3fcf3bed22045a2afb9efd122c019ff08dda434d0dc9b2f476a76e81f7e329c192a6287c06de49fb19e646f20c355b1fd39ba8c01f7
6
+ metadata.gz: c6daeecb2f063de6d7b615e16c9ab2931988c74404c53f5ef7d1ab5e79f21645ddcf6587bc377204c5f13314e97e8d6c70bcaaa63188668b5837fe728e1f530d
7
+ data.tar.gz: 6afc1a7aa1b7d0574a6821adf1eb5844a91c394f96158e5f970c4f7ee67b986544c1cc42aeb0d92310399482ea8e66de672a994e6cbf5b2192690aed8ea6130a
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.0
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
- LANG: 'UTF-8'
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 --setalias $alias_to_set --json" && (echo $cmd >&2)
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 --targetusername $org_username --json" && (echo $cmd >&2)
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 --targetusername $org_username --json" && (echo $cmd >&2)
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 --targetusername $org_username --package $package_version_id --wait 10 --publishwait 10 --noprompt --json" && (echo $cmd >&2)
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 --targetusername $org_username --urlonly --json" && (echo $cmd >&2)
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 --targetusername $org_username --json" && (echo $cmd >&2)
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 --targetusername $devhub --query "SELECT SignupUsername FROM ScratchOrgInfo WHERE OrgName='$orgname'" --json)
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 --targetusername $devhub_username --where "'"SignupUsername='$scratch_org_username'"'" --json" && (echo $cmd >&2)
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
- # Decrypt server key
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
- gem install bundler rake
611
- bundle install
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: ruby:3.0
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
@@ -1,3 +1,6 @@
1
+ Version 1.3.0
2
+ * Updated sfdx commands to use new terms, not deprecated ones
3
+
1
4
  Version 1.2.2
2
5
  * Fix issue with sfdx logging in with new access token format
3
6
 
@@ -1,2 +1,2 @@
1
- sfdx force:auth:jwt:grant --clientid "$SF_CONSUMER_KEY" --jwtkeyfile "$JWT_FOLDER"/server.key --username "$SF_USERNAME" --setdefaultdevhubusername --setalias HubOrg
2
- sfdx force:org:display --targetusername "$SF_USERNAME"
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 --clientid "$SF_CONSUMER_KEY" --jwtkeyfile "$JWT_FOLDER"/server.key --username "$SF_USERNAME" --setdefaultdevhubusername --setalias HubOrg
3
- sfdx force:org:display --targetusername "$SCRATCH_ORG_ALIAS"
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" --setalias HubOrg --json
4
- sfdx force:org:display --targetusername "$SCRATCH_ORG_ALIAS"
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 --clientid $SF_CONSUMER_KEY --jwtkeyfile "$JWT_FOLDER"/server.key --username $SF_USERNAME --setdefaultdevhubusername --setalias HubOrg`
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 --targetusername samuel.garratt@brave-otter-ttxype.com`
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 --setalias $SCRATCH_ORG_ALIAS --wait 10 --durationdays 7`
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 --targetusername $SCRATCH_ORG_ALIAS --noprompt`
34
+ puts `sfdx force:org:delete --target-org $SCRATCH_ORG_ALIAS --noprompt`
35
35
  end
36
36
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '1.2.2'
5
+ VERSION = '1.3.0'
6
6
  end
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.2.2
4
+ version: 1.3.0
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: 2022-11-10 00:00:00.000000000 Z
12
+ date: 2024-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -385,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
385
  - !ruby/object:Gem::Version
386
386
  version: '0'
387
387
  requirements: []
388
- rubygems_version: 3.2.3
388
+ rubygems_version: 3.5.3
389
389
  signing_key:
390
390
  specification_version: 4
391
391
  summary: Helps with setting up integrated automated test frameworks against Salesforce.