forcedotcom / sfdx-travisci Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
When i run the following from the command line on my workstation with failing tests in place...
sfdx force:apex:test:run --wait 10
And echo the return code i see the following...
echo $?
100
However when i run the same command (all be it with an alias arg) in Travis it returns 0?
Is there something contextual about the commands return code?
You can see my project at https://github.com/afawcett/declarative-lookup-rollup-summaries
I've been trying to login from Travis using the sfdx force:auth:sfdxurl:store
command instead. However, when comes the time to spin-up a scratchorg, I am getting that error message:
ERROR running force:org:create: The callback URL provided is not valid.
Any clue what can cause this / how it can be resolved?
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/tools/github.rb:212:in `rescue in basic_auth'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/tools/github.rb:208:in `basic_auth'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/tools/github.rb:216:in `login'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/tools/github.rb:81:in `possible_tokens'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/tools/github.rb:50:in `each_token'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/tools/github.rb:37:in `with_token'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/cli/login.rb:31:in `login'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/cli/login.rb:40:in `run'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/cli/command.rb:198:in `execute'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/lib/travis/cli.rb:64:in `run'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/travis-1.8.13/bin/travis:18:in `<top (required)>'
from C:/Ruby26-x64/bin/travis:23:in `load'
from C:/Ruby26-x64/bin/travis:23:in `<main>'
Hi all,
I am currently encountering the following issue with the following line of the yml.
Error: "xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now"
Line: "$ wget -qO- $URL | tar xJ -C sfdx --strip-components 1" when referencing the following variable
env:
matrix:
- URL=https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
Guessing its an issue with what I am doing and not the script itself. Thanks.
I have been verifying the Travis CI aligned with the Trailhead module "Continuous Integration Using Salesforce DX"
https://trailhead.salesforce.com/en/content/learn/modules/sfdx_travis_ci
script:
However at the last line, deleting Scratch Org failed with following message.
Please let me know the correct way or any other workaround.
Best regards,
Im getting
NoMethodError: undefined method `each_pair'
while running the below command
travis env set CONSUMERKEY <your_consumer_key> travis env set USERNAME <your_username>
I'm able to use force:auth:jwt:grant locally and successfully log in to my org with the server.key file. However, when the build in travis-ci kicks off, i get this error:
ERROR running force:auth:jwt:grant: We encountered a JSON web token error, which is likely not an issue with Salesforce CLI. Here’s the error: error:0906D06C:PEM routines:PEM_read_bio:no start line
Not sure how to troubleshoot this one
Now it is
{ "orgName": "wade.wegner Example", "edition": "Developer", "settings": { "lightningExperienceSettings": { "enableS1DesktopEnabled": true } }
it should be
{ "orgName": "wade.wegner Example", "edition": "Developer", "settings": { "lightningExperienceSettings": { "enableS1DesktopEnabled": true } } }
Found the Trailhead Travis build was failing due to the use of --wait flags in the YAML file, removal of these flags resulted in successful runs
I thought I might drop this reference in the existing (and closed) issue #57 but not sure if this is due to some recent change on Salesforce's side?
Running the existing script with --wait 2
resulted in (from Travis logs):
$ sfdx force:org:create -v HubOrg -s -f config/project-scratch-def.json -a ciorg --wait 2
ERROR: Invalid value was specified for wait. Please provide a wait value greater than 3 minutes.
The command "sfdx force:org:create -v HubOrg -s -f config/project-scratch-def.json -a ciorg --wait 2" exited with 1.
I literally just changed the value to 4, committed and pushed and the build went thru fine.
I'm new to both Salesforce and CI; Not sure if it's a temporary thing?
As per the discussion on StackExchange I am still finding org creation hangs. I updated with the latest .yaml edits made to this repo and still had no luck. Is this build still working? I also see some comments from Travis support on the SE post above.
Finally i used the option described in the StackExchange post, while this works i do see a number of npm obsolete errors so would prefer to use the recommended approach from this repo.
My repository is https://github.com/afawcett/declarative-lookup-rollup-summaries. Note that the yaml also includes some changes to attempt to get test failures to abort the build. These edits in the script section where made afterward.
the log like this:
$ openssl aes-256-cbc -K $encrypted_79a2f6093848_key -iv $encrypted_79a2f6093848_iv -in assets/server.key.enc -out assets/server.key -d
bad decrypt
140707428578968:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:evp_enc.c:518:
The command "openssl aes-256-cbc -K $encrypted_79a2f6093848_key -iv $encrypted_79a2f6093848_iv -in assets/server.key.enc -out assets/server.key -d" failed and exited with 1 during .
Your build has been stopped.
log.txt
Found this issue while running the trailhead this repository is used for. The ./config/project-scratch-de.json
-file contains setting that are depreciated in sfdx. As recommended in the log (which can be found in the Travis CI build section), the parameter orgPreferences
:
{
"orgName": "wade.wegner Example",
"edition": "Developer",
"orgPreferences" : {
"enabled": ["S1DesktopEnabled"]
}
}
must be changed with settings
according to the following:
{
"orgName": "wade.wegner Example",
"edition": "Developer",
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
}
}
}
Have seen the warning about the depreciated parameter for scratch org configs in the interactive exercises within the SFDX trailhead lessons already, but the build on travis-ci probably handles the parameter more restricted.
I've been struggling a lot trying to complete this trailhead module. The first issue was while trying to log in with GitHub creds, which I solved using the GitHub-token flag.
Now, after I Kick-off Continuous Integration, it keeps failing over and over again.
The exception is iv undefined, which is no longer happening, not sure how it got fixed. And this
iv undefined
the last exception has become a real blocker. I can't figure out how to work around this.
Config File:
os: linux
dist: xenial
language: ruby
rvm:
- 2.0.0
cache: false
env:
- URL=https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
before_install:
- openssl aes-256-cbc -K $encrypted_79bf14636734_key -iv $encrypted_79bf14636734_iv
-in assets/certs/server.key.enc -out assets/certs/server.key -d
- 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
- 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 --jwtkeyfile assets/server.key --username $USERNAME --setdefaultdevhubusername -a HubOrg
script:
- sfdx force:org:create -v HubOrg -s -f config/project-scratch-def.json -a ciorg --wait 3
- 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
I'm not sure what else to look at or do to make this work.
I'm trying to create a standard development pipeline, which is important to implement CI/CD.
Workstation settings:
Ruby version: 2.7.2
Travis version: 1.10.0
SFDX-cli version: 7.85.1
Already tested in Windows (local station) and AWS Ubuntu server, same results.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.