From 767fdd326d0b243f4298e0ec67ec338239a96eed Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 7 Sep 2022 10:15:33 -0700 Subject: [PATCH 01/39] Create readme.md --- travis/readme.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 travis/readme.md diff --git a/travis/readme.md b/travis/readme.md new file mode 100644 index 0000000..e27e59d --- /dev/null +++ b/travis/readme.md @@ -0,0 +1,73 @@ +# Travis CI to Actions migrations powered by Valet + +The instructions below will guide you through configuring a GitHub Codespace environment that will be used in subsequent labs that demonstrate how to use Valet to migrate Travis CI pipelines to GitHub Actions. + +These steps **must** be completed prior to starting other labs. + +## Create your own repository for these labs + +1. Ensure that you have created a repository using the [valet-customers/labs](https://github.com/valet-customers/labs) as a template. + +## Configure your Codespace + +1. Start a new Codespace. + +- Click the `Code` with button down arrow above repository on the repository's landing page. +- Click the `Codespaces` tab +- Click `Create codespaces on main` to create the codespace. +- After the Codespace has initialized there will be a terminal present. + +2. Verify the Valet CLI is installed and working. More information on the Valet extension for the official GitHub CLI can be found [here](https://github.com/github/gh-valet). + +- Run the following command in the codespace's terminal: + + ```bash + gh valet version + ``` + +- Verify the output is similar to below. The version information may differ than what is shown below, it is expected that the `valet-cli` version is unknown. This will be corrected in the [configure credentials for Valet](1-configure.md) lab. + + ```bash + gh version 2.14.3 (2022-07-26) + gh valet github/gh-valet v0.1.12 + valet-cli unknown + ``` + + - If `gh valet version` did not produce similar output then please follow the troubleshooting [guide](#troubleshoot-the-valet-cli). + +## Labs for Travis CI + +Perform the following labs to test-drive Valet + +1. [Configure credentials for Valet](1-configure.md) +2. [Perform an audit of Travis CI](2-audit.md) +3. [Perform a dry-run of a Travis CI pipeline](3-dry-run.md) +4. [Use custom transformers to customize Valet's behavior](4-custom-transformers.md) +5. [Perform a production migration of a Travis CI pipeline](5-migrate.md) +6. [Forecast potential build runner usage](6-forecast.md) + +## Troubleshoot the Valet CLI + +The CLI extension for Valet can be manually installed by following these steps: + +- Verify you are in the codespace terminal +- Run this command from within the codespace's terminal: + + ```bash + gh extension install github/gh-valet + ``` + +- Verify the result of the install contains: + + ```bash + βœ“ Installed extension github/gh-valet + ``` + +- If you get an error similar to the image below, then click the link in the terminal output to authorize the token. + - Restart the codespace after clicking the link. + ![img](https://user-images.githubusercontent.com/26442605/169588015-9414404f-82b6-4d0f-89d4-5f0e6941b029.png) +- Verify Valet CLI extension is installed and working by running the following command from the codespace's terminal: + + ```bash + gh valet version + ``` From 42a41c57c92365b49f1b0bcedca6f48c9963c0c6 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Thu, 8 Sep 2022 08:07:44 -0700 Subject: [PATCH 02/39] Create 1-configure.md --- travis/1-configure.md | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 travis/1-configure.md diff --git a/travis/1-configure.md b/travis/1-configure.md new file mode 100644 index 0000000..5ce59d5 --- /dev/null +++ b/travis/1-configure.md @@ -0,0 +1,62 @@ +# Configure credentials for Valet + +In this lab, you will use the `configure` CLI command to set the required credentials and information for Valet to use when working with Travis CI and GitHub. + +You will need to complete all of the setup instructions [here](./readme.md#configure-your-codespace) prior to performing this lab. + +## Configuring credentials + +1. Create a GitHub Personal Access Token (PAT): + - Open github.com in a new browser tab. + - Click your profile photo in the top right of the UI and click `Settings`. + - Click on `Developer Settings` in the left hand panel. + - Click `Personal Access Tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Legacy tokens`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `read:packages` and `workflow`. + - Click `Generate token`. + - Copy the generated PAT and save in a safe location. + +3. Create a Travis CI PAT: + - Log into your Traivs Instance. + - Click on your profile icon in the top right hand corner. You should see a dropdown menu. + - Click on the 'Settings' tab. + - Click on the 'COPY TOKEN' button under the API authentication header and save in a safe location. + +2. Run the `configure` CLI command: + - Select the `TERMINAL` tab from within the codespace terminal window. + - Run the following command: `gh valet configure`. + - Using the down arrow key to highlight `Travis CI`, press the spacebar to select, and then hit enter to continue. + - At the prompt enter your GitHub Username and press enter. + - At the GitHub Container Registry prompt enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub PAT prompt enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default value (`https://github.com`). + - At the Travis CI token prompt enter the Travis CI access token from step 2 and press enter. + - At the Travis CI base url prompt hit enter to accept the default value (`https://Travis CI.com`). + - At the access token to fetch source code in GitHub prompt enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub instance url containing source code prompt press enter to accept the default value (`https://github.com`). + + ![configure-cli-terminal](https://user-images.githubusercontent.com/19557880/189158118-833e46c3-b3f5-49e8-8f20-63d1607b0d8c.png) + +## Verify your environment + +To verify our environment is configured correctly, we are going to run the `update` CLI command. The `update` CLI command will download the latest version of Valet to your codespace. + +1. In the codespace terminal run the following command: + + ```bash + gh valet update + ``` + +2. You should see a confirmation that you were logged into the GitHub Container Registry and Valet was updated to the latest version. + + ```bash + Login Succeeded + latest: Pulling from valet-customers/valet-cli + Digest: sha256:a7d00dee8a37e25da59daeed44b1543f476b00fa2c41c47f48deeaf34a215bbb + Status: Image is up to date for ghcr.io/valet-customers/valet-cli:latest + ghcr.io/valet-customers/valet-cli:latest + ``` + +### Next lab + +[Perform an audit of Travis CI](./2-audit.md) From 474e1dd22fb58791ccd0ce72afaaeaca9f72fd31 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 9 Sep 2022 07:42:58 -0700 Subject: [PATCH 03/39] Update travis/1-configure.md Co-authored-by: j-dunham --- travis/1-configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 5ce59d5..4102f93 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -17,7 +17,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - Copy the generated PAT and save in a safe location. 3. Create a Travis CI PAT: - - Log into your Traivs Instance. + - Log into your Travis CI Instance. - Click on your profile icon in the top right hand corner. You should see a dropdown menu. - Click on the 'Settings' tab. - Click on the 'COPY TOKEN' button under the API authentication header and save in a safe location. From f9e6f239c788484d4772d16bca1d18696f4fed60 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 9 Sep 2022 07:46:56 -0700 Subject: [PATCH 04/39] Update travis/1-configure.md --- travis/1-configure.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 4102f93..8c5dcea 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -31,7 +31,8 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - At the GitHub PAT prompt enter the GitHub PAT generated in step 1 and press enter. - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default value (`https://github.com`). - At the Travis CI token prompt enter the Travis CI access token from step 2 and press enter. - - At the Travis CI base url prompt hit enter to accept the default value (`https://Travis CI.com`). + - At the Travis CI base url prompt hit enter to accept the default value (`https://travis-ci.com`). + - At the Travis CI organization name enter `valet-travis-labs`. - At the access token to fetch source code in GitHub prompt enter the GitHub PAT generated in step 1 and press enter. - At the GitHub instance url containing source code prompt press enter to accept the default value (`https://github.com`). From d6a21442160d6ed90e241d914f08c94d90a2aede Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Tue, 13 Sep 2022 16:39:20 -0700 Subject: [PATCH 05/39] Update travis/1-configure.md Co-authored-by: Ethan Dennis --- travis/1-configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 8c5dcea..db2bf40 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -17,7 +17,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - Copy the generated PAT and save in a safe location. 3. Create a Travis CI PAT: - - Log into your Travis CI Instance. + - Open Travis CI in a new browser tab. - Click on your profile icon in the top right hand corner. You should see a dropdown menu. - Click on the 'Settings' tab. - Click on the 'COPY TOKEN' button under the API authentication header and save in a safe location. From 603af0f056f3351d9fcc16c02115b7510a160aa6 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Tue, 13 Sep 2022 16:39:31 -0700 Subject: [PATCH 06/39] Update travis/1-configure.md Co-authored-by: Ethan Dennis --- travis/1-configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index db2bf40..ae61fd2 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -18,7 +18,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi 3. Create a Travis CI PAT: - Open Travis CI in a new browser tab. - - Click on your profile icon in the top right hand corner. You should see a dropdown menu. + - Click on your profile icon in the top right hand corner to reveal a dropdown menu. - Click on the 'Settings' tab. - Click on the 'COPY TOKEN' button under the API authentication header and save in a safe location. From 9a4c81c71385923b1572c34e0f4caf72340dddc9 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Tue, 13 Sep 2022 16:39:36 -0700 Subject: [PATCH 07/39] Update travis/1-configure.md Co-authored-by: Ethan Dennis --- travis/1-configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index ae61fd2..6410274 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -20,7 +20,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - Open Travis CI in a new browser tab. - Click on your profile icon in the top right hand corner to reveal a dropdown menu. - Click on the 'Settings' tab. - - Click on the 'COPY TOKEN' button under the API authentication header and save in a safe location. + - Click on the 'COPY TOKEN' button under "API authentication header" and save in a safe location. 2. Run the `configure` CLI command: - Select the `TERMINAL` tab from within the codespace terminal window. From 500d85465e397dac89a14f81aa514f9745b40a41 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 14 Sep 2022 10:55:52 -0700 Subject: [PATCH 08/39] Create 3-dry-run.md --- travis/3-dry-run.md | 189 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 travis/3-dry-run.md diff --git a/travis/3-dry-run.md b/travis/3-dry-run.md new file mode 100644 index 0000000..662ecc6 --- /dev/null +++ b/travis/3-dry-run.md @@ -0,0 +1,189 @@ +# Perform a dry-run of a CircleCI pipeline + +In this lab you will use the `dry-run` command to convert a CircleCI pipeline to its equivalent GitHub Actions workflow. + +## Prerequisites + +1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your Codespace environment. +2. Completed the [configure lab](./1-configure.md#configuring-credentials). +3. Completed the [audit lab](./2-audit.md). + +## Perform a dry run + +You will be performing a dry-run against a CircleCI project. Answer the following questions before running this command: + +1. What project do you want to convert? + - __circleci-demo-ruby-rails__. This is one of the sample projects avaiable in the CircleCI labs-data organization. + +2. Where do you want to store the result? + - __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from. + +### Steps + +1. Navigate to your codespace terminal +2. Run the following command from the root directory: + + ```bash + gh valet dry-run circle-ci --output-dir ./tmp/dry-run-lab --circle-ci-project circleci-demo-ruby-rails + ``` + +3. The command will list all the files written to disk when the command succeeds. + + ![command-result](https://user-images.githubusercontent.com/18723510/189911131-bf6bfd6f-2b5e-4e49-8d14-95ef9c312117.png) + + + +4. View the converted workflow: + - Find `./tmp/dry-run-lab/labs-data/circleci-demo-ruby-rails` in the file explorer pane in your codespace. + - Click `build_and_test.yml` to open. + +## Inspect the output files + +The files generated from the `dry-run` command represent the equivalent Actions workflow for the CircleCI project. The CircleCI configuration and converted workflow can be seen below: + +
+ CircleCI configuration πŸ‘‡ + +```yaml +version: 2.1 +orbs: + ruby: circleci/ruby@1.1.0 + node: circleci/node@2 +jobs: + build: + docker: + - image: cimg/ruby:2.7.5-node + steps: + - checkout + - ruby/install-deps + # Store bundle cache + - node/install-packages: + pkg-manager: yarn + cache-key: "yarn.lock" + test: + parallelism: 3 + docker: + - image: cimg/ruby:2.7.5-node + - image: circleci/postgres:9.5-alpine + environment: + POSTGRES_USER: circleci-demo-ruby + POSTGRES_DB: rails_blog_test + POSTGRES_PASSWORD: "" + environment: + BUNDLE_JOBS: "3" + BUNDLE_RETRY: "3" + PGHOST: 127.0.0.1 + PGUSER: circleci-demo-ruby + PGPASSWORD: "" + RAILS_ENV: test + steps: + - checkout + - ruby/install-deps + - node/install-packages: + pkg-manager: yarn + cache-key: "yarn.lock" + - run: + name: Wait for DB + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - run: + name: Database setup + command: bundle exec rails db:schema:load --trace + # Run rspec in parallel + - ruby/rspec-test + - ruby/rubocop-check +workflows: + version: 2 + build_and_test: + jobs: + - build + - test: + requires: + - build +``` + +
+ +
+ Converted workflow πŸ‘‡ + +```yaml +name: labs-data/circleci-demo-ruby-rails/build_and_test +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + container: + image: cimg/ruby:2.7.5-node + steps: + - name: Set up bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.2 + bundler-cache: true + - uses: actions/checkout@v2 + - run: bundle check || bundle install + env: + BUNDLE_DEPLOYMENT: true + - id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 + with: + path: "${{ steps.yarn-cache-dir-path.outputs.dir }}" + key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}" + restore-keys: "${{ runner.os }}-yarn-" + - run: yarn install --frozen-lockfile + test: + runs-on: ubuntu-latest + container: + image: cimg/ruby:2.7.5-node + services: + postgres: + image: postgres:9.5-alpine + env: + POSTGRES_USER: circleci-demo-ruby + POSTGRES_DB: rails_blog_test + POSTGRES_PASSWORD: '' + needs: + - build + env: + BUNDLE_JOBS: '3' + BUNDLE_RETRY: '3' + PGHOST: 127.0.0.1 + PGUSER: circleci-demo-ruby + PGPASSWORD: '' + RAILS_ENV: test + steps: + - name: Set up bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.2 + bundler-cache: true + - uses: actions/checkout@v2 + - run: bundle check || bundle install + env: + BUNDLE_DEPLOYMENT: true + - id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 + with: + path: "${{ steps.yarn-cache-dir-path.outputs.dir }}" + key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}" + restore-keys: "${{ runner.os }}-yarn-" + - run: yarn install --frozen-lockfile + - name: Wait for DB + run: dockerize -wait tcp://localhost:5432 -timeout 1m + - name: Database setup + run: bundle exec rails db:schema:load --trace + - run: bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec/results.xml --format progress + - run: bundle exec rubocop --format progress +``` +
+ +Despite these two pipelines using different syntax they will function equivalently. + +## Next lab + +[Use custom transformers to customize Valet's behavior](./4-custom-transformers.md) From 670b62c3ea0159590d07078e405993d050a393f8 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 14 Sep 2022 14:01:38 -0700 Subject: [PATCH 09/39] Travis Dry-run lab --- travis/3-dry-run.md | 211 +++++++++++++++----------------------------- 1 file changed, 71 insertions(+), 140 deletions(-) diff --git a/travis/3-dry-run.md b/travis/3-dry-run.md index 662ecc6..f0a3d87 100644 --- a/travis/3-dry-run.md +++ b/travis/3-dry-run.md @@ -1,6 +1,6 @@ -# Perform a dry-run of a CircleCI pipeline +# Perform a dry-run of a TravisCI pipeline -In this lab you will use the `dry-run` command to convert a CircleCI pipeline to its equivalent GitHub Actions workflow. +In this lab you will use the `dry-run` command to convert a TravisCI pipeline to its equivalent GitHub Actions workflow. ## Prerequisites @@ -10,95 +10,56 @@ In this lab you will use the `dry-run` command to convert a CircleCI pipeline to ## Perform a dry run -You will be performing a dry-run against a CircleCI project. Answer the following questions before running this command: +You will be performing a dry-run against a TravisCI project. Answer the following questions before running this command: -1. What project do you want to convert? - - __circleci-demo-ruby-rails__. This is one of the sample projects avaiable in the CircleCI labs-data organization. +1. What pipeline do you want to convert? + - __ruby-example__. This is one of the sample projects avaiable in the TravisCI labs-data organization. 2. Where do you want to store the result? - __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from. ### Steps -1. Navigate to your codespace terminal +1. Navigate to your codespace terminal. 2. Run the following command from the root directory: ```bash - gh valet dry-run circle-ci --output-dir ./tmp/dry-run-lab --circle-ci-project circleci-demo-ruby-rails + gh valet dry-run travis-ci --travis-ci-repository "ruby-example" --output-dir tmp/travis/dry-run-lab ``` 3. The command will list all the files written to disk when the command succeeds. - ![command-result](https://user-images.githubusercontent.com/18723510/189911131-bf6bfd6f-2b5e-4e49-8d14-95ef9c312117.png) - - + ![command-result](https://user-images.githubusercontent.com/19557880/190260513-87bae04f-2ff2-4539-b4e5-1e68eba3cf2c.png) 4. View the converted workflow: - - Find `./tmp/dry-run-lab/labs-data/circleci-demo-ruby-rails` in the file explorer pane in your codespace. - - Click `build_and_test.yml` to open. + - Find `./tmp/travis/dry-run-lab` in the file explorer pane in your codespace. + - Click `ruby-example.yml` to open. ## Inspect the output files -The files generated from the `dry-run` command represent the equivalent Actions workflow for the CircleCI project. The CircleCI configuration and converted workflow can be seen below: +The files generated from the `dry-run` command represent the equivalent Actions workflow for the TravisCI project. The TravisCI configuration and converted workflow can be seen below:
- CircleCI configuration πŸ‘‡ + TravisCI configuration πŸ‘‡ ```yaml -version: 2.1 -orbs: - ruby: circleci/ruby@1.1.0 - node: circleci/node@2 -jobs: - build: - docker: - - image: cimg/ruby:2.7.5-node - steps: - - checkout - - ruby/install-deps - # Store bundle cache - - node/install-packages: - pkg-manager: yarn - cache-key: "yarn.lock" - test: - parallelism: 3 - docker: - - image: cimg/ruby:2.7.5-node - - image: circleci/postgres:9.5-alpine - environment: - POSTGRES_USER: circleci-demo-ruby - POSTGRES_DB: rails_blog_test - POSTGRES_PASSWORD: "" - environment: - BUNDLE_JOBS: "3" - BUNDLE_RETRY: "3" - PGHOST: 127.0.0.1 - PGUSER: circleci-demo-ruby - PGPASSWORD: "" - RAILS_ENV: test - steps: - - checkout - - ruby/install-deps - - node/install-packages: - pkg-manager: yarn - cache-key: "yarn.lock" - - run: - name: Wait for DB - command: dockerize -wait tcp://localhost:5432 -timeout 1m - - run: - name: Database setup - command: bundle exec rails db:schema:load --trace - # Run rspec in parallel - - ruby/rspec-test - - ruby/rubocop-check -workflows: - version: 2 - build_and_test: - jobs: - - build - - test: - requires: - - build + language: ruby + sudo: false + dist: trusty + rvm: + - 1.9.3 + - 2.0.0 + - 2.1.0 + + install: + - gem install bundler + + script: + - echo "hello!" + + jobs: + include: + - script: echo "child" ```
@@ -107,79 +68,49 @@ workflows: Converted workflow πŸ‘‡ ```yaml -name: labs-data/circleci-demo-ruby-rails/build_and_test -on: - push: - branches: - - master -jobs: - build: - runs-on: ubuntu-latest - container: - image: cimg/ruby:2.7.5-node - steps: - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0.2 - bundler-cache: true - - uses: actions/checkout@v2 - - run: bundle check || bundle install - env: - BUNDLE_DEPLOYMENT: true - - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v2 - with: - path: "${{ steps.yarn-cache-dir-path.outputs.dir }}" - key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}" - restore-keys: "${{ runner.os }}-yarn-" - - run: yarn install --frozen-lockfile - test: - runs-on: ubuntu-latest - container: - image: cimg/ruby:2.7.5-node - services: - postgres: - image: postgres:9.5-alpine - env: - POSTGRES_USER: circleci-demo-ruby - POSTGRES_DB: rails_blog_test - POSTGRES_PASSWORD: '' - needs: - - build - env: - BUNDLE_JOBS: '3' - BUNDLE_RETRY: '3' - PGHOST: 127.0.0.1 - PGUSER: circleci-demo-ruby - PGPASSWORD: '' - RAILS_ENV: test - steps: - - name: Set up bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0.2 - bundler-cache: true - - uses: actions/checkout@v2 - - run: bundle check || bundle install - env: - BUNDLE_DEPLOYMENT: true - - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v2 - with: - path: "${{ steps.yarn-cache-dir-path.outputs.dir }}" - key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}" - restore-keys: "${{ runner.os }}-yarn-" - - run: yarn install --frozen-lockfile - - name: Wait for DB - run: dockerize -wait tcp://localhost:5432 -timeout 1m - - name: Database setup - run: bundle exec rails db:schema:load --trace - - run: bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec/results.xml --format progress - - run: bundle exec rubocop --format progress + name: valet-travis-labs/ruby-example + on: + push: + branches: + - "**/*" + pull_request: + concurrency: + # # This item has no matching transformer + # maximum_number_of_builds: 0 + jobs: + test: + runs-on: # this agent type is not supported: [[{"dist"=>"trusty"}]] + ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.rvm }}" + # # 'sudo' was not transformed because there is no suitable equivalent in GitHub Actions + - run: gem install bundler + - run: echo "hello!" + strategy: + matrix: + rvm: + - 1.9.3 + - 2.0.0 + - 2.1.0 + test_2: + runs-on: # this agent type is not supported: [[{"dist"=>"trusty"}]] + ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 1.9.3 + # # 'sudo' was not transformed because there is no suitable equivalent in GitHub Actions + - run: gem install bundler + - run: echo "child" + ``` + Despite these two pipelines using different syntax they will function equivalently. From fd7327b8d6fbea01a4a5bf703b379e79c2d29e4c Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Thu, 15 Sep 2022 10:45:52 -0700 Subject: [PATCH 10/39] Added custom trasnformer lab --- travis/4-custom-transformers.md | 248 ++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 travis/4-custom-transformers.md diff --git a/travis/4-custom-transformers.md b/travis/4-custom-transformers.md new file mode 100644 index 0000000..2847887 --- /dev/null +++ b/travis/4-custom-transformers.md @@ -0,0 +1,248 @@ +# Using custom transformers to customize Valet's behavior + +In this lab you will build upon the `dry-run` command to override Valet's default behavior and customize the converted workflow using "custom transformers". Custom transformers can be used to: + +1. Convert items that are not automatically converted. +2. Convert items that were automatically converted using different actions. +3. Convert environment variable values differently. +4. Convert references to runners to use a different runner name in Actions. + +## Prerequisites + +1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment. +2. Completed the [configure lab](./1-configure.md#configuring-credentials). +3. Completed the [dry-run lab](./3-dry-run.md). + +## Perform a dry-run + +You will be performing a `dry-run` command to inspect the workflow that is converted by default. Run the following command within the codespace terminal: + +```bash + gh valet dry-run travis-ci --travis-ci-repository "deploy-example" --output-dir tmp/travis/dry-run +``` + +The converted workflow that is generated by the above command can be seen below: + +
+ Converted workflow πŸ‘‡ + +```yaml + name: valet-travis-labs/deploy-example + on: + push: + branches: + - "**/*" + pull_request: + concurrency: + # # This item has no matching transformer + # maximum_number_of_builds: 0 + env: + DB: mysql + jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - run: gem install bundler + - run: bundle install --jobs=3 --retry=3 + - run: rake + - run: echo 'ready?' + # # This item has no matching transformer + # - codedeploy: + # provider: codedeploy + # access_key_id: YOUR AWS ACCESS KEY + # secret_access_key: YOUR AWS SECRET KEY + # bucket: S3 Bucket + # key: latest/MyApp.zip + # application: MyApp + # deployment_group: MyDeploymentGroup + # if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}" + - run: "./after_deploy_1.sh" + - run: "./after_deploy_2.sh" + - uses: desiderati/github-action-pushover@v1 + with: + job-status: "${{ job.status }}" + pushover-api-token: '12345' + pushover-user-key: "${{ secrets.PUSHOVER_USER_KEY }}" + if: "${{ github.event_name != 'pull_request' }}" + +``` + +
+ +_Note_: You can refer to the previous [lab](./3-dry-run.md) to learn about the fundamentals of the `dry-run` command. + +## Custom transformers for an unknown step + +The converted workflow above contains an `codedeploy` step that was not automatically converted. Answer the following questions before writing a custom transformer: + +1. What is the "identifier" of the step to customize? + - __codedeploy__ + +2. What is the desired Actions syntax to use instead? + - After some research, you have determined that we can login to AWS with the `aws-actions/configure-aws-credentials@v1` action, and deploy the app to AWS using a run step to replace the functionality of `codedeploy`: + + ```yaml + - 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 }}" + commit_hash=`git rev-parse HEAD` + aws deploy create-deployment --application-name MyApp --deployment-group-name MyDeploymentGroup --github-location repository=$GITHUB_REPOSITORY,commitId=$commit_hash --ignore-application-stop-failures + ``` + +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 +``` + +Next, you will define a `transform` method for the `codedeploy` identifier by adding the following code to `transformers.rb`: + +```ruby +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" + } + }, + { + "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 +``` + +This method can use any valid ruby syntax and should return a `Hash` that represents the YAML that should be generated for a given step. Valet will use this method to convert a step with the provided identifier and will use the `item` parameter for the original values configured in Travis CI. + +Now you can perform another `dry-run` command and use the `--custom-transformers` CLI option to provide this custom transformer. Run the following command within your codespace terminal: + +```bash + gh valet dry-run travis-ci --travis-ci-repository "deploy-example" --output-dir tmp/travis/dry-run --custom-transformers transformers.rb +``` + +The converted workflow that is generated by the above command will now use the custom logic for the `codedeploy` step. + +```diff +- # # This item has no matching transformer +- # - codedeploy: +- # provider: codedeploy +- # access_key_id: YOUR AWS ACCESS KEY +- # secret_access_key: YOUR AWS SECRET KEY +- # bucket: S3 Bucket +- # key: latest/MyApp.zip +- # application: MyApp +- # deployment_group: MyDeploymentGroup +- # if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}" ++ - 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 }}" ++ commit_hash=`git rev-parse HEAD` ++ aws deploy create-deployment --application-name MyApp --deployment-group-name MyDeploymentGroup --github-location repository=$GITHUB_REPOSITORY,commitId=$commit_hash --ignore-application-stop-failures +``` + +_Note_: We hard coded certain values such as the `application-name`, but we can apply these properties programatically as well. If you were unsure what the data structure of `item` was, you could use the following code in the custom transformer to print `item` to the console: + +```ruby +transform "codecov_codecov_upload" do |item| + puts item +end +``` + +## Custom transformers for environment variables + +You can use custom transformers to edit the values of environment variables in converted workflows. In this example, you will update the `DB` environment variable to be `sqlite` instead of `mysql`. + +To do this, add the following code to the `transformers.rb` file. + +```ruby +env "DB", "sqlite" +``` + +In this example, the first parameter to the `env` method is the environment variable name and the second is the updated value. + +Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow the `DB` environment variable will be set to `sqlite`: + +```diff + env: +- DB: "mysql" ++ DB: "sqlite" +``` + +## Custom transformers for runners + +Finally, you can use custom transformers to dictate which runners converted workflows should use. First, answer the following questions: + +1. What is the label of the runner in Travis to update? + - __linux__ + +2. What is the label of the runner in Actions to use instead? + - __new-runner__ + +With these questions answered, you can add the following code to the `transformers.rb` file: + +```ruby +runner "linux", ["new-runner", "self-hosted"] +``` + +In this example, the first parameter to the `runner` method is the Azure DevOps label and the second is the Actions runner label. + +Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow, the `runs-on` statement will use the customized runner label: + +```diff +- runs-on: ubuntu-latest ++ runs-on: ++ - new-runner ++ - self-hosted +``` + +At this point, the file contents of `transformers.rb` should match this: + +
+ Custom transformers πŸ‘‡ + +```ruby +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" + } + }, + { + "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 + +env "DB", "sqlite" + +runner "linux", ["new-runner", "self-hosted"] +``` + +
+ +That's it! Congratulations, you have overridden Valet's default behavior by customizing the conversion of: + +- Unknown steps +- Environment variables +- Runner + +## Next lab + +[Perform a production migration of a Travis CI pipeline](5-migrate.md) From 5e4fef4f59925019a6f50b69411c8bb2f6dccf52 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Thu, 15 Sep 2022 13:40:40 -0700 Subject: [PATCH 11/39] Added travis migrate lab --- travis/5-migrate.md | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 travis/5-migrate.md diff --git a/travis/5-migrate.md b/travis/5-migrate.md new file mode 100644 index 0000000..0efd2e9 --- /dev/null +++ b/travis/5-migrate.md @@ -0,0 +1,51 @@ +# Perform a production migration of a Travis CI pipeline + +In this lab, you will use the `migrate` command to convert a Travis CI pipeline and open a pull request with the equivalent Actions workflow. + +## Prerequisites + +1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment. +2. Completed the [configure lab](./1-configure.md#configuring-credentials). +3. Completed the [dry-run lab](./3-dry-run.md). +4. Completed the [custom transformers lab](./4-custom-transformers.md). + +## Performing a migration + +Answer the following questions before running a `migrate` command: + +1. What project do you want to migrate? + - __circleci-hello-world__ +2. Where do you want to store the logs? + - __./tmp/migrate__ +3. What is the URL for the GitHub repository to add the workflow to? + - __this repository__. The URL should follow the pattern with `:owner` and `:repo` replaced with your values. + +### Steps + +1. Run the following `migrate` command in the codespace terminal. Ensure the values in `--target-url` for `:owner` and `:repo` are replaced with your values: + + ```bash + gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --travis-ci-repository "deploy-example" + ``` + +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/190496147-2f8af72d-51d9-426b-94cf-5d0d7fe02eb3.png) + +3. Open the generated pull request in a new browser tab. + +### Inspect the pull request + +The first thing to notice about the pull request is that there is a list of manual steps to complete. + +Next, you can inspect the "Files changed" in this pull request and see the converted workflow that is being added. Any additional changes or code reviews that were needed should be done in this pull request. + +![action-run](https://user-images.githubusercontent.com/19557880/190496147-2f8af72d-51d9-426b-94cf-5d0d7fe02eb3.png) + +Finally, you can merge the pull request once your review has completed. You can then view the workflow running by selecting the "Actions" menu in the top navigation bar in GitHub. + +At this point, the migration has completed and you have successfully migrated a Travis CI pipeline to Actions! + +### Next Lab + +[Forecast potential build runner usage](6-forecast.md) From 314f8acbd5246a44552fe5bbf22e51ad02f9aec1 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Thu, 15 Sep 2022 14:32:59 -0700 Subject: [PATCH 12/39] Travis CI forecast lab --- travis/6-forecast.md | 100 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 travis/6-forecast.md diff --git a/travis/6-forecast.md b/travis/6-forecast.md new file mode 100644 index 0000000..66bcd30 --- /dev/null +++ b/travis/6-forecast.md @@ -0,0 +1,100 @@ +# Forecast potential build runner usage + +In this lab you will use the `forecast` command to forecast potential GitHub Actions usage by computing metrics from completed pipeline runs in Travis CI. + +## Prerequisites + +1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment. +2. Completed the [configure lab](./1-configure.md#configuring-credentials). + +## Perform a forecast + +Answer the following questions before running the `forecast` command: + +1. What is the date you want to start forecasting from? + - **2022-09-02**. This date is needed as it is prior to when the bulk of builds were trigger in the demo Travis CI organization for these labs. This value defaults to the date one week ago, however, you should use a start date that will show a representative view of typical usage. +2. Where do you want to store the results? + - **./tmp/forecast_reports** + +### Steps + +1. Navigate to your codespace terminal +2. Run the following command from the root directory: + + ```bash + gh valet forecast travis-ci --output-dir ./tmp/forecast_reports --start-date 2022-09-02 + ``` + +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) + +## Review the forecast report + +The forecast report, logs, and completed job data will be located within the `tmp/forecast_reports` folder. + +1. Find the `forecast_report.md` file in the file explorer. +2. Right-click the `forecast_report.md` file and select `Open Preview`. +3. This file contains metrics used to forecast potential GitHub Actions usage. + +### Total + +The "Total" section of the forecast report contains high level statistics related to all the jobs completed after the `--start-date` CLI option: + +```md +- Job count: **18** +- Pipeline count: **13** + +- Execution time + + - Total: **46 minutes** + - Median: **1 minutes** + - P90: **6 minutes** + - Min: **0 minutes** + - Max: **10 minutes** + +- Queue time + + - Median: **0 minutes** + - P90: **0 minutes** + - Min: **0 minutes** + - Max: **0 minutes** + +- Concurrent jobs + + - Median: **0** + - P90: **0** + - Min: **0** + - Max: **4** +``` + +Here are some key terms of items defined in the forecast report: + +- The `job count` is the total number of completed jobs. +- The `pipeline count` is the number of unique pipelines used. +- `Execution time` describes the amount of time a runner spent on a job. This metric can be used to help plan for the cost of GitHub-hosted runners. + - This metric is correlated to how much you should expect to spend in GitHub Actions. This will vary depending on the hardware used for these minutes. You can use the [Actions pricing calculator](https://github.com/pricing/calculator) to estimate a dollar amount. +- `Queue time` metrics describe the amount of time a job spent waiting for a runner to be available to execute it. +- `Concurrent jobs` metrics describe the amount of jobs running at any given time. This metric can be used to define the number of runners a customer should configure. + +Additionally, these metrics are defined for each queue of runners defined in Travis CI. This is especially useful if there are a mix of hosted/self-hosted runners or high/low spec machines to see metrics specific to different types of runners. + +## Forecasting multiple providers + +You can examine the available options for the `forecast` command by running `gh valet forecast --help`. When you do this you will see the `--source-file-path` option: + +![img](https://user-images.githubusercontent.com/19557880/190511652-081ae8c3-c37e-4c5f-9e7f-8fcd9fe63b3a.png) + +You can use the `--source-file-path` CLI option to combine data from multiple reports into a single report. This becomes useful if you use multiple CI/CD providers and want to get a holistic view of the runner usage. This works by using the `.json` files generated by `forecast` commands as space-delimited values for the `--source-file-path` CLI option. Optionally, this value could be a glob pattern to dynamically specify the list of files (e.g. `**/*.json`). + +Run the following command from within the codespace terminal: + +```bash +gh valet forecast --source-file-path tmp/**/jobs/*.json -o tmp/combined-forecast +``` + +You can now inspect the output of the command to see a forecast report using all of the files matching the `tmp/**/jobs/*.json` pattern. + +## Next steps + +This concludes all labs for migrating Travis CI pipelines to Actions with Valet! From 4f34acd39ecf064741501f52215135921a564daf Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Thu, 15 Sep 2022 15:36:02 -0700 Subject: [PATCH 13/39] Travis CI Audit lab --- travis/2-audit.md | 338 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 travis/2-audit.md diff --git a/travis/2-audit.md b/travis/2-audit.md new file mode 100644 index 0000000..7c10b3b --- /dev/null +++ b/travis/2-audit.md @@ -0,0 +1,338 @@ +# Perform an audit of CircleCI + +In this lab, you will use the `audit` command to get a high-level view of all projects in a Travis CI organization. + +The `audit` command operates by fetching all of the projects defined in a Travis CI organization, converting each to their equivalent GitHub Actions workflow, and writing a report that summarizes how complete and complex of a migration is possible with Valet. + +## Prerequisites + +1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your Codespace environment. +2. Completed the [configure lab](./1-configure.md#configure-credentials-for-valet). + +## Perform an audit + +We will be performing an audit against the **labs-data** organization in Travis CI, which was created for the purposes of this lab. Valet was already been set to use this organization during the configure lab. The only remaining information needed for the `audit` command is: + +1. Where do we want to store the result? + - **./tmp/audit**. This can be any path within the working directory that Valet commands are executed from. + +### Steps + +1. Navigate to the codespace terminal. +2. Run the following command from the root directory: + + ```bash + gh valet audit travis-ci --output-dir tmp/audit + ``` + +3. The command will list all the files written to disk in green when the command succeeds. + +## Inspect the output files + +1. Find the `audit_summary.md` file in the file explorer. +2. Right-click the `audit_summary.md` file and select `Open Preview`. +3. This file contains details that summarizes what percentage of your pipelines were converted automatically. + +### Review audit summary + +#### Pipelines + +The pipeline summary section contains high level statistics regarding the conversion rate done by Valet: + +```md +# Audit summary + +Summary for [Travis CI instance](https://travis-ci.com/valet-travis-labs) + +- Valet version: **0.1.0.13539 (5bb6c723d6db3688ea0653e14bbf3c63df445bfc)** +- Performed at: **9/15/22 at 22:24** + +## Pipelines + +Total: **6** + +- Successful: **0 (0%)** +- Partially successful: **6 (100%)** +- Unsupported: **0 (0%)** +- Failed: **0 (0%)** + +### Job types + +Supported: **6 (100%)** + +- ruby: **2** +- c: **1** +- nodejs: **1** +- php: **1** +- python: **1** + +### Build steps + +Total: **29** + +Known: **26 (89%)** + +- script: **7** +- install: **6** +- before_script: **3** +- rvm: **2** +- after_deploy: **2** +- ccache: **1** +- pushover: **1** +- dependencies: **1** +- before_deploy: **1** +- php: **1** +- irc: **1** + +Unknown: **1 (3%)** + +- codedeploy: **1** + +Unsupported: **2 (6%)** + +- sudo: **2** + +Actions: **32** + +- run: **19** +- actions/checkout@v2: **7** +- ruby/setup-ruby@v1: **2** +- actions/cache@v2: **1** +- desiderati/github-action-pushover@v1: **1** +- shivammathur/setup-php@v2: **1** +- rectalogic/notify-irc@v1: **1** + +### Triggers + +Total: **36** + +Known: **36 (100%)** + +- crons: **6** +- branches: **6** +- config_validation: **6** +- build_pull_requests: **6** +- build_pushes: **6** +- builds_only_with_travis_yml: **6** + +Actions: **12** + +- pull_request: **6** +- push: **6** + +### Environment + +Total: **1** + +Known: **1 (100%)** + +- DB: **1** + +Actions: **1** + +- DB: **1** + +### Other + +Total: **18** + +Known: **12 (66%)** + +- auto_cancel_pull_requests: **6** +- auto_cancel_pushes: **6** + +Unknown: **6 (33%)** + +- maximum_number_of_builds: **6** + +Actions: **3** + +- matrix: **2** +- DB: **1** + +### Manual tasks + +Total: **1** + +Secrets: **1** + +- `${{ secrets.PUSHOVER_USER_KEY }}`: **1** + +### Partially successful + +#### valet-travis-labs/deploy-example + +- [valet-travis-labs/deploy-example.yml](valet-travis-labs/deploy-example.yml) +- [valet-travis-labs/deploy-example.config.json](valet-travis-labs/deploy-example.config.json) +- [valet-travis-labs/deploy-example.source.yml](valet-travis-labs/deploy-example.source.yml) + +#### valet-travis-labs/c-sharp-example + +- [valet-travis-labs/c-sharp-example.yml](valet-travis-labs/c-sharp-example.yml) +- [valet-travis-labs/c-sharp-example.config.json](valet-travis-labs/c-sharp-example.config.json) +- [valet-travis-labs/c-sharp-example.source.yml](valet-travis-labs/c-sharp-example.source.yml) + +#### valet-travis-labs/ruby-example + +- [valet-travis-labs/ruby-example.yml](valet-travis-labs/ruby-example.yml) +- [valet-travis-labs/ruby-example.config.json](valet-travis-labs/ruby-example.config.json) +- [valet-travis-labs/ruby-example.source.yml](valet-travis-labs/ruby-example.source.yml) + +#### valet-travis-labs/nodejs-example + +- [valet-travis-labs/nodejs-example.yml](valet-travis-labs/nodejs-example.yml) +- [valet-travis-labs/nodejs-example.config.json](valet-travis-labs/nodejs-example.config.json) +- [valet-travis-labs/nodejs-example.source.yml](valet-travis-labs/nodejs-example.source.yml) + +#### valet-travis-labs/php-example + +- [valet-travis-labs/php-example.yml](valet-travis-labs/php-example.yml) +- [valet-travis-labs/php-example.config.json](valet-travis-labs/php-example.config.json) +- [valet-travis-labs/php-example.source.yml](valet-travis-labs/php-example.source.yml) + +#### valet-travis-labs/python + +- [valet-travis-labs/python.yml](valet-travis-labs/python.yml) +- [valet-travis-labs/python.config.json](valet-travis-labs/python.config.json) +- [valet-travis-labs/python.source.yml](valet-travis-labs/python.source.yml) + +``` + +Here are some key terms that can appear in the β€œPipelines” section: + +- **Successful** pipelines had 0% of the pipeline constructs and individual items converted automatically to their GitHub Actions equivalent. +- **Partially successful** pipelines had 100% of all of the pipeline constructs converted, however, there were some individual items that were not converted automatically to their GitHub Actions equivalent. +- **Failed pipelines** encountered a fatal error when being converted. This can occur for one of three reasons: + - The pipeline was misconfigured and not valid in Travis CI. + - Valet encountered an internal error when converting it. + - There was an unsuccessful network response, often due to invalid credentials, that caused the pipeline to be inaccessible. + +The "Job types" section will summarize which types of pipelines are being used and which are supported or unsupported by Valet. + +#### Build steps + +The build steps summary section presents an overview of the individual build steps that are used across all pipelines and how many were automatically converted by Valet. + +```md +Total: **29** + +Known: **26 (89%)** + +- script: **7** +- install: **6** +- before_script: **3** +- rvm: **2** +- after_deploy: **2** +- ccache: **1** +- pushover: **1** +- dependencies: **1** +- before_deploy: **1** +- php: **1** +- irc: **1** + +Unknown: **1 (3%)** + +- codedeploy: **1** + +Unsupported: **2 (6%)** + +- sudo: **2** + +Actions: **32** + +- run: **19** +- actions/checkout@v2: **7** +- ruby/setup-ruby@v1: **2** +- actions/cache@v2: **1** +- desiderati/github-action-pushover@v1: **1** +- shivammathur/setup-php@v2: **1** +- rectalogic/notify-irc@v1: **1** +``` + +Here are some key terms that can appear in "Build steps" section: + +- A **known** build step is a step that was automatically converted to an equivalent action. +- An **unknown** build step is a step that was not automatically converted to an equivalent action. +- An **unsupported** build step is a step that is either: + - A step that is fundamentally not supported by GitHub Actions. + - A step that is configured in a way that is incompatible with GitHub Actions. +- An **action** is a list of the actions that were used in the converted workflows. This is important for the following scenarios: + - Gathering the list of actions to sync to your appliance if you use GitHub Enterprise Server. + - Defining an organization-level allowlist of actions that can be used. This list of actions is a comprehensive list of which actions their security and/or compliance teams will need to review. + +There is an equivalent breakdown of build triggers, environment variables, and other uncategorized items displayed in the audit summary file. + +#### Manual Tasks + +The manual tasks summary section presents an overview of the manual tasks that you will need to perform that Valet is not able to complete automatically. + +```md +### Manual tasks + +Total: **1** + +Secrets: **1** + +- `${{ secrets.PUSHOVER_USER_KEY }}`: **1** +``` + +Here are some key terms that can appear in β€œManual tasks” section: + +- A **secret** refers to a repository or organization level secret that is used by the converted pipelines. These secrets will need to be created manually in Actions in order for these pipelines to function properly. +- A **self-hosted runner** refers to a label of a runner that is referenced by a converted pipeline that is not a GitHub-hosted runner. You will need to manually define these runners in order for these pipelines to function properly. + +#### Files + +The final section of the audit report provides a manifest of all of the files that are written to disk during the audit. These files include: + +```md +### Partially successful + +#### valet-travis-labs/deploy-example + +- [valet-travis-labs/deploy-example.yml](valet-travis-labs/deploy-example.yml) +- [valet-travis-labs/deploy-example.config.json](valet-travis-labs/deploy-example.config.json) +- [valet-travis-labs/deploy-example.source.yml](valet-travis-labs/deploy-example.source.yml) + +#### valet-travis-labs/c-sharp-example + +- [valet-travis-labs/c-sharp-example.yml](valet-travis-labs/c-sharp-example.yml) +- [valet-travis-labs/c-sharp-example.config.json](valet-travis-labs/c-sharp-example.config.json) +- [valet-travis-labs/c-sharp-example.source.yml](valet-travis-labs/c-sharp-example.source.yml) + +#### valet-travis-labs/ruby-example + +- [valet-travis-labs/ruby-example.yml](valet-travis-labs/ruby-example.yml) +- [valet-travis-labs/ruby-example.config.json](valet-travis-labs/ruby-example.config.json) +- [valet-travis-labs/ruby-example.source.yml](valet-travis-labs/ruby-example.source.yml) + +#### valet-travis-labs/nodejs-example + +- [valet-travis-labs/nodejs-example.yml](valet-travis-labs/nodejs-example.yml) +- [valet-travis-labs/nodejs-example.config.json](valet-travis-labs/nodejs-example.config.json) +- [valet-travis-labs/nodejs-example.source.yml](valet-travis-labs/nodejs-example.source.yml) + +#### valet-travis-labs/php-example + +- [valet-travis-labs/php-example.yml](valet-travis-labs/php-example.yml) +- [valet-travis-labs/php-example.config.json](valet-travis-labs/php-example.config.json) +- [valet-travis-labs/php-example.source.yml](valet-travis-labs/php-example.source.yml) + +#### valet-travis-labs/python + +- [valet-travis-labs/python.yml](valet-travis-labs/python.yml) +- [valet-travis-labs/python.config.json](valet-travis-labs/python.config.json) +- [valet-travis-labs/python.source.yml](valet-travis-labs/python.source.yml) + +``` + +Each pipeline will have a variety of files written that include: + +- The original pipeline as it was defined in GitHub. +- Any network responses used to convert a pipeline. +- The converted workflow. +- Stack traces that can used to troubleshoot a failed pipeline conversion + +### Next lab + +[Perform a dry-run of a Travis CI pipeline](3-dry-run.md) From 545a625a58939c0ee526cb0eeb483648fda847cb Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:29:29 -0700 Subject: [PATCH 14/39] Update travis/4-custom-transformers.md Co-authored-by: j-dunham --- travis/4-custom-transformers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/4-custom-transformers.md b/travis/4-custom-transformers.md index 2847887..63b257d 100644 --- a/travis/4-custom-transformers.md +++ b/travis/4-custom-transformers.md @@ -153,7 +153,7 @@ The converted workflow that is generated by the above command will now use the c + aws deploy create-deployment --application-name MyApp --deployment-group-name MyDeploymentGroup --github-location repository=$GITHUB_REPOSITORY,commitId=$commit_hash --ignore-application-stop-failures ``` -_Note_: We hard coded certain values such as the `application-name`, but we can apply these properties programatically as well. If you were unsure what the data structure of `item` was, you could use the following code in the custom transformer to print `item` to the console: +_Note_: We hard coded certain values such as the `application-name`, but we can apply these properties programmatically as well by using the item passed into the transform method. If you were unsure what the data structure of `item` was, you could use the following code in the custom transformer to print `item` to the console: ```ruby transform "codecov_codecov_upload" do |item| From 35c6a63b25d896d0e87261fa3fda1e4e6cff23c7 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:29:44 -0700 Subject: [PATCH 15/39] Update travis/4-custom-transformers.md Co-authored-by: j-dunham --- travis/4-custom-transformers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/4-custom-transformers.md b/travis/4-custom-transformers.md index 63b257d..850fb04 100644 --- a/travis/4-custom-transformers.md +++ b/travis/4-custom-transformers.md @@ -197,7 +197,7 @@ With these questions answered, you can add the following code to the `transforme runner "linux", ["new-runner", "self-hosted"] ``` -In this example, the first parameter to the `runner` method is the Azure DevOps label and the second is the Actions runner label. +In this example, the first parameter to the `runner` method is the Azure DevOps label and the second is the Actions runner labels. Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow, the `runs-on` statement will use the customized runner label: From 490fc1cb39361f8d95efaa622c5b77709528e452 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:29:49 -0700 Subject: [PATCH 16/39] Update travis/4-custom-transformers.md Co-authored-by: j-dunham --- travis/4-custom-transformers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/4-custom-transformers.md b/travis/4-custom-transformers.md index 850fb04..d432530 100644 --- a/travis/4-custom-transformers.md +++ b/travis/4-custom-transformers.md @@ -199,7 +199,7 @@ runner "linux", ["new-runner", "self-hosted"] In this example, the first parameter to the `runner` method is the Azure DevOps label and the second is the Actions runner labels. -Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow, the `runs-on` statement will use the customized runner label: +Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow, the `runs-on` statement will use the customized runner labels: ```diff - runs-on: ubuntu-latest From ba3bcfd187aa4ff40a467f8a7a5c9e6cd60e757d Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:33:58 -0700 Subject: [PATCH 17/39] Update travis/4-custom-transformers.md --- travis/4-custom-transformers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/4-custom-transformers.md b/travis/4-custom-transformers.md index d432530..10510a4 100644 --- a/travis/4-custom-transformers.md +++ b/travis/4-custom-transformers.md @@ -121,7 +121,7 @@ transform "codedeploy" do |_item| end ``` -This method can use any valid ruby syntax and should return a `Hash` that represents the YAML that should be generated for a given step. Valet will use this method to convert a step with the provided identifier and will use the `item` parameter for the original values configured in Travis CI. +This method can use any valid ruby syntax and should return a `Hash`, or an array of `Hashes` that represent the YAML that should be generated for a given step. Valet will use this method to convert a step with the provided identifier and will use the `item` parameter for the original values configured in Travis CI. Now you can perform another `dry-run` command and use the `--custom-transformers` CLI option to provide this custom transformer. Run the following command within your codespace terminal: From 6f181fc899165e701d004f6e7c38e6cfb000871d Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:39:22 -0700 Subject: [PATCH 18/39] Update travis/5-migrate.md --- travis/5-migrate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/5-migrate.md b/travis/5-migrate.md index 0efd2e9..1986da2 100644 --- a/travis/5-migrate.md +++ b/travis/5-migrate.md @@ -14,7 +14,7 @@ In this lab, you will use the `migrate` command to convert a Travis CI pipeline Answer the following questions before running a `migrate` command: 1. What project do you want to migrate? - - __circleci-hello-world__ + - __deploy-example__ 2. Where do you want to store the logs? - __./tmp/migrate__ 3. What is the URL for the GitHub repository to add the workflow to? From 9d911df691c84282643cf4cc58ec567e03b21c0e Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:52:42 -0700 Subject: [PATCH 19/39] Update travis/5-migrate.md --- travis/5-migrate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/5-migrate.md b/travis/5-migrate.md index 1986da2..8dcf3db 100644 --- a/travis/5-migrate.md +++ b/travis/5-migrate.md @@ -30,7 +30,7 @@ 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/190496147-2f8af72d-51d9-426b-94cf-5d0d7fe02eb3.png) + ![pr](https://user-images.githubusercontent.com/19557880/190689859-d16a678b-f08f-44c1-a819-780ea967ecaf.png) 3. Open the generated pull request in a new browser tab. From 63b163ad5f55c74e1530f8aecfbe283824c8904c Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 09:55:49 -0700 Subject: [PATCH 20/39] Update travis/2-audit.md Co-authored-by: Ethan Dennis --- travis/2-audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/2-audit.md b/travis/2-audit.md index 7c10b3b..57938e5 100644 --- a/travis/2-audit.md +++ b/travis/2-audit.md @@ -11,7 +11,7 @@ The `audit` command operates by fetching all of the projects defined in a Travis ## Perform an audit -We will be performing an audit against the **labs-data** organization in Travis CI, which was created for the purposes of this lab. Valet was already been set to use this organization during the configure lab. The only remaining information needed for the `audit` command is: +You will be performing an audit against the **labs-data** Travis CI organization that was created for the purposes of this lab. Your environment was configured to use this organization during the [configure lab](./1-configure.md). The remaining information needed to perform an `audit` is: 1. Where do we want to store the result? - **./tmp/audit**. This can be any path within the working directory that Valet commands are executed from. From d8b35d040638d03c050caab681750d4571d992b2 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 12:31:27 -0700 Subject: [PATCH 21/39] Update travis/2-audit.md Co-authored-by: Luke Cheung Engle <99493186+luke-engle@users.noreply.github.com> --- travis/2-audit.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/travis/2-audit.md b/travis/2-audit.md index 57938e5..077dc5e 100644 --- a/travis/2-audit.md +++ b/travis/2-audit.md @@ -2,7 +2,10 @@ In this lab, you will use the `audit` command to get a high-level view of all projects in a Travis CI organization. -The `audit` command operates by fetching all of the projects defined in a Travis CI organization, converting each to their equivalent GitHub Actions workflow, and writing a report that summarizes how complete and complex of a migration is possible with Valet. +The `audit` command operates by performing the following: +- Fetching all of the projects defined in a Travis CI organization. +- Converting each to their equivalent GitHub Actions workflow. +- Generating a report that summarizes how complete and complex of a migration is possible with Valet. ## Prerequisites From b7f006ce338b2c9d07c2218c47616184c0da9268 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 13:25:05 -0700 Subject: [PATCH 22/39] Update travis pipeline location to Valet-labs --- travis/1-configure.md | 8 +- travis/2-audit.md | 194 ++++++++++++++------------------ travis/3-dry-run.md | 89 ++++++++------- travis/4-custom-transformers.md | 80 ++++++------- travis/5-migrate.md | 8 +- 5 files changed, 179 insertions(+), 200 deletions(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 6410274..5edee71 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -32,12 +32,12 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default value (`https://github.com`). - At the Travis CI token prompt enter the Travis CI access token from step 2 and press enter. - At the Travis CI base url prompt hit enter to accept the default value (`https://travis-ci.com`). - - At the Travis CI organization name enter `valet-travis-labs`. + - At the Travis CI organization name enter `valet-labs`. - At the access token to fetch source code in GitHub prompt enter the GitHub PAT generated in step 1 and press enter. - At the GitHub instance url containing source code prompt press enter to accept the default value (`https://github.com`). - - ![configure-cli-terminal](https://user-images.githubusercontent.com/19557880/189158118-833e46c3-b3f5-49e8-8f20-63d1607b0d8c.png) - + + ![configure-cli-terminal](https://user-images.githubusercontent.com/19557880/190726544-b07dbc5f-6756-44f2-a24c-54bb3f4d0414.png) + ## Verify your environment To verify our environment is configured correctly, we are going to run the `update` CLI command. The `update` CLI command will download the latest version of Valet to your codespace. diff --git a/travis/2-audit.md b/travis/2-audit.md index 077dc5e..a6a731d 100644 --- a/travis/2-audit.md +++ b/travis/2-audit.md @@ -3,6 +3,7 @@ In this lab, you will use the `audit` command to get a high-level view of all projects in a Travis CI organization. The `audit` command operates by performing the following: + - Fetching all of the projects defined in a Travis CI organization. - Converting each to their equivalent GitHub Actions workflow. - Generating a report that summarizes how complete and complex of a migration is possible with Valet. @@ -45,83 +46,79 @@ The pipeline summary section contains high level statistics regarding the conver ```md # Audit summary -Summary for [Travis CI instance](https://travis-ci.com/valet-travis-labs) +Summary for [Travis CI instance](https://travis-ci.com/valet-labs) - Valet version: **0.1.0.13539 (5bb6c723d6db3688ea0653e14bbf3c63df445bfc)** -- Performed at: **9/15/22 at 22:24** +- Performed at: **9/16/22 at 20:01** ## Pipelines -Total: **6** +Total: **5** - Successful: **0 (0%)** -- Partially successful: **6 (100%)** +- Partially successful: **5 (100%)** - Unsupported: **0 (0%)** - Failed: **0 (0%)** ### Job types -Supported: **6 (100%)** +Supported: **5 (100%)** -- ruby: **2** -- c: **1** -- nodejs: **1** - php: **1** +- nodejs: **1** +- ruby: **2** - python: **1** ### Build steps -Total: **29** +Total: **25** -Known: **26 (89%)** +Known: **22 (88%)** -- script: **7** - install: **6** +- script: **5** - before_script: **3** - rvm: **2** - after_deploy: **2** -- ccache: **1** - pushover: **1** -- dependencies: **1** +- irc: **1** - before_deploy: **1** - php: **1** -- irc: **1** -Unknown: **1 (3%)** +Unknown: **1 (4%)** - codedeploy: **1** -Unsupported: **2 (6%)** +Unsupported: **2 (8%)** - sudo: **2** -Actions: **32** +Actions: **28** -- run: **19** -- actions/checkout@v2: **7** +- run: **17** +- actions/checkout@v2: **6** - ruby/setup-ruby@v1: **2** -- actions/cache@v2: **1** -- desiderati/github-action-pushover@v1: **1** -- shivammathur/setup-php@v2: **1** - rectalogic/notify-irc@v1: **1** +- shivammathur/setup-php@v2: **1** +- desiderati/github-action-pushover@v1: **1** ### Triggers -Total: **36** +Total: **30** -Known: **36 (100%)** +Known: **30 (100%)** -- crons: **6** -- branches: **6** -- config_validation: **6** -- build_pull_requests: **6** -- build_pushes: **6** -- builds_only_with_travis_yml: **6** +- crons: **5** +- branches: **5** +- config_validation: **5** +- build_pull_requests: **5** +- build_pushes: **5** +- builds_only_with_travis_yml: **5** -Actions: **12** +Actions: **10** -- pull_request: **6** -- push: **6** +- pull_request: **5** +- push: **5** ### Environment @@ -137,16 +134,16 @@ Actions: **1** ### Other -Total: **18** +Total: **15** -Known: **12 (66%)** +Known: **10 (66%)** -- auto_cancel_pull_requests: **6** -- auto_cancel_pushes: **6** +- auto_cancel_pull_requests: **5** +- auto_cancel_pushes: **5** -Unknown: **6 (33%)** +Unknown: **5 (33%)** -- maximum_number_of_builds: **6** +- maximum_number_of_builds: **5** Actions: **3** @@ -163,42 +160,35 @@ Secrets: **1** ### Partially successful -#### valet-travis-labs/deploy-example +#### valet-labs/travisci-php-example -- [valet-travis-labs/deploy-example.yml](valet-travis-labs/deploy-example.yml) -- [valet-travis-labs/deploy-example.config.json](valet-travis-labs/deploy-example.config.json) -- [valet-travis-labs/deploy-example.source.yml](valet-travis-labs/deploy-example.source.yml) +- [valet-labs/travisci-php-example.yml](valet-labs/travisci-php-example.yml) +- [valet-labs/travisci-php-example.config.json](valet-labs/travisci-php-example.config.json) +- [valet-labs/travisci-php-example.source.yml](valet-labs/travisci-php-example.source.yml) -#### valet-travis-labs/c-sharp-example +#### valet-labs/travisci-nodejs-example -- [valet-travis-labs/c-sharp-example.yml](valet-travis-labs/c-sharp-example.yml) -- [valet-travis-labs/c-sharp-example.config.json](valet-travis-labs/c-sharp-example.config.json) -- [valet-travis-labs/c-sharp-example.source.yml](valet-travis-labs/c-sharp-example.source.yml) +- [valet-labs/travisci-nodejs-example.yml](valet-labs/travisci-nodejs-example.yml) +- [valet-labs/travisci-nodejs-example.config.json](valet-labs/travisci-nodejs-example.config.json) +- [valet-labs/travisci-nodejs-example.source.yml](valet-labs/travisci-nodejs-example.source.yml) -#### valet-travis-labs/ruby-example +#### valet-labs/travisci-ruby-example -- [valet-travis-labs/ruby-example.yml](valet-travis-labs/ruby-example.yml) -- [valet-travis-labs/ruby-example.config.json](valet-travis-labs/ruby-example.config.json) -- [valet-travis-labs/ruby-example.source.yml](valet-travis-labs/ruby-example.source.yml) +- [valet-labs/travisci-ruby-example.yml](valet-labs/travisci-ruby-example.yml) +- [valet-labs/travisci-ruby-example.config.json](valet-labs/travisci-ruby-example.config.json) +- [valet-labs/travisci-ruby-example.source.yml](valet-labs/travisci-ruby-example.source.yml) -#### valet-travis-labs/nodejs-example +#### valet-labs/travisci-python-example -- [valet-travis-labs/nodejs-example.yml](valet-travis-labs/nodejs-example.yml) -- [valet-travis-labs/nodejs-example.config.json](valet-travis-labs/nodejs-example.config.json) -- [valet-travis-labs/nodejs-example.source.yml](valet-travis-labs/nodejs-example.source.yml) +- [valet-labs/travisci-python-example.yml](valet-labs/travisci-python-example.yml) +- [valet-labs/travisci-python-example.config.json](valet-labs/travisci-python-example.config.json) +- [valet-labs/travisci-python-example.source.yml](valet-labs/travisci-python-example.source.yml) -#### valet-travis-labs/php-example - -- [valet-travis-labs/php-example.yml](valet-travis-labs/php-example.yml) -- [valet-travis-labs/php-example.config.json](valet-travis-labs/php-example.config.json) -- [valet-travis-labs/php-example.source.yml](valet-travis-labs/php-example.source.yml) - -#### valet-travis-labs/python - -- [valet-travis-labs/python.yml](valet-travis-labs/python.yml) -- [valet-travis-labs/python.config.json](valet-travis-labs/python.config.json) -- [valet-travis-labs/python.source.yml](valet-travis-labs/python.source.yml) +#### valet-labs/travisci-deploy-example +- [valet-labs/travisci-deploy-example.yml](valet-labs/travisci-deploy-example.yml) +- [valet-labs/travisci-deploy-example.config.json](valet-labs/travisci-deploy-example.config.json) +- [valet-labs/travisci-deploy-example.source.yml](valet-labs/travisci-deploy-example.source.yml) ``` Here are some key terms that can appear in the β€œPipelines” section: @@ -217,39 +207,36 @@ The "Job types" section will summarize which types of pipelines are being used a The build steps summary section presents an overview of the individual build steps that are used across all pipelines and how many were automatically converted by Valet. ```md -Total: **29** +Total: **25** -Known: **26 (89%)** +Known: **22 (88%)** -- script: **7** - install: **6** +- script: **5** - before_script: **3** - rvm: **2** - after_deploy: **2** -- ccache: **1** - pushover: **1** -- dependencies: **1** +- irc: **1** - before_deploy: **1** - php: **1** -- irc: **1** -Unknown: **1 (3%)** +Unknown: **1 (4%)** - codedeploy: **1** -Unsupported: **2 (6%)** +Unsupported: **2 (8%)** - sudo: **2** -Actions: **32** +Actions: **28** -- run: **19** -- actions/checkout@v2: **7** +- run: **17** +- actions/checkout@v2: **6** - ruby/setup-ruby@v1: **2** -- actions/cache@v2: **1** -- desiderati/github-action-pushover@v1: **1** -- shivammathur/setup-php@v2: **1** - rectalogic/notify-irc@v1: **1** +- shivammathur/setup-php@v2: **1** +- desiderati/github-action-pushover@v1: **1** ``` Here are some key terms that can appear in "Build steps" section: @@ -291,42 +278,35 @@ The final section of the audit report provides a manifest of all of the files th ```md ### Partially successful -#### valet-travis-labs/deploy-example +#### valet-labs/travisci-php-example -- [valet-travis-labs/deploy-example.yml](valet-travis-labs/deploy-example.yml) -- [valet-travis-labs/deploy-example.config.json](valet-travis-labs/deploy-example.config.json) -- [valet-travis-labs/deploy-example.source.yml](valet-travis-labs/deploy-example.source.yml) +- [valet-labs/travisci-php-example.yml](valet-labs/travisci-php-example.yml) +- [valet-labs/travisci-php-example.config.json](valet-labs/travisci-php-example.config.json) +- [valet-labs/travisci-php-example.source.yml](valet-labs/travisci-php-example.source.yml) -#### valet-travis-labs/c-sharp-example +#### valet-labs/travisci-nodejs-example -- [valet-travis-labs/c-sharp-example.yml](valet-travis-labs/c-sharp-example.yml) -- [valet-travis-labs/c-sharp-example.config.json](valet-travis-labs/c-sharp-example.config.json) -- [valet-travis-labs/c-sharp-example.source.yml](valet-travis-labs/c-sharp-example.source.yml) +- [valet-labs/travisci-nodejs-example.yml](valet-labs/travisci-nodejs-example.yml) +- [valet-labs/travisci-nodejs-example.config.json](valet-labs/travisci-nodejs-example.config.json) +- [valet-labs/travisci-nodejs-example.source.yml](valet-labs/travisci-nodejs-example.source.yml) -#### valet-travis-labs/ruby-example +#### valet-labs/travisci-ruby-example -- [valet-travis-labs/ruby-example.yml](valet-travis-labs/ruby-example.yml) -- [valet-travis-labs/ruby-example.config.json](valet-travis-labs/ruby-example.config.json) -- [valet-travis-labs/ruby-example.source.yml](valet-travis-labs/ruby-example.source.yml) +- [valet-labs/travisci-ruby-example.yml](valet-labs/travisci-ruby-example.yml) +- [valet-labs/travisci-ruby-example.config.json](valet-labs/travisci-ruby-example.config.json) +- [valet-labs/travisci-ruby-example.source.yml](valet-labs/travisci-ruby-example.source.yml) -#### valet-travis-labs/nodejs-example +#### valet-labs/travisci-python-example -- [valet-travis-labs/nodejs-example.yml](valet-travis-labs/nodejs-example.yml) -- [valet-travis-labs/nodejs-example.config.json](valet-travis-labs/nodejs-example.config.json) -- [valet-travis-labs/nodejs-example.source.yml](valet-travis-labs/nodejs-example.source.yml) +- [valet-labs/travisci-python-example.yml](valet-labs/travisci-python-example.yml) +- [valet-labs/travisci-python-example.config.json](valet-labs/travisci-python-example.config.json) +- [valet-labs/travisci-python-example.source.yml](valet-labs/travisci-python-example.source.yml) -#### valet-travis-labs/php-example - -- [valet-travis-labs/php-example.yml](valet-travis-labs/php-example.yml) -- [valet-travis-labs/php-example.config.json](valet-travis-labs/php-example.config.json) -- [valet-travis-labs/php-example.source.yml](valet-travis-labs/php-example.source.yml) - -#### valet-travis-labs/python - -- [valet-travis-labs/python.yml](valet-travis-labs/python.yml) -- [valet-travis-labs/python.config.json](valet-travis-labs/python.config.json) -- [valet-travis-labs/python.source.yml](valet-travis-labs/python.source.yml) +#### valet-labs/travisci-deploy-example +- [valet-labs/travisci-deploy-example.yml](valet-labs/travisci-deploy-example.yml) +- [valet-labs/travisci-deploy-example.config.json](valet-labs/travisci-deploy-example.config.json) +- [valet-labs/travisci-deploy-example.source.yml](valet-labs/travisci-deploy-example.source.yml) ``` Each pipeline will have a variety of files written that include: diff --git a/travis/3-dry-run.md b/travis/3-dry-run.md index f0a3d87..a7ad1ff 100644 --- a/travis/3-dry-run.md +++ b/travis/3-dry-run.md @@ -13,7 +13,7 @@ In this lab you will use the `dry-run` command to convert a TravisCI pipeline to You will be performing a dry-run against a TravisCI project. Answer the following questions before running this command: 1. What pipeline do you want to convert? - - __ruby-example__. This is one of the sample projects avaiable in the TravisCI labs-data organization. + - __travisci-ruby-example__. This is one of the sample projects avaiable in the TravisCI labs-data organization. 2. Where do you want to store the result? - __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from. @@ -24,16 +24,16 @@ You will be performing a dry-run against a TravisCI project. Answer the followin 2. Run the following command from the root directory: ```bash - gh valet dry-run travis-ci --travis-ci-repository "ruby-example" --output-dir tmp/travis/dry-run-lab + gh valet dry-run travis-ci --travis-ci-repository "travisci-ruby-example" --output-dir tmp/travis/dry-run-lab ``` 3. The command will list all the files written to disk when the command succeeds. - ![command-result](https://user-images.githubusercontent.com/19557880/190260513-87bae04f-2ff2-4539-b4e5-1e68eba3cf2c.png) + ![command-result](https://user-images.githubusercontent.com/19557880/190724470-2936443e-d2f2-41f8-8470-28e313111036.png) 4. View the converted workflow: - Find `./tmp/travis/dry-run-lab` in the file explorer pane in your codespace. - - Click `ruby-example.yml` to open. + - Click `travisci-ruby-example.yml` to open. ## Inspect the output files @@ -68,47 +68,46 @@ The files generated from the `dry-run` command represent the equivalent Actions Converted workflow πŸ‘‡ ```yaml - name: valet-travis-labs/ruby-example - on: - push: - branches: - - "**/*" - pull_request: - concurrency: - # # This item has no matching transformer - # maximum_number_of_builds: 0 - jobs: - test: - runs-on: # this agent type is not supported: [[{"dist"=>"trusty"}]] - ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "${{ matrix.rvm }}" - # # 'sudo' was not transformed because there is no suitable equivalent in GitHub Actions - - run: gem install bundler - - run: echo "hello!" - strategy: - matrix: - rvm: - - 1.9.3 - - 2.0.0 - - 2.1.0 - test_2: - runs-on: # this agent type is not supported: [[{"dist"=>"trusty"}]] - ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 1.9.3 - # # 'sudo' was not transformed because there is no suitable equivalent in GitHub Actions - - run: gem install bundler - - run: echo "child" - +name: valet-labs/travisci-ruby-example +on: + push: + branches: + - "**/*" + pull_request: +concurrency: +# # This item has no matching transformer +# maximum_number_of_builds: 0 +jobs: + test: + runs-on: # this agent type is not supported: [[{"dist"=>"trusty"}]] + ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.rvm }}" +# # 'sudo' was not transformed because there is no suitable equivalent in GitHub Actions + - run: gem install bundler + - run: echo "hello!" + strategy: + matrix: + rvm: + - 1.9.3 + - 2.0.0 + - 2.1.0 + test_2: + runs-on: # this agent type is not supported: [[{"dist"=>"trusty"}]] + ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 1.9.3 +# # 'sudo' was not transformed because there is no suitable equivalent in GitHub Actions + - run: gem install bundler + - run: echo "child" ``` diff --git a/travis/4-custom-transformers.md b/travis/4-custom-transformers.md index 10510a4..917d98d 100644 --- a/travis/4-custom-transformers.md +++ b/travis/4-custom-transformers.md @@ -18,7 +18,7 @@ In this lab you will build upon the `dry-run` command to override Valet's defaul You will be performing a `dry-run` command to inspect the workflow that is converted by default. Run the following command within the codespace terminal: ```bash - gh valet dry-run travis-ci --travis-ci-repository "deploy-example" --output-dir tmp/travis/dry-run + gh valet dry-run travis-ci --travis-ci-repository "travisci-deploy-example" --output-dir tmp/travis/dry-run ``` The converted workflow that is generated by the above command can be seen below: @@ -27,45 +27,45 @@ The converted workflow that is generated by the above command can be seen below: Converted workflow πŸ‘‡ ```yaml - name: valet-travis-labs/deploy-example - on: - push: - branches: - - "**/*" - pull_request: - concurrency: - # # This item has no matching transformer - # maximum_number_of_builds: 0 - env: - DB: mysql - jobs: - test: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v2 - - run: gem install bundler - - run: bundle install --jobs=3 --retry=3 - - run: rake - - run: echo 'ready?' - # # This item has no matching transformer - # - codedeploy: - # provider: codedeploy - # access_key_id: YOUR AWS ACCESS KEY - # secret_access_key: YOUR AWS SECRET KEY - # bucket: S3 Bucket - # key: latest/MyApp.zip - # application: MyApp - # deployment_group: MyDeploymentGroup - # if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}" - - run: "./after_deploy_1.sh" - - run: "./after_deploy_2.sh" - - uses: desiderati/github-action-pushover@v1 - with: - job-status: "${{ job.status }}" - pushover-api-token: '12345' - pushover-user-key: "${{ secrets.PUSHOVER_USER_KEY }}" - if: "${{ github.event_name != 'pull_request' }}" +name: valet-labs/travisci-deploy-example +on: + push: + branches: + - "**/*" + pull_request: +concurrency: +# # This item has no matching transformer +# maximum_number_of_builds: 0 +env: + DB: mysql +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - run: gem install bundler + - run: bundle install --jobs=3 --retry=3 + - run: rake + - run: echo 'ready?' +# # This item has no matching transformer +# - codedeploy: +# provider: codedeploy +# access_key_id: YOUR AWS ACCESS KEY +# secret_access_key: YOUR AWS SECRET KEY +# bucket: S3 Bucket +# key: latest/MyApp.zip +# application: MyApp +# deployment_group: MyDeploymentGroup +# if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}" + - run: "./after_deploy_1.sh" + - run: "./after_deploy_2.sh" + - uses: desiderati/github-action-pushover@v1 + with: + job-status: "${{ job.status }}" + pushover-api-token: '12345' + pushover-user-key: "${{ secrets.PUSHOVER_USER_KEY }}" + if: "${{ github.event_name != 'pull_request' }}" ``` diff --git a/travis/5-migrate.md b/travis/5-migrate.md index 8dcf3db..23abccc 100644 --- a/travis/5-migrate.md +++ b/travis/5-migrate.md @@ -14,7 +14,7 @@ In this lab, you will use the `migrate` command to convert a Travis CI pipeline Answer the following questions before running a `migrate` command: 1. What project do you want to migrate? - - __deploy-example__ + - __travisci-deploy-example__ 2. Where do you want to store the logs? - __./tmp/migrate__ 3. What is the URL for the GitHub repository to add the workflow to? @@ -25,12 +25,12 @@ Answer the following questions before running a `migrate` command: 1. Run the following `migrate` command in the codespace terminal. Ensure the values in `--target-url` for `:owner` and `:repo` are replaced with your values: ```bash - gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --travis-ci-repository "deploy-example" + gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --travis-ci-repository "travisci-deploy-example" ``` 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/190689859-d16a678b-f08f-44c1-a819-780ea967ecaf.png) + ![pr](https://user-images.githubusercontent.com/19557880/190726057-f90d31ed-69cc-457b-aab7-3ca21e16df68.png) 3. Open the generated pull request in a new browser tab. @@ -40,7 +40,7 @@ The first thing to notice about the pull request is that there is a list of manu Next, you can inspect the "Files changed" in this pull request and see the converted workflow that is being added. Any additional changes or code reviews that were needed should be done in this pull request. -![action-run](https://user-images.githubusercontent.com/19557880/190496147-2f8af72d-51d9-426b-94cf-5d0d7fe02eb3.png) +![action-run](https://user-images.githubusercontent.com/19557880/190726209-dd9ddc54-5ac7-4951-b525-24d76d4378ab.png) Finally, you can merge the pull request once your review has completed. You can then view the workflow running by selecting the "Actions" menu in the top navigation bar in GitHub. From 004756f006bedb12422adc5f88c10fc675ffcb90 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 13:54:58 -0700 Subject: [PATCH 23/39] Updated order so forecast is 3rd --- travis/2-audit.md | 2 +- travis/{6-forecast.md => 3-forecast.md} | 4 ++-- travis/{3-dry-run.md => 4-dry-run.md} | 2 +- travis/{4-custom-transformers.md => 5-custom-transformers.md} | 0 travis/{5-migrate.md => 6-migrate.md} | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename travis/{6-forecast.md => 3-forecast.md} (97%) rename travis/{3-dry-run.md => 4-dry-run.md} (98%) rename travis/{4-custom-transformers.md => 5-custom-transformers.md} (100%) rename travis/{5-migrate.md => 6-migrate.md} (96%) diff --git a/travis/2-audit.md b/travis/2-audit.md index a6a731d..39a0dbf 100644 --- a/travis/2-audit.md +++ b/travis/2-audit.md @@ -318,4 +318,4 @@ Each pipeline will have a variety of files written that include: ### Next lab -[Perform a dry-run of a Travis CI pipeline](3-dry-run.md) +[Forecast potential build runner usage](3-forecast.md) diff --git a/travis/6-forecast.md b/travis/3-forecast.md similarity index 97% rename from travis/6-forecast.md rename to travis/3-forecast.md index 66bcd30..88019f9 100644 --- a/travis/6-forecast.md +++ b/travis/3-forecast.md @@ -95,6 +95,6 @@ gh valet forecast --source-file-path tmp/**/jobs/*.json -o tmp/combined-forecast You can now inspect the output of the command to see a forecast report using all of the files matching the `tmp/**/jobs/*.json` pattern. -## Next steps +### Next Lab -This concludes all labs for migrating Travis CI pipelines to Actions with Valet! +[Perform a dry-run of a Travis CI pipeline](4-dry-run.md) diff --git a/travis/3-dry-run.md b/travis/4-dry-run.md similarity index 98% rename from travis/3-dry-run.md rename to travis/4-dry-run.md index a7ad1ff..ffebaa3 100644 --- a/travis/3-dry-run.md +++ b/travis/4-dry-run.md @@ -116,4 +116,4 @@ Despite these two pipelines using different syntax they will function equivalent ## Next lab -[Use custom transformers to customize Valet's behavior](./4-custom-transformers.md) +[Use custom transformers to customize Valet's behavior](./5-custom-transformers.md) diff --git a/travis/4-custom-transformers.md b/travis/5-custom-transformers.md similarity index 100% rename from travis/4-custom-transformers.md rename to travis/5-custom-transformers.md diff --git a/travis/5-migrate.md b/travis/6-migrate.md similarity index 96% rename from travis/5-migrate.md rename to travis/6-migrate.md index 23abccc..15f9aa6 100644 --- a/travis/5-migrate.md +++ b/travis/6-migrate.md @@ -46,6 +46,6 @@ Finally, you can merge the pull request once your review has completed. You can At this point, the migration has completed and you have successfully migrated a Travis CI pipeline to Actions! -### Next Lab +## Next steps -[Forecast potential build runner usage](6-forecast.md) +This concludes all labs for migrating Travis CI pipelines to Actions with Valet! From 434e4b948985f855231c2adebf3f6ca29e97fe28 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Fri, 16 Sep 2022 14:32:03 -0700 Subject: [PATCH 24/39] Updated ReadMe --- travis/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/travis/readme.md b/travis/readme.md index e27e59d..d1522d8 100644 --- a/travis/readme.md +++ b/travis/readme.md @@ -41,10 +41,10 @@ Perform the following labs to test-drive Valet 1. [Configure credentials for Valet](1-configure.md) 2. [Perform an audit of Travis CI](2-audit.md) -3. [Perform a dry-run of a Travis CI pipeline](3-dry-run.md) -4. [Use custom transformers to customize Valet's behavior](4-custom-transformers.md) -5. [Perform a production migration of a Travis CI pipeline](5-migrate.md) -6. [Forecast potential build runner usage](6-forecast.md) +3. [Forecast potential build runner usage](3-forecast.md) +4. [Perform a dry-run of a Travis CI pipeline](4-dry-run.md) +5. [Use custom transformers to customize Valet's behavior](5-custom-transformers.md) +6. [Perform a production migration of a Travis CI pipeline](6-migrate.md) ## Troubleshoot the Valet CLI From 3e056c05cd6c99d0cd2d6dd9be571372e5ed8921 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Mon, 19 Sep 2022 10:28:00 -0700 Subject: [PATCH 25/39] Copy edit text --- travis/1-configure.md | 52 ++++++++++++++++----------------- travis/3-forecast.md | 8 ++--- travis/4-dry-run.md | 6 ++-- travis/5-custom-transformers.md | 2 +- travis/6-migrate.md | 2 +- travis/readme.md | 34 +++++++++++---------- 6 files changed, 53 insertions(+), 51 deletions(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 5edee71..6b2bdc2 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -1,4 +1,4 @@ -# Configure credentials for Valet +a# Configure credentials for Valet In this lab, you will use the `configure` CLI command to set the required credentials and information for Valet to use when working with Travis CI and GitHub. @@ -6,37 +6,36 @@ You will need to complete all of the setup instructions [here](./readme.md#confi ## Configuring credentials -1. Create a GitHub Personal Access Token (PAT): +1. Create a GitHub personal access token (PAT): - Open github.com in a new browser tab. - - Click your profile photo in the top right of the UI and click `Settings`. - - Click on `Developer Settings` in the left hand panel. - - Click `Personal Access Tokens` and then `Legacy tokens` (if present). - - Click `Generate new token` and then `Legacy tokens`. You may be required to authenticate with GitHub during this step. - - Select the following scopes: `read:packages` and `workflow`. + - In the top right corner of the UI, click your profile photo and then click `Settings`. + - In the left panel, click `Developer Settings`. + - Click `Personal access tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `workflow` and `read:packages`. - Click `Generate token`. - - Copy the generated PAT and save in a safe location. + - Copy the generated PAT and save it in a safe location. -3. Create a Travis CI PAT: - - Open Travis CI in a new browser tab. +3. Create a Travis CI personal access token (PAT): + - Open app.travis-ci.com in a new browser tab. - Click on your profile icon in the top right hand corner to reveal a dropdown menu. - - Click on the 'Settings' tab. - - Click on the 'COPY TOKEN' button under "API authentication header" and save in a safe location. + - Click on the `Settings` tab. + - Click on the `COPY TOKEN` button under "API authentication header" and save it in a safe location. 2. Run the `configure` CLI command: - - Select the `TERMINAL` tab from within the codespace terminal window. + - Select the `TERMINAL` tab from within the codespace terminal. - Run the following command: `gh valet configure`. - - Using the down arrow key to highlight `Travis CI`, press the spacebar to select, and then hit enter to continue. - - At the prompt enter your GitHub Username and press enter. - - At the GitHub Container Registry prompt enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub PAT prompt enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default value (`https://github.com`). - - At the Travis CI token prompt enter the Travis CI access token from step 2 and press enter. - - At the Travis CI base url prompt hit enter to accept the default value (`https://travis-ci.com`). - - At the Travis CI organization name enter `valet-labs`. - - At the access token to fetch source code in GitHub prompt enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub instance url containing source code prompt press enter to accept the default value (`https://github.com`). + - Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue. + - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 2 and press enter. + - At the GitHub PAT prompt, enter the GitHub PAT generated in step 2 and press enter. + - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). + - At the Travis CI token prompt, enter the Travis CI access token from step 2 and press enter. + - At the Travis CI base url prompt, hit enter to accept the default value (`https://travis-ci.com`). + - At the Travis CI organization name, enter `valet-labs`. + - At the access token to fetch source code in GitHub prompt, enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub instance url containing source code prompt, press enter to accept the default value (`https://github.com`). - ![configure-cli-terminal](https://user-images.githubusercontent.com/19557880/190726544-b07dbc5f-6756-44f2-a24c-54bb3f4d0414.png) + ![configure-cli-terminal](https://user-images.githubusercontent.com/19557880/190726544-b07dbc5f-6756-44f2-a24c-54bb3f4d0414.png) ## Verify your environment @@ -50,7 +49,8 @@ To verify our environment is configured correctly, we are going to run the `upda 2. You should see a confirmation that you were logged into the GitHub Container Registry and Valet was updated to the latest version. - ```bash + ```console + $ gh valet update Login Succeeded latest: Pulling from valet-customers/valet-cli Digest: sha256:a7d00dee8a37e25da59daeed44b1543f476b00fa2c41c47f48deeaf34a215bbb @@ -60,4 +60,4 @@ To verify our environment is configured correctly, we are going to run the `upda ### Next lab -[Perform an audit of Travis CI](./2-audit.md) +[Perform an audit of a Travis CI organization](./2-audit.md) diff --git a/travis/3-forecast.md b/travis/3-forecast.md index 88019f9..e4eedf2 100644 --- a/travis/3-forecast.md +++ b/travis/3-forecast.md @@ -14,7 +14,7 @@ Answer the following questions before running the `forecast` command: 1. What is the date you want to start forecasting from? - **2022-09-02**. This date is needed as it is prior to when the bulk of builds were trigger in the demo Travis CI organization for these labs. This value defaults to the date one week ago, however, you should use a start date that will show a representative view of typical usage. 2. Where do you want to store the results? - - **./tmp/forecast_reports** + - **tmp/forecast** ### Steps @@ -22,7 +22,7 @@ Answer the following questions before running the `forecast` command: 2. Run the following command from the root directory: ```bash - gh valet forecast travis-ci --output-dir ./tmp/forecast_reports --start-date 2022-09-02 + gh valet forecast travis-ci --output-dir tmp/forecast --start-date 2022-09-02 ``` 3. The command will list all the files written to disk when the command succeeds. @@ -31,7 +31,7 @@ Answer the following questions before running the `forecast` command: ## Review the forecast report -The forecast report, logs, and completed job data will be located within the `tmp/forecast_reports` folder. +The forecast report, logs, and completed job data will be located within the `tmp/forecast` folder. 1. Find the `forecast_report.md` file in the file explorer. 2. Right-click the `forecast_report.md` file and select `Open Preview`. @@ -90,7 +90,7 @@ You can use the `--source-file-path` CLI option to combine data from multiple re Run the following command from within the codespace terminal: ```bash -gh valet forecast --source-file-path tmp/**/jobs/*.json -o tmp/combined-forecast +gh valet forecast --source-file-path tmp/**/jobs/*.json -o tmp/forecast-combined ``` You can now inspect the output of the command to see a forecast report using all of the files matching the `tmp/**/jobs/*.json` pattern. diff --git a/travis/4-dry-run.md b/travis/4-dry-run.md index ffebaa3..7fa7e10 100644 --- a/travis/4-dry-run.md +++ b/travis/4-dry-run.md @@ -16,7 +16,7 @@ You will be performing a dry-run against a TravisCI project. Answer the followin - __travisci-ruby-example__. This is one of the sample projects avaiable in the TravisCI labs-data organization. 2. Where do you want to store the result? - - __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from. + - __tmp/dry-run__. This can be any path within the working directory that Valet commands are executed from. ### Steps @@ -24,7 +24,7 @@ You will be performing a dry-run against a TravisCI project. Answer the followin 2. Run the following command from the root directory: ```bash - gh valet dry-run travis-ci --travis-ci-repository "travisci-ruby-example" --output-dir tmp/travis/dry-run-lab + gh valet dry-run travis-ci --travis-ci-repository "travisci-ruby-example" --output-dir tmp/dry-run ``` 3. The command will list all the files written to disk when the command succeeds. @@ -32,7 +32,7 @@ You will be performing a dry-run against a TravisCI project. Answer the followin ![command-result](https://user-images.githubusercontent.com/19557880/190724470-2936443e-d2f2-41f8-8470-28e313111036.png) 4. View the converted workflow: - - Find `./tmp/travis/dry-run-lab` in the file explorer pane in your codespace. + - Find `tmp/dry-run` in the file explorer pane in your codespace. - Click `travisci-ruby-example.yml` to open. ## Inspect the output files diff --git a/travis/5-custom-transformers.md b/travis/5-custom-transformers.md index 917d98d..81087d0 100644 --- a/travis/5-custom-transformers.md +++ b/travis/5-custom-transformers.md @@ -18,7 +18,7 @@ In this lab you will build upon the `dry-run` command to override Valet's defaul You will be performing a `dry-run` command to inspect the workflow that is converted by default. Run the following command within the codespace terminal: ```bash - gh valet dry-run travis-ci --travis-ci-repository "travisci-deploy-example" --output-dir tmp/travis/dry-run + gh valet dry-run travis-ci --travis-ci-repository "travisci-deploy-example" --output-dir tmp/dry-run ``` The converted workflow that is generated by the above command can be seen below: diff --git a/travis/6-migrate.md b/travis/6-migrate.md index 15f9aa6..70923b5 100644 --- a/travis/6-migrate.md +++ b/travis/6-migrate.md @@ -25,7 +25,7 @@ Answer the following questions before running a `migrate` command: 1. Run the following `migrate` command in the codespace terminal. Ensure the values in `--target-url` for `:owner` and `:repo` are replaced with your values: ```bash - gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --travis-ci-repository "travisci-deploy-example" + gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir tmp/migrate --travis-ci-repository "travisci-deploy-example" ``` 2. The command will write the URL to the pull request that was created when the command succeeds. diff --git a/travis/readme.md b/travis/readme.md index d1522d8..36d16f2 100644 --- a/travis/readme.md +++ b/travis/readme.md @@ -12,28 +12,29 @@ These steps **must** be completed prior to starting other labs. 1. Start a new Codespace. -- Click the `Code` with button down arrow above repository on the repository's landing page. -- Click the `Codespaces` tab -- Click `Create codespaces on main` to create the codespace. -- After the Codespace has initialized there will be a terminal present. + - Click the `Code` with button down arrow above repository on the repository's landing page. + - Click the `Codespaces` tab. + - Click `Create codespaces on main` to create the codespace. + - After the Codespace has initialized there will be a terminal present. 2. Verify the Valet CLI is installed and working. More information on the Valet extension for the official GitHub CLI can be found [here](https://github.com/github/gh-valet). -- Run the following command in the codespace's terminal: + - Run the following command in the codespace's terminal: - ```bash - gh valet version - ``` + ```bash + gh valet version + ``` -- Verify the output is similar to below. The version information may differ than what is shown below, it is expected that the `valet-cli` version is unknown. This will be corrected in the [configure credentials for Valet](1-configure.md) lab. + - Verify the output is similar to below. - ```bash - gh version 2.14.3 (2022-07-26) - gh valet github/gh-valet v0.1.12 - valet-cli unknown - ``` + ```console + $ gh valet version + gh version 2.14.3 (2022-07-26) + gh valet github/gh-valet v0.1.12 + valet-cli unknown + ``` - - If `gh valet version` did not produce similar output then please follow the troubleshooting [guide](#troubleshoot-the-valet-cli). + - If `gh valet version` did not produce similar output then please follow the troubleshooting [guide](#troubleshoot-the-valet-cli). ## Labs for Travis CI @@ -59,7 +60,8 @@ The CLI extension for Valet can be manually installed by following these steps: - Verify the result of the install contains: - ```bash + ```console + $ gh extension install github/gh-valet βœ“ Installed extension github/gh-valet ``` From f848c682f3192a7dbb932535c649d101734d4b09 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Mon, 19 Sep 2022 12:55:34 -0700 Subject: [PATCH 26/39] Set DOCKER_ARGS variable in codespace --- .devcontainer/devcontainer.json | 3 +++ gitlab/bootstrap/setup.sh | 4 ---- jenkins/bootstrap/setup.sh | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f1f0b7a..40f6a92 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,6 +13,9 @@ "--privileged", "--init" ], + "remoteEnv": { + "DOCKER_ARGS": "--network=host" + }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ "ms-azuretools.vscode-docker" diff --git a/gitlab/bootstrap/setup.sh b/gitlab/bootstrap/setup.sh index 021ce64..27006ba 100755 --- a/gitlab/bootstrap/setup.sh +++ b/gitlab/bootstrap/setup.sh @@ -33,10 +33,6 @@ else docker exec -it gitlab update-permissions &> /dev/null fi -# allow valet to talk to GitLab by removing network isolation between containers -export DOCKER_ARGS="--network=host" -`grep -q "export DOCKER_ARGS=" ~/.bashrc || echo 'export DOCKER_ARGS="--network=host"' >> ~/.bashrc` - echo -e "Waiting for GitLab to be ready. This might take a while \U23F0" until $(curl --output /dev/null --silent --head --fail http://localhost); do printf '.' diff --git a/jenkins/bootstrap/setup.sh b/jenkins/bootstrap/setup.sh index 5947fa4..e843745 100755 --- a/jenkins/bootstrap/setup.sh +++ b/jenkins/bootstrap/setup.sh @@ -18,10 +18,6 @@ else docker run -d --name jenkins -p 8080:8080 --env JENKINS_ADMIN_ID=$username --env JENKINS_ADMIN_PASSWORD=$password jenkins:$container_name fi -# allow valet to talk to Jenkins by removing network isolation between containers -export DOCKER_ARGS="--network=host" -grep -q "export DOCKER_ARGS=" ~/.bashrc || echo 'export DOCKER_ARGS="--network=host"' >> ~/.bashrc - echo -e "\nWaiting for Jenkins to start..." while ! curl -s http://localhost:8080/ > /dev/null; do printf "." From cf5156055a957a4cfb3c56565dce7acc74863e3b Mon Sep 17 00:00:00 2001 From: Nate Rickard Date: Mon, 19 Sep 2022 16:58:24 -0400 Subject: [PATCH 27/39] output to tmp/dry-run for consistency --- gitlab/5-custom-transformers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/5-custom-transformers.md b/gitlab/5-custom-transformers.md index 7466dc9..cce52f3 100644 --- a/gitlab/5-custom-transformers.md +++ b/gitlab/5-custom-transformers.md @@ -18,7 +18,7 @@ In this lab you will build upon the `dry-run` command to override Valet's defaul You will be performing a `dry-run` command to inspect the workflow that is converted by default. Run the following command within the codespace terminal: ```bash -gh valet dry-run gitlab --output-dir tmp --namespace valet --project terraform-example +gh valet dry-run gitlab --output-dir tmp/dry-run --namespace valet --project terraform-example ``` The converted workflow that is generated by the above command can be seen below: @@ -95,7 +95,7 @@ This method can use any valid ruby syntax and should return a `Hash` that repres Now you can perform another `dry-run` command and use the `--custom-transformers` CLI option to provide this custom transformer. Run the following command within your codespace terminal: ```bash -gh valet dry-run gitlab --output-dir tmp --namespace valet --project terraform-example --custom-transformers transformers.rb +gh valet dry-run gitlab --output-dir tmp/dry-run --namespace valet --project terraform-example --custom-transformers transformers.rb ``` The converted workflow that is generated by the above command will now use the custom logic for the `artifacts.terraform` step. From f7a72f901ddbdf54bbcd97fe5cf39973c6ff884b Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Mon, 19 Sep 2022 14:02:05 -0700 Subject: [PATCH 28/39] Add default settings in codespace --- .devcontainer/devcontainer.json | 44 +++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 40f6a92..4f970ad 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,23 +2,29 @@ "name": "Codespace to perform Valet Labs", "image": "mcr.microsoft.com/vscode/devcontainers/universal:linux", "remoteUser": "codespace", - "overrideCommand": false, - "mounts": [ - "source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume" - ], - "runArgs": [ - "--cap-add=SYS_PTRACE", - "--security-opt", - "seccomp=unconfined", - "--privileged", - "--init" - ], - "remoteEnv": { + "overrideCommand": false, + "mounts": [ + "source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume" + ], + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--privileged", + "--init" + ], + "remoteEnv": { "DOCKER_ARGS": "--network=host" - }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-azuretools.vscode-docker" - ], - "postCreateCommand": "gh extension install github/gh-valet || echo 'Could not auto-build. Skipping.' " -} + }, + "customizations": { + "vscode": { + "settings": { + "files.autoSave": "onFocusChange" + }, + "extensions": [ + "ms-azuretools.vscode-docker" + ] + } + }, + "postCreateCommand": "gh extension install github/gh-valet || echo 'Could not auto-build. Skipping.' " +} \ No newline at end of file From aa600253560d3fa58ad58c264d015a1980ea1c54 Mon Sep 17 00:00:00 2001 From: Nate Rickard Date: Mon, 19 Sep 2022 17:03:40 -0400 Subject: [PATCH 29/39] clarify placement of env --- azure_devops/5-custom-transformers.md | 2 +- gitlab/5-custom-transformers.md | 2 +- jenkins/5-custom-transformers.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure_devops/5-custom-transformers.md b/azure_devops/5-custom-transformers.md index 8b2658a..5b72d1f 100644 --- a/azure_devops/5-custom-transformers.md +++ b/azure_devops/5-custom-transformers.md @@ -149,7 +149,7 @@ Open the workflow that is generated and inspect the contents. Now the `DotnetCor You can also use custom transformers to edit the values of environment variables in converted workflows. In this example, you will be updating the `BUILDCONFIGURATION` environment variable to be `Debug` instead of `Release`. -To do this, add the following code to the `transformers.rb` file. +To do this, add the following code at the top of the `transformers.rb` file. ```ruby env "BUILDCONFIGURATION", "Debug" diff --git a/gitlab/5-custom-transformers.md b/gitlab/5-custom-transformers.md index cce52f3..77a5fca 100644 --- a/gitlab/5-custom-transformers.md +++ b/gitlab/5-custom-transformers.md @@ -119,7 +119,7 @@ end You can also use custom transformers to edit the values of environment variables in converted workflows. In this example, you will update the `PLAN_JSON` environment variable to be `custom_plan.json` instead of `plan.json`. -To do this, add the following code to the `transformers.rb` file. +To do this, add the following code at the top of the `transformers.rb` file. ```ruby env "PLAN_JSON", "custom_plan.json" diff --git a/jenkins/5-custom-transformers.md b/jenkins/5-custom-transformers.md index 91a9f6e..913fab4 100644 --- a/jenkins/5-custom-transformers.md +++ b/jenkins/5-custom-transformers.md @@ -205,7 +205,7 @@ Now you can perform another `dry-run` command with the `--custom-transformers` C You can also use custom transformers to edit the values of environment variables in converted workflows. In this example, you will be updating the `DB_ENGINE` environment variable to be `mongodb` instead of `sqlite`. -To do this, add the following code to the `transformers.rb` file. +To do this, add the following code at the top of the `transformers.rb` file. ```ruby env "DB_ENGINE", "mongodb" From 216b844d6bd75485acdfbb192a0b73c003360f4b Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Mon, 19 Sep 2022 15:19:57 -0700 Subject: [PATCH 30/39] Set installation_type to labs --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4f970ad..ba5c350 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,8 @@ "--init" ], "remoteEnv": { - "DOCKER_ARGS": "--network=host" + "DOCKER_ARGS": "--network=host", + "INSTALLATION_TYPE": "labs" }, "customizations": { "vscode": { From 59b717f5460cf60b1a56239276a9866a75ee8d78 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Mon, 19 Sep 2022 16:46:46 -0700 Subject: [PATCH 31/39] Update .devcontainer/devcontainer.json Co-authored-by: Luke Cheung Engle <99493186+luke-engle@users.noreply.github.com> --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ba5c350..7145591 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,8 @@ "customizations": { "vscode": { "settings": { - "files.autoSave": "onFocusChange" + "files.autoSave": "onFocusChange", + "editor.tabSize": 2 }, "extensions": [ "ms-azuretools.vscode-docker" From 581b03c24a0b4db5edd8325537a46dd45f9717f1 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 11:35:13 -0700 Subject: [PATCH 32/39] Apply suggestions from code review --- travis/3-forecast.md | 9 ++++++++- travis/4-dry-run.md | 7 ++++++- travis/5-custom-transformers.md | 16 ++++++++-------- travis/6-migrate.md | 6 +++++- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/travis/3-forecast.md b/travis/3-forecast.md index e4eedf2..f62f883 100644 --- a/travis/3-forecast.md +++ b/travis/3-forecast.md @@ -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 diff --git a/travis/4-dry-run.md b/travis/4-dry-run.md index 7fa7e10..f30a77f 100644 --- a/travis/4-dry-run.md +++ b/travis/4-dry-run.md @@ -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. diff --git a/travis/5-custom-transformers.md b/travis/5-custom-transformers.md index 81087d0..6531102 100644 --- a/travis/5-custom-transformers.md +++ b/travis/5-custom-transformers.md @@ -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 diff --git a/travis/6-migrate.md b/travis/6-migrate.md index 70923b5..c701903 100644 --- a/travis/6-migrate.md +++ b/travis/6-migrate.md @@ -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. From 61919e42885cb0666ad133b1d9e58ce348dd577b Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 11:35:30 -0700 Subject: [PATCH 33/39] Update travis/2-audit.md --- travis/2-audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/2-audit.md b/travis/2-audit.md index 39a0dbf..a7bf042 100644 --- a/travis/2-audit.md +++ b/travis/2-audit.md @@ -18,7 +18,7 @@ The `audit` command operates by performing the following: You will be performing an audit against the **labs-data** Travis CI organization that was created for the purposes of this lab. Your environment was configured to use this organization during the [configure lab](./1-configure.md). The remaining information needed to perform an `audit` is: 1. Where do we want to store the result? - - **./tmp/audit**. This can be any path within the working directory that Valet commands are executed from. + - **tmp/audit**. This can be any path within the working directory that Valet commands are executed from. ### Steps From 18cec2ca5480e7582c4b33db34735f0178645a0a Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 11:56:57 -0700 Subject: [PATCH 34/39] Update 1-configure.md --- travis/1-configure.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 6b2bdc2..00ddf1a 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -32,10 +32,20 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - At the Travis CI token prompt, enter the Travis CI access token from step 2 and press enter. - At the Travis CI base url prompt, hit enter to accept the default value (`https://travis-ci.com`). - At the Travis CI organization name, enter `valet-labs`. - - At the access token to fetch source code in GitHub prompt, enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub instance url containing source code prompt, press enter to accept the default value (`https://github.com`). - ![configure-cli-terminal](https://user-images.githubusercontent.com/19557880/190726544-b07dbc5f-6756-44f2-a24c-54bb3f4d0414.png) + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: CircleCI + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Personal access token for CircleCI: *************** + βœ” Base url of the CircleCI instance: https://circleci.com + βœ” CircleCI organization name: valet-labs + Environment variables successfully updated. + ``` ## Verify your environment From 81511f72016bbab2924728800ea3e424965965c2 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 11:57:21 -0700 Subject: [PATCH 35/39] Update 1-configure.md --- travis/1-configure.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 00ddf1a..886dceb 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -33,19 +33,19 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - At the Travis CI base url prompt, hit enter to accept the default value (`https://travis-ci.com`). - At the Travis CI organization name, enter `valet-labs`. - ```console - $ gh valet configure - βœ” Which CI providers are you configuring?: CircleCI - Enter the following values (leave empty to omit): - βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona - βœ” Personal access token to authenticate with the GitHub Container Registry: *************** - βœ” Personal access token for GitHub: *************** - βœ” Base url of the GitHub instance: https://github.com - βœ” Personal access token for CircleCI: *************** - βœ” Base url of the CircleCI instance: https://circleci.com - βœ” CircleCI organization name: valet-labs - Environment variables successfully updated. - ``` + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: CircleCI + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Personal access token for CircleCI: *************** + βœ” Base url of the CircleCI instance: https://circleci.com + βœ” CircleCI organization name: valet-labs + Environment variables successfully updated. + ``` ## Verify your environment From 607904025c46ca1fd70af2cddf3e9b287b88fae7 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 11:57:32 -0700 Subject: [PATCH 36/39] Update 1-configure.md --- travis/1-configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 886dceb..86ba99d 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -1,4 +1,4 @@ -a# Configure credentials for Valet +# Configure credentials for Valet In this lab, you will use the `configure` CLI command to set the required credentials and information for Valet to use when working with Travis CI and GitHub. From a11044361ed349f22c0d686fa59f6de597be5311 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 12:05:36 -0700 Subject: [PATCH 37/39] More img -> text --- azure_devops/1-configure.md | 86 +++++++++++++++++++++---------------- circle_ci/1-configure.md | 54 ++++++++++++++--------- gitlab/1-configure.md | 65 ++++++++++++++++------------ jenkins/1-configure.md | 68 +++++++++++++++++------------ 4 files changed, 160 insertions(+), 113 deletions(-) diff --git a/azure_devops/1-configure.md b/azure_devops/1-configure.md index 0f0fc00..e9e4e57 100644 --- a/azure_devops/1-configure.md +++ b/azure_devops/1-configure.md @@ -7,48 +7,60 @@ You will need to complete all of the setup instructions [here](./readme.md#confi ## Configuring credentials 1. Create an Azure DevOps personal access token (PAT). - - __Note__: you can skip this step if you still have the PAT created during the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization). - - Navigate to your existing organization () in your browser. - - In the top right corner of your screen, click `User settings`. - - Click `Personal access tokens`. - - Select `+ New Token` - - Name your token, select the organization where you want to use the token, and set your token to automatically expire after a set number of days. - - Select the following scopes (you may need to `Show more scopes` to reveal all scopes): - - Agents Pool: `Read` - - Build: `Read & Execute` - - Code: `Read & Write` - - Project and Team: `Read, Write, & Manage` - - Release: `Read` - - Service Connections: `Read` - - Task Groups: `Read` - - Variable Groups: `Read` - - Click `Create`. - - Copy the generated API token and save it in a safe location. + __Note__: you can skip this step if you still have the PAT created during the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization). + - Navigate to your existing organization () in your browser. + - In the top right corner of your screen, click `User settings`. + - Click `Personal access tokens`. + - Select `+ New Token` + - Name your token, select the organization where you want to use the token, and set your token to automatically expire after a set number of days. + - Select the following scopes (you may need to `Show more scopes` to reveal all scopes): + - Agents Pool: `Read` + - Build: `Read & Execute` + - Code: `Read & Write` + - Project and Team: `Read, Write, & Manage` + - Release: `Read` + - Service Connections: `Read` + - Task Groups: `Read` + - Variable Groups: `Read` + - Click `Create`. + - Copy the generated API token and save it in a safe location. 2. Create a GitHub personal access token (PAT): - - Open github.com in a new browser tab. - - In the top right corner of the UI, click your profile photo and then click `Settings`. - - In the left panel, click `Developer Settings`. - - Click `Personal access tokens` and then `Legacy tokens` (if present). - - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. - - Select the following scopes: `workflow` and `read:packages`. - - Click `Generate token`. - - Copy the generated PAT and save it in a safe location. + - Open github.com in a new browser tab. + - In the top right corner of the UI, click your profile photo and then click `Settings`. + - In the left panel, click `Developer Settings`. + - Click `Personal access tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `workflow` and `read:packages`. + - Click `Generate token`. + - Copy the generated PAT and save it in a safe location. 3. Run the `configure` CLI command: - - Select the `TERMINAL` tab from within the codespace terminal. - - Run the following command: `gh valet configure`. - - Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue. - - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 2 and press enter. - - At the GitHub PAT prompt, enter the GitHub PAT generated in step 2 and press enter. - - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). - - At the Azure DevOps token prompt, enter the access token from step 1 and press enter. - - At the Azure DevOps URL prompt, enter your Azure DevOps URL or press enter to accept the default value (`https://dev.azure.com`). - - At the prompt, enter your Azure DevOps organization name. This should be the same organization used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization). - - At the prompt, enter your Azure DevOps project name. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization). + - Select the `TERMINAL` tab from within the codespace terminal. + - Run the following command: `gh valet configure`. + - Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue. + - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 2 and press enter. + - At the GitHub PAT prompt, enter the GitHub PAT generated in step 2 and press enter. + - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). + - At the Azure DevOps token prompt, enter the access token from step 1 and press enter. + - At the Azure DevOps URL prompt, enter your Azure DevOps URL or press enter to accept the default value (`https://dev.azure.com`). + - At the prompt, enter your Azure DevOps organization name. This should be the same organization used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization). + - At the prompt, enter your Azure DevOps project name. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization). - ![img](https://user-images.githubusercontent.com/18723510/187771230-27c97889-d98a-48f7-af01-c1a9f8df6423.png) + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: Azure DevOps + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Personal access token for Azure DevOps: *************** + βœ” Base url of the Azure DevOps instance: https://dev.azure.com + βœ” Azure DevOps organization name: :organization + βœ” Azure DevOps project name: :project + Environment variables successfully updated. + ``` ## Verify your environment diff --git a/circle_ci/1-configure.md b/circle_ci/1-configure.md index 5214d16..16c05de 100644 --- a/circle_ci/1-configure.md +++ b/circle_ci/1-configure.md @@ -7,32 +7,44 @@ You will need to complete all of the setup instructions [here](./readme.md#confi ## Configuring credentials 1. Create a GitHub Personal Access Token (PAT): - - Open github.com in a new browser tab. - - Click your profile photo in the top right of the UI and click `Settings`. - - Click on `Developer Settings` in the left hand panel. - - Click `Personal Access Tokens` and then `Legacy tokens` (if present). - - Click `Generate new token` and then `Legacy tokens`. You may be required to authenticate with GitHub during this step. - - Select the following scopes: `read:packages` and `workflow`. - - Click `Generate token`. - - Copy the generated PAT and save in a safe location. + - Open github.com in a new browser tab. + - Click your profile photo in the top right of the UI and click `Settings`. + - Click on `Developer Settings` in the left hand panel. + - Click `Personal Access Tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Legacy tokens`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `read:packages` and `workflow`. + - Click `Generate token`. + - Copy the generated PAT and save in a safe location. 3. Create a CircleCI personal API token using CircleCI's [documentation](https://circleci.com/docs/managing-api-tokens#creating-a-personal-api-token) and store the token in a safe location. 2. Run the `configure` CLI command: - - Select the `TERMINAL` tab from within the codespace terminal window. - - Run the following command: `gh valet configure`. - - Using the down arrow key to highlight `CircleCI`, press the spacebar to select, and then hit enter to continue. - - At the GitHub handle prompt, enter the GitHub username used to generate the GitHub PAT in step 2 and press enter. - - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub PAT prompt, enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub url prompt, enter the GitHub instance url or hit enter to accept the default value (`https://github.com`). - - At the CircleCI token prompt, enter the CircleCI access token from step 2 and press enter. - - At the CircleCI base url prompt, hit enter to accept the default value (`https://circleci.com`). - - At the CircleCI organization name prompt, enter `valet-labs`. This is the organization we'll be using throughout these labs. - - At the access token to fetch source code in GitHub prompt, enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub instance url containing source code prompt, press enter to accept the default value (`https://github.com`). + - Select the `TERMINAL` tab from within the codespace terminal window. + - Run the following command: `gh valet configure`. + - Using the down arrow key to highlight `CircleCI`, press the spacebar to select, and then hit enter to continue. + - At the GitHub handle prompt, enter the GitHub username used to generate the GitHub PAT in step 2 and press enter. + - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub PAT prompt, enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub url prompt, enter the GitHub instance url or hit enter to accept the default value (`https://github.com`). + - At the CircleCI token prompt, enter the CircleCI access token from step 2 and press enter. + - At the CircleCI base url prompt, hit enter to accept the default value (`https://circleci.com`). + - At the CircleCI organization name prompt, enter `valet-labs`. This is the organization we'll be using throughout these labs. + - At the access token to fetch source code in GitHub prompt, enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub instance url containing source code prompt, press enter to accept the default value (`https://github.com`). - ![configure-screenshot](https://user-images.githubusercontent.com/18723510/188935436-308fa6d3-6eb7-48b9-bbf0-20ab0cdae411.png) + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: CircleCI + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Personal access token for CircleCI: *************** + βœ” Base url of the CircleCI instance: https://circleci.com + βœ” CircleCI organization name: valet-labs + Environment variables successfully updated. + ``` ## Verify your environment diff --git a/gitlab/1-configure.md b/gitlab/1-configure.md index 6a00435..759c950 100644 --- a/gitlab/1-configure.md +++ b/gitlab/1-configure.md @@ -13,40 +13,51 @@ You will need to complete all of the setup instructions [here](./readme.md#confi ``` 2. Open the GitLab server in a new browser tab: - - Click the `PORTS` tab in the codespace terminal window. - - In the `PORTS` tab find the row for port 80. - - Hover over the address under the `Local Address` column and click the globe to "open in browser". + - Click the `PORTS` tab in the codespace terminal window. + - In the `PORTS` tab find the row for port 80. + - Hover over the address under the `Local Address` column and click the globe to "open in browser". 3. Create a GitLab personal access token (PAT): - - Authenticate with the GitLab server using the following credentials: - - Username: `root` - - Password: `valet-labs!` - - Follow the GitLab [instructions](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) to generate a PAT. - - Ensure the token has the `read_api` scope. - - Copy the generated token and save it in a safe location. + - Authenticate with the GitLab server using the following credentials: + - Username: `root` + - Password: `valet-labs!` + - Follow the GitLab [instructions](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) to generate a PAT. + - Ensure the token has the `read_api` scope. + - Copy the generated token and save it in a safe location. 4. Create a GitHub personal access token (PAT): - - Open github.com in a new browser tab. - - In the top right corner of the UI, click your profile photo and click `Settings`. - - In the left panel, click `Developer Settings`. - - Click `Personal access tokens` and then `Legacy tokens` (if present). - - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. - - Select the following scopes: `workflow` and `read:packages`. - - Click `Generate token`. - - Copy the generated PAT and save it in a safe location. + - Open github.com in a new browser tab. + - In the top right corner of the UI, click your profile photo and click `Settings`. + - In the left panel, click `Developer Settings`. + - Click `Personal access tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `workflow` and `read:packages`. + - Click `Generate token`. + - Copy the generated PAT and save it in a safe location. 5. Run the `configure` CLI command: - - Select the `TERMINAL` tab from within the codespace terminal window. - - Run the following command: `gh valet configure`. - - Use the down arrow key to highlight `GitLab CI`, press the spacebar to select, and then press enter to continue. - - At the prompt, enter your GitHub username and press enter. - - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 4 and press enter. - - At the GitHub PAT prompt, enter the GitHub PAT generated in step 4 and press enter. - - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). - - At the GitLab CI token prompt, enter the GitLab CI access token from step 3 and press enter. - - At the GitLab CI URL prompt, enter `http://localhost` and press enter. + - Select the `TERMINAL` tab from within the codespace terminal window. + - Run the following command: `gh valet configure`. + - Use the down arrow key to highlight `GitLab CI`, press the spacebar to select, and then press enter to continue. + - At the prompt, enter your GitHub username and press enter. + - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 4 and press enter. + - At the GitHub PAT prompt, enter the GitHub PAT generated in step 4 and press enter. + - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). + - At the GitLab CI token prompt, enter the GitLab CI access token from step 3 and press enter. + - At the GitLab CI URL prompt, enter `http://localhost` and press enter. - ![img](https://user-images.githubusercontent.com/18723510/183990474-d0b2559c-d2bf-40d9-ac43-19af53e45329.png) + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: GitLab CI + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Private token for GitLab: *************** + βœ” Base url of the GitLab instance: https://gitlab.com + Environment variables successfully updated. + ``` ## Verify your environment diff --git a/jenkins/1-configure.md b/jenkins/1-configure.md index 8128140..b798761 100644 --- a/jenkins/1-configure.md +++ b/jenkins/1-configure.md @@ -7,40 +7,52 @@ You will need to complete all of the setup instructions [here](./readme.md#confi ## Configuring credentials 1. Open the Jenkins server in a new browser tab: - - Click the `PORTS` tab in the codespace terminal window. - - In the `PORTS` tab, find the row for port 8080. - - Hover over the address under the `Local Address` column and click the globe to "open in browser". + - Click the `PORTS` tab in the codespace terminal window. + - In the `PORTS` tab, find the row for port 8080. + - Hover over the address under the `Local Address` column and click the globe to "open in browser". 2. Create a Jenkins API token: - - In the top right menu bar, click the `admin` button. - - In the left panel, click the `Configure` gear. - - In the `API token` section, click the `Add new Token` button and click `Generate`. - - Copy the generated API token and save it in a safe location. + - In the top right menu bar, click the `admin` button. + - In the left panel, click the `Configure` gear. + - In the `API token` section, click the `Add new Token` button and click `Generate`. + - Copy the generated API token and save it in a safe location. - ![img](https://user-images.githubusercontent.com/19557880/184041667-d06cb7f2-a885-474e-b728-7567314aeaf3.png) + ![img](https://user-images.githubusercontent.com/19557880/184041667-d06cb7f2-a885-474e-b728-7567314aeaf3.png) 3. Create a GitHub personal access token (PAT): - - Open github.com in a new browser tab. - - In the top right corner of the UI, click your profile photo and click `Settings`. - - In the left panel, click `Developer Settings`. - - Click `Personal access tokens` and then `Legacy tokens` (if present). - - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. - - Select the following scopes: `workflow` and `read:packages`. - - Click `Generate token`. - - Copy the generated PAT and save it in a safe location. -4. Run the `configure` CLI command: - - Select the `TERMINAL` tab from within the codespace terminal window. - - Run the following command: `gh valet configure`. - - Use the down arrow key to highlight `Jenkins`, press the spacebar to select, and then press enter to continue. - - At the prompt, enter your GitHub username and press enter. - - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 3 and press enter. - - At the GitHub PAT prompt, enter the GitHub PAT generated in step 3 and press enter. - - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). - - At the Jenkins token prompt, enter the Jenkins access token from step 2 and press enter. - - At the Jenkins URL prompt, enter `http://localhost:8080/` and press enter. - - At the Personal access token to fetch source code in GitHub prompt, press enter to accept the default value. + - Open github.com in a new browser tab. + - In the top right corner of the UI, click your profile photo and click `Settings`. + - In the left panel, click `Developer Settings`. + - Click `Personal access tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `workflow` and `read:packages`. + - Click `Generate token`. + - Copy the generated PAT and save it in a safe location. - ![img](https://user-images.githubusercontent.com/19557880/184041328-ce54ea22-b0cd-4c84-b02c-10ad7b09ad89.png) +4. Run the `configure` CLI command: + - Select the `TERMINAL` tab from within the codespace terminal window. + - Run the following command: `gh valet configure`. + - Use the down arrow key to highlight `Jenkins`, press the spacebar to select, and then press enter to continue. + - At the prompt, enter your GitHub username and press enter. + - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 3 and press enter. + - At the GitHub PAT prompt, enter the GitHub PAT generated in step 3 and press enter. + - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). + - At the Jenkins token prompt, enter the Jenkins access token from step 2 and press enter. + - At the Jenkins URL prompt, enter `http://localhost:8080/` and press enter. + + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: Jenkins + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Personal access token for Jenkins: *************** + βœ” Username of Jenkins user: admin + βœ” Base url of the Jenkins instance: https://localhost + Environment variables successfully updated. + ``` ## Verify your environment From a708b585421ef33a9dc32971edd66ec5a30f5e73 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 12:08:48 -0700 Subject: [PATCH 38/39] Img to text --- travis/1-configure.md | 68 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/travis/1-configure.md b/travis/1-configure.md index 86ba99d..c0d6dfb 100644 --- a/travis/1-configure.md +++ b/travis/1-configure.md @@ -7,45 +7,45 @@ You will need to complete all of the setup instructions [here](./readme.md#confi ## Configuring credentials 1. Create a GitHub personal access token (PAT): - - Open github.com in a new browser tab. - - In the top right corner of the UI, click your profile photo and then click `Settings`. - - In the left panel, click `Developer Settings`. - - Click `Personal access tokens` and then `Legacy tokens` (if present). - - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. - - Select the following scopes: `workflow` and `read:packages`. - - Click `Generate token`. - - Copy the generated PAT and save it in a safe location. + - Open github.com in a new browser tab. + - In the top right corner of the UI, click your profile photo and then click `Settings`. + - In the left panel, click `Developer Settings`. + - Click `Personal access tokens` and then `Legacy tokens` (if present). + - Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step. + - Select the following scopes: `workflow` and `read:packages`. + - Click `Generate token`. + - Copy the generated PAT and save it in a safe location. 3. Create a Travis CI personal access token (PAT): - - Open app.travis-ci.com in a new browser tab. - - Click on your profile icon in the top right hand corner to reveal a dropdown menu. - - Click on the `Settings` tab. - - Click on the `COPY TOKEN` button under "API authentication header" and save it in a safe location. + - Open app.travis-ci.com in a new browser tab. + - Click on your profile icon in the top right hand corner to reveal a dropdown menu. + - Click on the `Settings` tab. + - Click on the `COPY TOKEN` button under "API authentication header" and save it in a safe location. 2. Run the `configure` CLI command: - - Select the `TERMINAL` tab from within the codespace terminal. - - Run the following command: `gh valet configure`. - - Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue. - - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 2 and press enter. - - At the GitHub PAT prompt, enter the GitHub PAT generated in step 2 and press enter. - - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). - - At the Travis CI token prompt, enter the Travis CI access token from step 2 and press enter. - - At the Travis CI base url prompt, hit enter to accept the default value (`https://travis-ci.com`). - - At the Travis CI organization name, enter `valet-labs`. + - Select the `TERMINAL` tab from within the codespace terminal. + - Run the following command: `gh valet configure`. + - Use the down arrow key to highlight `Travis CI`, press the spacebar to select, and then press enter to continue. + - At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 2 and press enter. + - At the GitHub PAT prompt, enter the GitHub PAT generated in step 2 and press enter. + - At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`). + - At the Travis CI token prompt, enter the Travis CI access token from step 2 and press enter. + - At the Travis CI base url prompt, hit enter to accept the default value (`https://travis-ci.com`). + - At the Travis CI organization name, enter `valet-labs`. - ```console - $ gh valet configure - βœ” Which CI providers are you configuring?: CircleCI - Enter the following values (leave empty to omit): - βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona - βœ” Personal access token to authenticate with the GitHub Container Registry: *************** - βœ” Personal access token for GitHub: *************** - βœ” Base url of the GitHub instance: https://github.com - βœ” Personal access token for CircleCI: *************** - βœ” Base url of the CircleCI instance: https://circleci.com - βœ” CircleCI organization name: valet-labs - Environment variables successfully updated. - ``` + ```console + $ gh valet configure + βœ” Which CI providers are you configuring?: Travis CI + Enter the following values (leave empty to omit): + βœ” GitHub handle used to authenticate with the GitHub Container Registry: mona + βœ” Personal access token to authenticate with the GitHub Container Registry: *************** + βœ” Personal access token for GitHub: *************** + βœ” Base url of the GitHub instance: https://github.com + βœ” Personal access token for Travis CI: *************** + βœ” Base url of the Travis CI instance: https://travis-ci.com + βœ” Travis CI organization name: valet-labs + Environment variables successfully updated. + ``` ## Verify your environment From d27d8c45a1025168472f1de752bf03f4b439c558 Mon Sep 17 00:00:00 2001 From: Ethan Dennis Date: Tue, 20 Sep 2022 12:13:40 -0700 Subject: [PATCH 39/39] Update readme.md --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index c27d48f..775d800 100644 --- a/readme.md +++ b/readme.md @@ -12,4 +12,5 @@ To get started: - [Migrations from CircleCI to GitHub Actions](/circle_ci/readme.md) - [Migrations from GitLab CI to GitHub Actions](/gitlab/readme.md) - [Migrations from Jenkins to GitHub Actions](/jenkins/readme.md) + - [Migrations from Travis CI to GitHub Actions](/travis/readme.md) 3. Each learning path describes how to configure your codespace, bootstrap a CI/CD environment, and troubleshoot the Valet CLI.