Apply suggestions from code review

This commit is contained in:
Ethan Dennis
2022-09-20 11:35:13 -07:00
committed by GitHub
parent 2d053bd967
commit 581b03c24a
4 changed files with 27 additions and 11 deletions
+8 -1
View File
@@ -27,7 +27,14 @@ Answer the following questions before running the `forecast` command:
3. The command will list all the files written to disk when the command succeeds.
![command-output](https://user-images.githubusercontent.com/19557880/190510549-e2d4eacd-2d3f-4778-8cf5-f5187f78350a.png)
```console
$ gh valet forecast travis-ci --output-dir tmp/forecast --start-date 2022-09-02
[2022-08-20 22:08:20] Logs: 'tmp/forecast/log/valet-20220916-021004.log'
[2022-08-20 22:08:20] Forecasting 'http://travis-ci.com/valet-labs'
[2022-08-20 22:08:20] Output file(s):
[2022-08-20 22:08:20] tmp/forecast/jobs/09-16-2022-02-10_jobs_0.json
[2022-08-20 22:08:20] tmp/forecast/forecast_report.md
```
## Review the forecast report
+6 -1
View File
@@ -29,7 +29,12 @@ You will be performing a dry-run against a TravisCI project. Answer the followin
3. The command will list all the files written to disk when the command succeeds.
![command-result](https://user-images.githubusercontent.com/19557880/190724470-2936443e-d2f2-41f8-8470-28e313111036.png)
```console
$ gh valet dry-run travis-ci --travis-ci-repository "travisci-ruby-example" --output-dir tmp/dry-run
[2022-09-19 19:46:03] Logs: 'tmp/dry-run/log/valet-20220919-194603.log'
[2022-09-19 19:46:05] Output file(s):
[2022-09-19 19:46:05] tmp/dry-run/valet-labs/travisci-ruby-example.yml
```
4. View the converted workflow:
- Find `tmp/dry-run` in the file explorer pane in your codespace.
+8 -8
View File
@@ -98,7 +98,7 @@ The converted workflow above contains an `codedeploy` step that was not automati
Now you can begin to write the custom transformer. Custom transformers use a DSL built on top of Ruby and should be defined in a file with the `.rb` file extension. You can create this file by running the following command in your codespace terminal:
```bash
code transformers.rb
touch transformers.rb && code transformers.rb
```
Next, you will define a `transform` method for the `codedeploy` identifier by adding the following code to `transformers.rb`:
@@ -107,15 +107,15 @@ Next, you will define a `transform` method for the `codedeploy` identifier by ad
transform "codedeploy" do |_item|
[
{
"uses": "aws-actions/configure-aws-credentials@v1",
"with": {
"role-to-assume": "owner",
"role-session-name": "GitHub-Action-Role",
"aws-region": "east-2"
"uses" => "aws-actions/configure-aws-credentials@v1",
"with" => {
"role-to-assume" => "owner",
"role-session-name" => "GitHub-Action-Role",
"aws-region" => "east-2"
}
},
{
"run": "echo \"Deploying branch ${{ env.GITHUB_REF }} to ${{ github.event.inputs.environment }}\"\ncommit_hash=`git rev-parse HEAD`\naws deploy create-deployment --application-name MyApp --deployment-group-name MyDeploymentGroup --github-location repository=$GITHUB_REPOSITORY,commitId=$commit_hash --ignore-application-stop-failures\n"
"run" => "echo \"Deploying branch ${{ env.GITHUB_REF }} to ${{ github.event.inputs.environment }}\"\ncommit_hash=`git rev-parse HEAD`\naws deploy create-deployment --application-name MyApp --deployment-group-name MyDeploymentGroup --github-location repository=$GITHUB_REPOSITORY,commitId=$commit_hash --ignore-application-stop-failures\n"
}
]
end
@@ -241,7 +241,7 @@ That's it! Congratulations, you have overridden Valet's default behavior by cust
- Unknown steps
- Environment variables
- Runner
- Runners
## Next lab
+5 -1
View File
@@ -30,7 +30,11 @@ Answer the following questions before running a `migrate` command:
2. The command will write the URL to the pull request that was created when the command succeeds.
![pr](https://user-images.githubusercontent.com/19557880/190726057-f90d31ed-69cc-457b-aab7-3ca21e16df68.png)
```console
$ gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir tmp/migrate --travis-ci-repository "travisci-deploy-example"
[2022-08-20 22:08:20] Logs: 'tmp/migrate/log/valet-20220916-014033.log'
[2022-08-20 22:08:20] Pull request: 'https://github.com/:owner/:repo/pull/1'
```
3. Open the generated pull request in a new browser tab.