Closed gabeclarke closed 6 months ago
@gabeclarke > The packages that will be installed are in config/.sfdx-hardis.yml , in installedPackages property, as in the following example
You can automatically fill this property by using the following command in VsCode sfdx-hardis menu (with your org where packages are installe as the default org)
About duration, it is defined with the following line
this.scratchOrgDuration = (process.env.SCRATCH_ORG_DURATION || isCI) && this.pool === false ? 1 : 30;
It means that you can override it by defining an env variable SCRATCH_ORG_DURATION=10 for example
Maybe it would be easier to override if we can define it in .sfdx-hardis.yml ? If so I can make a PR, or you can even do it if you are in a hurry :) ( i'll provide guidance)
Thanks so much for the fast response! I think I was a bit too rushed with my word choice in my initial question.
After the packages identified in config/.sfdx-hardis.yml are installed, I believe there is a follow up step called Push Sources. Where does hardis:scratch:create determine these sources to push? Does it try to deploy everything from the devhub to the scratch org, or everything in my current branch? I'm probably missing something obvious there but appreciate any guidance you can give!
On the topic of scratch org duration, I would love to submit a PR for it as an env variable. I think this is something my team will tweak frequently when we spin up scratch org pools so we will definitely get value out of it.
@gabeclarke it's exactly the same than when you call sfdx force:source:push from your local computer: it will push
If you are reusing a scratch org (after a PR for example), it will push only the diff since your last push :)
Note: equivalent of sfdx force:source:push with SF CLI v2 seems to be sf project deploy start --target-org myscratch --ignore-conflicts --wait 10
@gabeclarke your PR has been released in 4.28.4 :)
Please can you confirm it's ok with scratchOrgDuration in .sfdx-hardis.yml ? :)
Yes thanks, I can confirm the variable works as expected!
Hi, first- love the work you have done! It's amazing how much simpler this makes standing up a ci/cd pipeline.
I did have a question or two, on this page https://sfdx-hardis.cloudity.com/hardis/scratch/create/
when running the hardis:scratch:create command (or through the UI) during the "push sources" step, how do you determine what package to attempt to deploy to the scratch org? It does not appear to be based on the package.xml in the branch at time of scratch org creation. Is it based on some variable in .sfdx-hardis.yml?
In addition, is there a way to manipulate the expiry date for the scratch org running this command (or through the UI)? I have tried setting the variable in the project-scratch json but the hardis:scratch:create command does not seem to take it into account and defaults to 30 days each time.
Thanks!