feat: specify current_working_directory where to run your scripts from#131
feat: specify current_working_directory where to run your scripts from#131levibostian merged 5 commits intomainfrom
Conversation
The biggest reason for wanting this feature is if you want to separate your deployment scripts from your main application code. This way, you can use a package manager for dependencies and such. It's kind of like fully encapsulating your deployment scripts.
decafRunning deployments in test mode. Results will appear below. ...🟩 squash 🟩 merge method... 🚢 The next version of the project will be: 0.11.0 Learn moreLatest release: 0.10.0 Commit of latest release: 8c5744c Commits since last release: - feat: specify current_working_directory where to run your scripts from Related GitHub IssuesProblemThis is a feature that is mostly intended for people who want to separate their deployment code from their application code and be able to use dependencies, a package manager, or whatever language they want. Everything is encapsulated in a directory. SolutionThe solution is that you can change the working directory that Decaf is running from, which then allows package managers, for example, to reference their files in that directory, like the package.json or deno.json file. You do have to make sure to change your directory to go back to the parent directory where your code probably exists. But hey, at least this is a nice little feature for you. Testing
Testing the feature in this pull request by using it in our CI setup. Notes for reviewers...🟩 rebase 🟩 merge method... 🚢 The next version of the project will be: 0.11.0 Learn moreLatest release: 0.10.0 Commit of latest release: 8c5744c Commits since last release: - build: run deploy script tests separate from the main codebase tests why?
Automatically pass git repository root path to all step scripts via
to try out the changes made in commit 24ab01e to try out the changes made in commit 24ab01e The biggest reason for wanting this feature is if you want to separate your deployment scripts from your main application code. This way, you can use a package manager for dependencies and such. It's kind of like fully encapsulating your deployment scripts. |
…tory to try out the changes made in commit 24ab01e
fb66ebb to
22d6439
Compare
…in testing module (#9) [a new config option is being added to decaf](levibostian/decaf#131): current_working_directory. This is to add support for that new feature. ## Related GitHub Issues <!-- Link to any related GitHub issues that this pull request addresses or closes. --> ## Problem <!-- A clear description of the problem that this pull request is solving. --> ## Solution <!-- Describe the approach you took to solve the problem and the changes made in this pull request. --> ## Testing <!-- Choose one of the below options for how you tested the code change. Include any specific setup or instructions for testing. --> - [X] Added automated tests. - [X] Manually tested. If you check this box, provide instructions for others to test, too. I bundled the testing/mod.ts file and tested it works in the decaf PR tests. ## Notes for reviewers <!-- If there is any additional information you would like to share with the person reviewing this pull request, please provide it here. -->
Pull Request Test Coverage Report for Build 21333293329Details
💛 - Coveralls |
…does (#10) ## Related GitHub Issues <!-- Link to any related GitHub issues that this pull request addresses or closes. --> ## Problem <!-- A clear description of the problem that this pull request is solving. --> [in v0.11.0, decaf will be adding DECAF_ROOT_WORKING_DIRECTORY env variable as a convenience to accompany `current_working_directory`](levibostian/decaf#131). We need to update the SDK to also add this var in order for you to use that var in your script. ## Solution <!-- Describe the approach you took to solve the problem and the changes made in this pull request. --> Set it, just like decaf does. ## Testing <!-- Choose one of the below options for how you tested the code change. Include any specific setup or instructions for testing. --> - [X] Added automated tests. - [X] Manually tested. If you check this box, provide instructions for others to test, too. I bundled the testing module, then ran it in the decaf test suite and proved that it works. ## Notes for reviewers <!-- If there is any additional information you would like to share with the person reviewing this pull request, please provide it here. -->
Automatically pass git repository root path to all step scripts via DECAF_ROOT_WORKING_DIRECTORY environment variable. Refactored StepRunnerImpl constructor to object parameters to support this. - Step scripts can now access git root via $DECAF_ROOT_WORKING_DIRECTORY - Works seamlessly with current_working_directory configuration - Updated example scripts (deploy.ts, get-latest-release.ts) - All 285 tests passing
245c2b7 to
38eb816
Compare
why? - As a way to demonstrate the new `current_working_directory` feature where we can separate codebase and deploy scripts. - The code coverage currently includes these user scripts, but I don't think it should anymore.
Related GitHub Issues
Problem
This is a feature that is mostly intended for people who want to separate their deployment code from their application code and be able to use dependencies, a package manager, or whatever language they want. Everything is encapsulated in a directory.
Solution
The solution is that you can change the working directory that Decaf is running from, which then allows package managers, for example, to reference their files in that directory, like the package.json or deno.json file.
You do have to make sure to change your directory to go back to the parent directory where your code probably exists. But hey, at least this is a nice little feature for you.
Testing
Testing the feature in this pull request by using it in our CI setup.
Notes for reviewers