diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2d24e49..13da778f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,14 +8,6 @@ Please note that this project is released with a [Contributor Code of Conduct](C Here's some helpful notes on how to contribute to this project, including details on how to get started working the codebase. -## How to submit a bug or request a feature - -If you think you've found a bug or have a great idea for new functionality please create an issue in this repo. - -## How to provide feedback or ask for help - -Use the [Discussions](https://github.com/github/gh-actions-importer/discussions) tab in this repo for more general feedback or any questions/comments on this tooling. - ## Configure your development environment To get started, you'll need [.NET Core 6.0](https://dotnet.microsoft.com/en-us/download) installed on your local machine. @@ -37,7 +29,3 @@ Code linting can be run using the following command: ```bash $ dotnet format src/ActionsImporter.sln ``` - -## Submitting a Pull Request - -Before submitting a Pull Request please first open an issue to get feedback on the change you intend to submit. diff --git a/LICENSE b/LICENSE index 32c3074c..abb16636 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 GitHub +Copyright (c) 2023 GitHub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 15029614..1e4b697d 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,7 @@ [![.github/workflows/ci.yml](https://github.com/github/gh-actions-importer/actions/workflows/ci.yml/badge.svg)](https://github.com/github/gh-actions-importer/actions/workflows/ci.yml) -[GitHub Actions Importer](https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer) helps plan, forecast, and automate the migration of Azure DevOps, CircleCI, GitLab, Jenkins, and Travis CI pipelines to GitHub Actions. This repository provides functionality that extends the [GitHub CLI](https://cli.github.com/) to migrate pipelines using the GitHub Actions Importer. - -> **Note**: Sign up [here](https://github.com/features/actions-importer/signup) to request access to the public preview for GitHub Actions Importer. Once you are granted access you'll be able to use the `gh-actions-importer` CLI extension - -You can request support [here](https://support.github.com/contact?tags=actions_importer_beta) on a best-effort basis during the public preview period. - -## Supported platforms - -GitHub Actions Importer currently supports migrating pipelines to GitHub Actions from the following platforms: +[GitHub Actions Importer](https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer) helps plan, test, and automate your migration to GitHub Actions from the following platforms: - Azure DevOps - CircleCI @@ -18,9 +10,7 @@ GitHub Actions Importer currently supports migrating pipelines to GitHub Actions - Jenkins - Travis CI -You can find detailed information about how the GitHub Actions Importer works for each of the supported platforms in the documentation that is available once you are granted access. - -## Getting started with GitHub Actions Importer +## Getting started GitHub Actions Importer is distributed as a Docker container and this extension to the official [GitHub CLI](https://cli.github.com) to interact with the Docker container. @@ -28,9 +18,9 @@ GitHub Actions Importer is distributed as a Docker container and this extension The following requirements must be met to be able to use the GitHub Actions Importer: -- The Docker CLI must be [installed](https://docs.docker.com/get-docker/) and running -- The official [GitHub CLI](https://cli.github.com) must be installed -- You must have credentials to [authenticate](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry) with the GitHub Container Registry after you are granted access. +- The Docker CLI must be [installed](https://docs.docker.com/get-docker/) and running. +- The official [GitHub CLI](https://cli.github.com) must be installed. +- You must have credentials to [authenticate](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry) with the GitHub Container Registry. ### Installation @@ -40,26 +30,9 @@ Next, the GitHub Actions Importer CLI extension can be installed via this comman $ gh extension install github/gh-actions-importer ``` -To verify the extension is installed, run this command: - -```bash -$ gh actions-importer -h -Options: - -?, -h, --help Show help and usage information - -Commands: - update Update to the latest version of the GitHub Actions Importer. - version Display the version of the GitHub Actions Importer. - configure Start an interactive prompt to configure credentials used to authenticate with your CI server(s). - audit Plan your CI/CD migration by analyzing your current CI/CD footprint. - forecast Forecast GitHub Actions usage from historical pipeline utilization. - dry-run Convert a pipeline to a GitHub Actions workflow and output its yaml file. - migrate Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes. -``` - ### Configuration -New versions of the GitHub Actions Importer are released on a regular basis. To ensure you're always up to date, the following command should be run often: +New versions of the GitHub Actions Importer are released on a regular basis. To ensure you're up to date, run the following command: ```bash $ gh actions-importer update @@ -71,7 +44,7 @@ $ gh actions-importer update $ echo $GITHUB_TOKEN | gh actions-importer update --username $GITHUB_HANDLE --password-stdin ``` -In order for the GitHub Actions Importer to communicate with your current CI/CD server and GitHub, various credentials must be available for the command. These can be configured using environment variables or a `.env.local` file. These environment variables can be configured in an interactive prompt by running the following command: +In order for GitHub Actions Importer to communicate with your current CI/CD server and GitHub, various credentials must be available for the command. These can be configured using environment variables or a `.env.local` file. These environment variables can be configured in an interactive prompt by running the following command: ```bash $ gh actions-importer configure @@ -79,101 +52,32 @@ $ gh actions-importer configure ... ``` -You can find detailed information about using environment variables in the documentation that is available once you are granted access. - -### Usage - -Now that the GitHub Actions Importer is configured and up-to-date, different subcommands of `gh actions-importer` can be used to migrate to GitHub Actions. - -#### Audit - -The `audit` subcommand can be used to plan your CI/CD migration by analyzing your current CI/CD footprint. This analysis can then be used to plan timelines for migrating to GitHub Actions. - -To run an audit, use the following command to determine the options that are relevant to your use case: - -```bash -$ gh actions-importer audit -h -Description: - Plan your CI/CD migration by analyzing your current CI/CD footprint. - -[...] - -Commands: - azure-devops An audit will output a list of data used in an Azure DevOps instance. - circle-ci An audit will output a list of data used in a CircleCI instance. - gitlab An audit will output a list of data used in a GitLab instance. - jenkins An audit will output a list of data used in a Jenkins instance. - travis-ci An audit will output a list of data used in a Travis CI instance. -``` - -You can find detailed information about running an audit with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview. - -#### Forecast - -The `forecast` subcommand can be used to forecast GitHub Actions usage based on historical pipeline usage. - -To run a forecast, use the following command to determine the options that are relevant to you: +You can find detailed information about using environment variables in the platform-specific documentation. -```bash -$ gh actions-importer forecast -h -Description: - Forecasts GitHub Actions usage from historical pipeline utilization. - -[...] - -Commands: - azure-devops Forecasts GitHub Actions usage from historical Azure DevOps pipeline utilization. - jenkins Forecasts GitHub Actions usage from historical Jenkins pipeline utilization. - gitlab Forecasts GitHub Actions usage from historical GitLab pipeline utilization. - circle-ci Forecasts GitHub Actions usage from historical CircleCI pipeline utilization. - travis-ci Forecasts GitHub Actions usage from historical Travis CI pipeline utilization. - github Forecasts GitHub Actions usage from historical GitHub pipeline utilization. -``` +### Documentation -You can find detailed information about running a forecast with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview. +Detailed information about how to use GitHub Actions Importer can be found in the [documentation](https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer). -#### Dry run +### Recordings -The `dry-run` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and write the workflow to your local filesystem. +You can access recorded demos of GitHub Actions Importer performing migrations to Actions from the following CI/CD platforms: + - [Azure DevOps](https://youtu.be/gG-2bkmBRlI) + - [CircleCI](https://youtu.be/YkFnNEyM9Hg) + - [GitLab](https://youtu.be/3t5ywu0_qk4) + - [Jenkins](https://youtu.be/WqiGP6h4fa0) + - [Travis CI](https://youtu.be/ndc-FNa_X3c) -To run a dry run, use the following command to determine the options that are relevant to you: +### Self-guided learning -```bash -$ gh actions-importer dry-run -h -Description: - Convert a pipeline to a GitHub Actions workflow and output its yaml file. - -[...] - -Commands: - azure-devops Convert an Azure DevOps pipeline to a GitHub Actions workflow and output its yaml file. - circle-ci Convert a CircleCI pipeline to GitHub Actions workflows and output the yaml file(s). - gitlab Convert a GitLab pipeline to a GitHub Actions workflow and output the yaml file. - jenkins Convert a Jenkins job to a GitHub Actions workflow and output its yaml file. - travis-ci Convert a Travis CI pipeline to a GitHub Actions workflow and output its yaml file. -``` +The GitHub Actions Importer labs repository contains platform-specific learning paths that teach you how to use GitHub Actions Importer and how to approach migrations to GitHub Actions. To learn more, see the [GitHub Actions Importer labs repository](https://github.com/actions/importer-labs/tree/main#readme). -You can find detailed information about running a dry run with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview. +## Product roadmap -#### Migrate +To learn about new features coming to GitHub Actions Importer, see the [GitHub Public Roadmap](https://github.com/orgs/github/projects/4247). -The `migrate` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and then create a pull request with the contents. +## How to offer feedback or make a feature request -To run a migration, use the following command to determine the options that are relevant to your use case: - -```bash -$ gh actions-importer migrate -h -Description: - Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes. - -[...] - -Commands: - azure-devops Convert an Azure DevOps pipeline to a GitHub Actions workflow and open a pull request with the changes. - circle-ci Convert a CircleCI pipeline to GitHub Actions workflows and open a pull request with the changes. - gitlab Convert a GitLab pipeline to a GitHub Actions workflow and open a pull request with the changes. - jenkins Convert a Jenkins job to a GitHub Actions workflow and open a pull request with the changes. - travis-ci Convert a Travis CI pipeline to a GitHub Actions workflow and and open a pull request with the changes. -``` +If you would like to offer feedback or make a feature request, please create a new discussion [here](https://github.com/github/gh-actions-importer/discussions/new/choose). -You can find detailed information about running a migration with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview. +## How to request support +If you need further assistance, you can file a support ticket [here](https://support.github.com). diff --git a/docs/azure_devops/Ant.md b/docs/azure_devops/Ant.md new file mode 100644 index 00000000..4543e5aa --- /dev/null +++ b/docs/azure_devops/Ant.md @@ -0,0 +1,56 @@ +# Ant task + +## Azure DevOps input + +```yaml +- task: Ant@1 + inputs: + buildFile: 'build.xml' # Required, alias: antBuildFile + options: -DmyProperty=myPropertyValue # Optional + targets: build-test # Optional + publishJUnitResults: true # Required + testResultsFiles: '**/TEST-*.xml' # Required when publishJUnitResults == True + testRunTitle: "Test Run Title" # Optional + antHomeDirectory: ANT_HOME # Optional, alias: antHomeUserInputPath + javaHomeOption: 'JDKVersion' # Options: jDKVersion, path, Alias: javaHomeSelection + jdkVersionOption: 'default' # Optional. Options: default, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, Alias: jdkVersion + jdkUserInputDirectory: # Required when javaHomeOption == Path, Alias: jdkUserInputPath + jdkArchitectureOption: 'x64' # Optional. Options: x86, x64, Alias: jdkArchitecture +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' +- run: ant -DmyProperty=myPropertyValue -buildfile build.xml build-test + env: + ANT_HOME: ANT_HOME_DIR +- name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2.4.1 + if: always() + with: + comment_title: Test Run Title + files: "**/TEST-*.xml" +``` + +```yaml +# publishJUnitResults: false +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' +- run: ant -DmyProperty=myPropertyValue -buildfile build.xml build-test + env: + ANT_HOME: ANT_HOME_DIR +``` + +### Unsupported inputs + +- codeCoverageToolOptions, alias: codeCoverageTool +- codeCoverageClassFilesDirectories, alias: classFilesDirectories +- codeCoverageClassFilter, alias: classFilter +- codeCoverageSourceDirectories, alias: srcDirectories +- codeCoverageFailIfEmpty, alias: failIfCoverageEmpty diff --git a/docs/azure_devops/ArchiveFiles.md b/docs/azure_devops/ArchiveFiles.md new file mode 100644 index 00000000..397144d0 --- /dev/null +++ b/docs/azure_devops/ArchiveFiles.md @@ -0,0 +1,50 @@ +# ArchiveFiles task + +## Azure DevOps input + +```yaml +steps: +- task: ArchiveFiles@2 + inputs: + rootFolderOrFile: '$(Build.BinariesDirectory)' # Required, Default: $(Build.BinariesDirectory) + includeRootFolder: true # Required + archiveType: 'zip' # Required, Options: zip, 7z, tar, wim + tarCompression: 'gz' # Optional, Options: gz, bz2, xz, None. Default: 'gz' + sevenZipCompression: "9" # Default: 5 + archiveFile: 'archive_file' # Required, Default: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + replaceExistingArchive: true # Required + verbose: false # Optional + quiet: false # Optional +``` + +### Transformed Github Action + +Note: + +- incoming input for archive_file needs to specify extension type. It is not added in transformation. +- Zip uses 7z compression + +```yaml + +- name: Tar files + run: tar -cf archive_file $(Build.BinariesDirectory) --overwrite +``` + +```yaml + +- name: Zip files + run: 7z u archive_file $(Build.BinariesDirectory) +``` + +```yaml + +- name: 7z files + run: 7z u -mx=9 archive_file $(Build.BinariesDirectory) +``` + +### Unsupported inputs + +- archiveType (wim) +- quiet +- verbose (7z, zip) +- sevenzipcompression (zip) diff --git a/docs/azure_devops/AzureAppServiceManage.md b/docs/azure_devops/AzureAppServiceManage.md new file mode 100644 index 00000000..f90d3a29 --- /dev/null +++ b/docs/azure_devops/AzureAppServiceManage.md @@ -0,0 +1,60 @@ +# Azure App Service Manage task + +## Azure DevOps input + +```yaml +# Azure App Service manage +# Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service +- task: AzureAppServiceManage@0 + inputs: + azureSubscription: # Required, Alias: ConnectedServiceName + action: 'Swap Slots' # Optional. Default: Swap Slots + # Options: Swap Slots, Start Swap With Preview, Complete Swap, Cancel Swap, Start Azure App Service, Stop Azure App Service, Restart Azure App Service, Delete Slot, Install Extensions, Enable Continuous Monitoring, Start all continuous webjobs, Stop all continuous webjobs + webAppName: "App Name" # Required + specifySlotOrASE: false # Optional, Alias: SpecifySlot + resourceGroupName: # Required when action == Swap Slots || Action == Delete Slot || SpecifySlot == True + sourceSlot: # Required when action == Swap Slots + swapWithProduction: true # Optional, Default: true + targetSlot: # Required when action == Swap Slots && SwapWithProduction == False + preserveVnet: false # Optional, Default: false + slot: 'production' # Required when action == Delete Slot || SpecifySlot == True, Default: production + # Unsupported + extensionsList: # Required when action == Install Extensions + outputVariable: # Optional + appInsightsResourceGroupName: # Required when action == Enable Continuous Monitoring + applicationInsightsResourceName: # Required when action == Enable Continuous Monitoring + applicationInsightsWebTestName: # Optional +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: azure/cli@v1.0.7 + with: + # Action - Start & Stop + inlineScript: az webapp start --name "web-app" --resource-group "app-resource-group" --subscription "Azure Subscription" + # Action - Delete Slot + inlineScript: az webapp deployment slot delete --name "web-app" --resource-group "app-resource-group" --subscription "Azure Subscription" --slot "staging" + # Action - Swap Slots, add action field for Start With Preview, Complete Swap, Cancel Swap + inlineScript: az webapp deployment slot swap --name "web-app" --resource-group "app-resource-group" --subscription "Azure Subscription" --slot "staging" --target-slot "targetSlot" --preserve-vnet false --action {preview, swap, reset} + # Start/Stop all continuous WebJobs + inlineScript: |- + WEB_JOBS="$(az webapp webjob continuous list --name "service-app" --resource-group "service-resource-group" --subscription "Azure Subscription" --query "[].name" --output tsv)" + echo "$WEB_JOBS" | while read line ; do + web_job_name="${line##*/}" + az webapp webjob continuous start --name "service-app" --resource-group "service-resource-group" --subscription "Azure Subscription" --slot "slot-staging" --webjob-name "$web_job_name" + done +``` + +### Unsupported inputs + +- Enable Continuous Monitoring(Action) +- Install Extensions(Action) +- ExtensionsList(Install Extensions) +- OutputVariable(Install Extensions) +- AppInsightsResourceGroupName(Enable Continuous Monitoring) +- ApplicationInsightsResourceName(Enable Continuous Monitoring) +- ApplicationInsightsWebTestName(Enable Continuous Monitoring) diff --git a/docs/azure_devops/AzureCLI.md b/docs/azure_devops/AzureCLI.md new file mode 100644 index 00000000..47b0e7f1 --- /dev/null +++ b/docs/azure_devops/AzureCLI.md @@ -0,0 +1,35 @@ +# AzureCLI task + +## Azure DevOps input + +```yaml +- task: AzureCLI@2 + inputs: + azureSubscription: + scriptType: ps + scriptLocation: inlineScript + inlineScript: | + az --version + az account show +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- run: |- + $ErrorActionPreference = 'stop' + az --version + az account show + if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit $LASTEXITCODE } + shell: powershell +``` + +### Unsupported inputs + +- azureSubscription +- addSpnToEnvironment +- useGlobalConfig +- failOnStandardError diff --git a/docs/azure_devops/AzureFileCopy.md b/docs/azure_devops/AzureFileCopy.md new file mode 100644 index 00000000..57100311 --- /dev/null +++ b/docs/azure_devops/AzureFileCopy.md @@ -0,0 +1,56 @@ +# AzureFileCopy task + +## Azure DevOps input + +```yaml +# Azure file copy +# Copy files to Azure Blob Storage or virtual machines +- task: AzureFileCopy@4 + inputs: + sourcePath: + azureSubscription: + destination: # Options: azureBlob, azureVMs + storage: + #containerName: # Required when destination == AzureBlob + #blobPrefix: # Optional + #resourceGroup: # Required when destination == AzureVMs + #resourceFilteringMethod: 'machineNames' # Optional. Options: machineNames, tags + #machineNames: # Optional + #vmsAdminUserName: # Required when destination == AzureVMs + #vmsAdminPassword: # Required when destination == AzureVMs + #targetPath: # Required when destination == AzureVMs + #additionalArgumentsForBlobCopy: # Optional + #additionalArgumentsForVMCopy: # Optional + #enableCopyPrerequisites: false # Optional + #copyFilesInParallel: true # Optional + #cleanTargetBeforeCopy: false # Optional + #skipCACheck: true # Optional + #sasTokenTimeOutInMinutes: # Optional +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- run: az storage blob upload-batch --auth-mode login --account-name "" --destination "" --source "" --subscription "" +``` + +### Unsupported inputs + +- resourceGroup +- resourceFilteringMethod +- machineNames +- vmsAdminUserName +- vmsAdminPassword +- targetPath +- additionalArgumentsForBlobCopy +- additionalArgumentsForVMCopy +- enableCopyPrerequisites +- copyFilesInParallel +- cleanTargetBeforeCopy +- skipCACheck +- sasTokenTimeOutInMinutes + +> Only `azureBlob` is supported as a `destination` (not `azureVMs`) diff --git a/docs/azure_devops/AzureFunction.md b/docs/azure_devops/AzureFunction.md new file mode 100644 index 00000000..c37e459d --- /dev/null +++ b/docs/azure_devops/AzureFunction.md @@ -0,0 +1,31 @@ +# AzureFunction task + +## Azure DevOps input + +```yaml +- task: AzureFunction@1 + inputs: + function: https://test.azurewebsites.net/api/HttpExample + key: afasdfasd/Q== + method: 'GET' + queryParameters: 'name=matz' + headers: '{Content-Type:application/json}' + successCriteria: 'eq(root['status'], 'successful')' +``` + +### Transformed Github Action + +```yaml +- name: https://test.azurewebsites.net/api/HttpExample + shell: bash + run: |- + curl -f -X "GET" https://test.azurewebsites.net/api/HttpExample?code=afasdfasd/Q==&name=matz \ + -H Content-Type:application/json \ + | jq -e '${{env.SUCCESS_CRITERIA }}' + env: + SUCCESS_CRITERIA: UPDATE_ME +``` + +### Unsupported inputs + +- Completion Event type Callback (waitForCompletion == true) diff --git a/docs/azure_devops/AzureFunctionApp.md b/docs/azure_devops/AzureFunctionApp.md new file mode 100644 index 00000000..1ced4dcb --- /dev/null +++ b/docs/azure_devops/AzureFunctionApp.md @@ -0,0 +1,48 @@ +# Azure Function App task + +## Azure DevOps input + +```yaml +- task: AzureFunctionApp@1 + inputs: + azureSubscription: # Required + appType: 'functionApp' # Required + appName: 'valet-app' # Required + deployToSlotOrASE: true, # Optional + resourceGroupName: 'unused-resource-group' # Required if deploySlotOrASE == true + slotName: 'production-slot' # Required if deploySlotOrASE == true + package: 'package-path/' # Required, Default: '$(System.DefaultWorkingDirectory)/**/*.zip' + runtimeStack: 'NODE|15' # Optional, appType == 'functionAppLinux' + appSettings: '-PORT 500' # Optional + configurationStrings: '-phpVersion "5.6"' # Optional + customWebConfig: '-NodeStartFile server.js' # Optional, appType == 'functionApp' + startUpCommand: 'npm start' # Optional, appType == 'functionAppLinux' + deploymentMethod: 'runFromPackage' # Required, appType == 'functionApp', Default: Auto +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: Azure/functions-action@v1 + with: + app-name: valet-app + package: package-path/ + slot-name: production-slot +- uses: azure/appservice-settings@v1 + with: + app-name: valet-app + app-settings-json: '[{"name":"PORT","value":"5000","slotSetting":true}]' + general-settings-json: '{"phpVersion":"5.6"}' +``` + +### Unsupported inputs + +- appType +- azureSubscription +- deploymentMethod +- resourceGroupName +- runtimeStack +- customWebConfig diff --git a/docs/azure_devops/AzureFunctionAppContainer.md b/docs/azure_devops/AzureFunctionAppContainer.md new file mode 100644 index 00000000..71465db4 --- /dev/null +++ b/docs/azure_devops/AzureFunctionAppContainer.md @@ -0,0 +1,41 @@ +# Azure Function App Container task + +## Azure DevOps input + +```yaml +- task: AzureFunctionApp@1 + inputs: + azureSubscription: ValetSubscription # Required + appName: 'valet-container-app' # Required + deployToSlotOrASE: true, # Optional + imageName: 'valetRegistry.azurecr.io/nginx:latest' # Required + resourceGroupName: 'unused-resource-group' # Required if deploySlotOrASE == true + slotName: 'production-slot' # Required if deploySlotOrASE == true + appSettings: '-Port 500' # Optional + configurationStrings: '-phpVersion "5.6"' # Optional + containerCommand: npm start # Optional +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: azure/functions-container-action@v1.2.0 + with: + app-name: valet-container-app + image: valetRegistry.azurecr.io/nginx:latest + container-commad: npm start +- uses: azure/appservice-settings@v1 + with: + app-name: valet-container-app + slot-name: production-slot + app-settings-json: '[{"name":"Port","value":"5000","slotSetting":true}]' + general-settings-json: '{"phpVersion":"5.6"}' +``` + +### Unsupported inputs + +- azureSubscription +- resourceGroupName diff --git a/docs/azure_devops/AzureKeyVault.md b/docs/azure_devops/AzureKeyVault.md new file mode 100644 index 00000000..7037526a --- /dev/null +++ b/docs/azure_devops/AzureKeyVault.md @@ -0,0 +1,33 @@ +# Azure Key Vault + +## Azure DevOps input + +```yaml +- task: AzureKeyVault@2 + inputs: + azureSubscription: 'Your-Azure-Subscription' + KeyVaultName: 'Your-Key-Vault-Name' + SecretsFilter: '*' + RunAsPreJob: false +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: '${{ secrets.AZURE_CREDENTIALS }}' +- name: + shell: bash + run: |- + for secret_name in $(az keyvault secret list --vault-name Your-Key-Vault-Name --query "[].{name:name}" --output tsv); do + secret_value=$(az keyvault secret show --vault-name "Your-Key-Vault-Name" --name $secret_name --query value -o tsv) + echo "::add-mask::$secret_value" + echo "$secret_name=$secret_value" >> $GITHUB_ENV + done +``` + +### Unsupported inputs and aliases + +- azureSubscription +- ConnectedServiceName diff --git a/docs/azure_devops/AzurePowerShell.md b/docs/azure_devops/AzurePowerShell.md new file mode 100644 index 00000000..f505f922 --- /dev/null +++ b/docs/azure_devops/AzurePowerShell.md @@ -0,0 +1,145 @@ +# Azure Power Shell task + +## Azure DevOps input + +### AzurePowerShell (v1 - v5) Task using Inline script + +```yaml +- task: AzurePowerShell@5 + displayName: 'Azure PowerShell Script: Inline Script Version' + inputs: + azureSubscription: 'valet-app-service-transformer-test' # Required + ScriptType: InlineScript # Required + Inline: | + Write-Host "Testing 1.2..3..." + Get-ChildItem + FailOnStandardError: true # Optional + preferredAzurePowerShellVersion: 3.1.0 # Required + pwsh: true # Optional + workingDirectory: williamh # Optional + continueOnError: true +``` + +### AzurePowerShell (v1 - v5) Task using FilePath to script + +```yaml +- task: AzurePowerShell@5 + displayName: 'Azure PowerShell script: ScriptPath Version' + inputs: + azureSubscription: 'valet-app-service-transformer-test' # Required + ScriptPath: 'williamh/AzurePowerShell_Task_TestScript.ps1' + ScriptArguments: '-Title "Test Header"' # Optional + ScriptType: 'FilePath' # Required + FailOnStandardError: true # Optional + preferredAzurePowerShellVersion: 3.1.0 # Required + pwsh: true # Optional + workingDirectory: williamh # Optional + continueOnError: true +``` + +### AzurePowerShell (v2) Task using Classic subscription + +```yaml +- task: AzurePowerShell@2 + displayName: 'Azure PowerShell script: ScriptPath Version' + inputs: + azureClassicSubscription: 'valet-app-service-transformer-test' # Required + azureConnectionType: 'Azure Classic' # Required + ScriptPath: 'williamh/AzurePowerShell_Task_TestScript.ps1' + ScriptArguments: '-Title "Test Header"' # Optional + azurePowerShellVersion: LatestVersion # Required + ScriptType: 'FilePath' # Required +``` + +## Transformed Github Action + +### Corresponding AzurePowerShell (v1 - v5) action using Inline script + +```yaml +- name: 'Azure PowerShell script: Inline Script Version' + continue-on-error: true + uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- name: 'Azure PowerShell script: Inline Script Version' + continue-on-error: true + uses: azure/powershell@v1 + with: + inlineScript: |- + cd williamh + Write-Host "Testing 1.2..3..." + Get-ChildItem + errorActionPreference: Stop + failOnStandardError: true + azPSVersion: 3.1.0 +``` + +### Corresponding AzurePowerShell (v1 - v5) action using path to script + +```yaml +- name: 'Azure PowerShell script: ScriptPath Version' + continue-on-error: true + uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- name: 'Azure PowerShell script: ScriptPath Version' + continue-on-error: true + uses: azure/powershell@v1 + with: + inlineScript: |- + cd williamh + williamh/AzurePowerShell_Task_TestScript.ps1 -Title "Test Header" + errorActionPreference: Stop + failOnStandardError: true + azPSVersion: 3.1.0 +``` + +### Corresponding AzurePowerShell (v2) action using Classic subscription + +```yaml +- name: 'Azure PowerShell script: ScriptPath Version' + continue-on-error: true + uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- name: 'Azure PowerShell script: ScriptPath Version' + continue-on-error: true + uses: azure/powershell@v1 + with: + inlineScript: williamh/AzurePowerShell_Task_TestScript.ps1 -Title "Test Header" + errorActionPreference: Stop + failOnStandardError: false + azPSVersion: latest +``` + +## Multiple versions (v1 - v5) + +- azureSubscription || ConnectedServiceNameARM +- Inline +- ScriptArguments +- ScriptPath +- ScriptType + +### V1 - V3 + +- azureClassicSubscription || ConnectedServiceName +- azureConnectionType || ConnectedServiceNameSelector + +### V2 - V5 + +- azurePowerShellVersion || TargetAzurePS +- azurePowerShellVersion || CustomTargetAzurePs + +### V3 - V5 + +- errorActionPreference +- FailOnStandardError + +### V4 and V5 + +- workingDirectory + +## Unsupported inputs and aliases + +- pwsh +- RestrictContextToCurrentTask diff --git a/docs/azure_devops/AzureResourceGroupDeployment.md b/docs/azure_devops/AzureResourceGroupDeployment.md new file mode 100644 index 00000000..6f390edc --- /dev/null +++ b/docs/azure_devops/AzureResourceGroupDeployment.md @@ -0,0 +1,61 @@ +# AzureResourceGroupDeployment@2 task + +Also supports the [AzureResourceManagerTemplateDeployment@3 task](https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzureResourceManagerTemplateDeploymentV3). + +## Azure DevOps input + +```yaml +# Azure resource group deployment +# Deploy an Azure Resource Manager (ARM) template to a resource group and manage virtual machines +- task: AzureResourceGroupDeployment@2 + inputs: + azureSubscription: + #action: 'Create Or Update Resource Group' # Options: create Or Update Resource Group, select Resource Group, start, stop, stopWithDeallocate, restart, delete, deleteRG + resourceGroupName: + #location: # Required when action == Create Or Update Resource Group + #templateLocation: 'Linked artifact' # Options: linked Artifact, uRL Of The File + #csmFileLink: # Required when templateLocation == URL Of The File + #csmParametersFileLink: # Optional + #csmFile: # Required when TemplateLocation == Linked Artifact + #csmParametersFile: # Optional + #overrideParameters: # Optional + #deploymentMode: 'Incremental' # Options: Incremental, Complete, Validate + #enableDeploymentPrerequisites: 'None' # Optional. Options: none, configureVMwithWinRM, configureVMWithDGAgent + #teamServicesConnection: # Required when enableDeploymentPrerequisites == ConfigureVMWithDGAgent + #teamProject: # Required when enableDeploymentPrerequisites == ConfigureVMWithDGAgent + #deploymentGroupName: # Required when enableDeploymentPrerequisites == ConfigureVMWithDGAgent + #copyAzureVMTags: true # Optional + #runAgentServiceAsUser: # Optional + #userName: # Required when enableDeploymentPrerequisites == ConfigureVMWithDGAgent && RunAgentServiceAsUser == True + #password: # Optional + #outputVariable: # Optional + #deploymentName: # Optional + #deploymentOutputs: # Optional + #addSpnToEnvironment: false # Optional +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- run: |- + az group create --location "westus" --name "foo" --subscription "bar" + az deployment group create --resource-group "foo" --no-prompt true --subscription "bar" --template-file "template.json" +``` + +### Unsupported inputs + +- action (when not `create Or Update Resource Group` or `deleteRG`) +- enableDeploymentPrerequisites +- teamServicesConnection +- teamProject +- deploymentGroupName +- copyAzureVMTags +- runAgentServiceAsUser +- userName +- password +- outputVariable +- deploymentOutputs +- addSpnToEnvironment diff --git a/docs/azure_devops/AzureRmWebAppDeployment.md b/docs/azure_devops/AzureRmWebAppDeployment.md new file mode 100644 index 00000000..c9814b22 --- /dev/null +++ b/docs/azure_devops/AzureRmWebAppDeployment.md @@ -0,0 +1,121 @@ +# Azure Rm Web App Deployment task + +## Azure DevOps input + +```yaml +- task: AzureRmWebAppDeployment@4 + inputs: + ConnectionType: 'AzureRM' + azureSubscription: 'ValetServiceConnection' + appType: 'webApp' + WebAppName: 'win-app-service-name' + deployToSlotOrASE: true + ResourceGroupName: 'valet-rg' + SlotName: 'staging' + VirtualApplication: 'virtual-app-field' + packageForLinux: 'package/path' + ScriptType: 'Inline Script' + InlineScript: ':: You can provide your deployment commands here. One command per line.' + WebConfigParameters: 'web.config' + AppSettings: '-Port 9000' + ConfigurationSettings: '-javascriptVersion 3.1' + enableCustomDeployment: true + DeploymentType: 'webDeploy' + SetParametersFile: 'SetParamfile-field' + RemoveAdditionalFilesFlag: true + enableXmlTransform: true + enableXmlVariableSubstitution: true + JSONFiles: | + { + "Data": { + "DefaultConnection": { + "ConnectionString": "Server=(localdb)\SQLEXPRESS;Database=MyDB;Trusted_Connection=True" + } + } + } +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: Azure/webapps-deploy@v2 + with: + app-name: win-app-service-name + package: package/path + slot-name: staging +- uses: azure/appservice-settings@v1 + with: + app-name: win-app-service-name + slot-name: staging + app-settings-json: '[{"name":"Port","value":"9000","slotSetting":true}]' + general-settings-json: '{"javascriptVersion":"3.1"}' + +``` + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +# The Azure Function App does not accept glob patterns. Consider updating the package path. +- uses: Azure/functions-action@v1 + with: + app-name: func-app-linux-app-service + package: "$(System.DefaultWorkingDirectory)/**/*.zip" + slot-name: prod +- uses: azure/appservice-settings@v1 + with: + app-name: win-app-service-name + slot-name: staging + app-settings-json: '[{"name":"Port","value":"9000","slotSetting":true}]' + general-settings-json: '{"javascriptVersion":"3.1"}' + +``` + +### Unsupported inputs and aliases + +#### Multiple versions (2,3, and 4) + +- azureSubscription +- resourceGroupName +- apiApp(appType) +- mobileApp(appType) +- deploymentMethod +- RuntimeStack +- VirtualApplication +- RuntimeStackFunction +- ScriptType +- InlineScript +- ScriptPath +- UseWebDeploy || enableCustomDeployment +- SetParametersFile +- RemoveAdditionalFilesFlag +- ExcludeFilesFromAppDataFlag +- AdditionalArguments +- RenameFilesFlag +- enableXmlTransform || XmlTransformation +- enableXmlVariableSubstitution || XmlVariableSubstitution +- JSONFiles +- WebAppUri +- WebConfigParameters (customWebConfig) +- TakeAppOfflineFlag + +#### V4 + +- PublishProfilePath +- PublishProfilePassword +- DeploymentType + +#### V3 + +- ImageSource +- AzureContainerRegistry +- AzureContainerRegistryLoginServer +- AzureContainerRegistryTag +- DockerRepositoryAccess +- RegistryConnectedServiceName +- PrivateRegistryImage +- PrivateRegistryTag +- GenerateWebConfig \ No newline at end of file diff --git a/docs/azure_devops/AzureServicesSecurityStatus.md b/docs/azure_devops/AzureServicesSecurityStatus.md new file mode 100644 index 00000000..5d763b13 --- /dev/null +++ b/docs/azure_devops/AzureServicesSecurityStatus.md @@ -0,0 +1,60 @@ +# Azure Services Security Status task + +## Azure DevOps input + +```yaml +- task: AzSKSVTs@4 + inputs: + ConnectedServiceNameARM: 'az-service-connection' + GenerateMethodParameterSetSelection: 'TagNameValuePair' + TagName: 'ScanMe' + TagValue: 'yes' + SubscriptionId: '123-456-786-1010' + EnableGSSscan: true + EnableOMSLogging: false +``` + +## Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" + enable-AzPSSession: true +# Warning: This will force the installation of AzSK's dependencies, including the `az` module +- name: Install Secure DevOps Kit for Azure + shell: pwsh + run: Install-Module AzSK -Scope CurrentUser -AllowClobber -Force +# Warning: this is a simplified implementation of the AzSKSVTs build task and ignores any custom scanning capabilities. +- name: Run AzSK Security Scans + shell: pwsh + env: + SUBSCRIPTION_ID: 123-456-786-1010 + TAG_NAME: ScanMe + TAG_VALUE: 'Yes' + run: |- + Set-AzSKPrivacyNoticeResponse -AcceptPrivacyNotice Yes + $scanResults = @() + $failures = @() + $scanResults += Get-AzSKAzureServicesSecurityStatus -s "${{ env.SUBSCRIPTION_ID }}" -dnof -tgn "${{ env.TAG_NAME }}" -tgv "${{ env.TAG_VALUE }}" -ExcludeTags "OwnerAccess,RBAC" + $scanResults += Get-AzSKSubscriptionSecurityStatus -s "${{ env.SUBSCRIPTION_ID }}" -dnof -ExcludeTags "OwnerAccess,GraphRead" + $passingStatuses = @("Passed") + if($Env:TREATASPASSED -ne $null){ + $passingStatuses += $Env:TREATASPASSED -split "," + } + foreach($result in $scanResults) { + $csv = Get-ChildItem -Path $result -Filter *.csv + $failures += Import-Csv -Path $csv | where Status -notin $passingStatuses + } + if ($failures.count -gt 0){ + Write-Output "::error::$($failures.count) failures were found during the Security Scan(s), see end of log for details" + Write-Output $failures | Format-Table + exit 1 + } +``` + +## Unsupported inputs and aliases +- Send events to Log Analytics +- Aggregate control status +- Do not auto-update AzSK +- Custom scanning capabilites set in pipelin variables \ No newline at end of file diff --git a/docs/azure_devops/AzureWebApp.md b/docs/azure_devops/AzureWebApp.md new file mode 100644 index 00000000..d1e0fe66 --- /dev/null +++ b/docs/azure_devops/AzureWebApp.md @@ -0,0 +1,49 @@ +# Azure Web App task + +## Azure DevOps input + +```yaml +- task: AzureWebApp@1 + inputs: + azureSubscription: 'ValetServiceConnection' + appName: 'valet-web-app' + deployToSlotOrASE: true # Optional + slotName: 'production' # Required if deploySlotOrASE == true + package: 'package-path/' # Required, Default: '$(System.DefaultWorkingDirectory)/**/*.zip' + appSettings: '-Port 5000' # Optional + configurationStrings: '-phpVersion 5.6' # Optional + startUpCommand: 'dotnet exec filename.dll' # Optional, appType == 'functionAppLinux' + appType: 'webAppLinux' + resourceGroupName: 'valet-resource-group' # Required if deploySlotOrASE == true + runtimeStack: 'NODE|10.1' # Optional, appType == 'functionAppLinux' + deploymentMethod: 'runFromPackage' # Required, appType == 'functionApp', Default: Auto + customWebConfig: '-NodeStartFile server.js' # Optional, appType == 'functionApp' +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: azure/webapps-deploy@v2 + with: + app-name: valet-web-app + slot-name: production + package: package-path/ + startup-command: dotnet exec filename.dll +- uses: azure/appservice-settings@v1 + with: + app-name: valet-app + app-settings-json: '[{"name":"PORT","value":"5000","slotSetting":true}]' + general-settings-json: '{"phpVersion":"5.6"}' +``` + +### Unsupported inputs and aliases + +- appType +- azureSubscription +- deploymentMethod +- runtimeStack +- resourceGroupName +- customWebConfig diff --git a/docs/azure_devops/AzureWebAppContainer.md b/docs/azure_devops/AzureWebAppContainer.md new file mode 100644 index 00000000..dfb96661 --- /dev/null +++ b/docs/azure_devops/AzureWebAppContainer.md @@ -0,0 +1,44 @@ +# Azure Web App Container task + +## Azure DevOps input + +```yaml +- task: AzureWebApp@1 + inputs: + azureSubscription: 'ValetServiceConnection' # Required + appName: 'container-web-app' # Required + deployToSlotOrASE: true # Optional + slotName: 'staging' # Required if deploySlotOrASE == true + imageName: 'myregistry.azurecr.io/nginx:latest' # Required, Alias: containers + multicontainerConfigFile: 'docker-compose.yml' # Optional + containerCommand: 'dotnet exec filename.dll' # Optional + appSettings: '-Port 3001' # Optional + configurationStrings: '-rubyVersion 1.6' # Optional + resourceGroupName: 'valet-resource-group' # Required if deploySlotOrASE == true +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: azure/webapps-deploy@v2 + with: + app-name: container-web-app + image-name: myregistry.azurecr.io/nginx:latest + configuration-file: docker-compose.yml + container-command: dotnet exec filename.dll + slot-name: staging +- uses: azure/appservice-settings@v1 + with: + app-name: container-web-app + slot-name: staging + app-settings-json: '[{"name":"PORT","value":"3001","slotSetting":true}]' + general-settings-json: '{"rubyVersion":"1.6"}' +``` + +### Unsupported inputs and aliases + +- azureSubscription +- resourceGroupName diff --git a/docs/azure_devops/Bash.md b/docs/azure_devops/Bash.md new file mode 100644 index 00000000..c9861323 --- /dev/null +++ b/docs/azure_devops/Bash.md @@ -0,0 +1,58 @@ +# Bash task + +## Azure DevOps input + +```yaml +steps: +- task: ShellScript@2 + inputs: + scriptPath: + # args: # Optional + # disableAutoCwd: false # optional + # cwd: # Optional + # failOnStderr: false # Optional +``` + +```yaml +# Bash +# Run a Bash script on macOS, Linux, or Windows +- task: Bash@3 + inputs: + #targetType: 'filePath' # Optional. Options: filePath, inline + #filePath: # Required when targetType == FilePath + #arguments: # Optional + #script: '# echo Hello world' # Required when targetType == inline + #workingDirectory: # Optional + #failOnStderr: false # Optional + #noProfile: true # Optional + #noRc: true # Optional +``` + +```yaml +steps: +- bash: string # contents of the script to run + displayName: string # friendly name displayed in the UI + name: string # identifier for this step (A-Z, a-z, 0-9, and underscore) + workingDirectory: string # initial working directory for the step + failOnStderr: boolean # if the script writes to stderr, should that be treated as the step failing? + condition: string + continueOnError: boolean # 'true' if future steps should run even if this step fails; defaults to 'false' + enabled: boolean # whether to run this step; defaults to 'true' + target: + container: string # where this step will run; values are the container name or the word 'host' + commands: enum # whether to process all logging commands from this step; values are `any` (default) or `restricted` + timeoutInMinutes: number + env: { string: string } # list of environment variables to add +``` + +### Transformed Github Action + +```yaml +- run: sudo npm install -g appcenter-cli@1.1.20 + shell: bash +``` + +### Unsupported inputs + +- failOnStderr +- target diff --git a/docs/azure_devops/BatchScript.md b/docs/azure_devops/BatchScript.md new file mode 100644 index 00000000..4c31c7a8 --- /dev/null +++ b/docs/azure_devops/BatchScript.md @@ -0,0 +1,27 @@ +# CmdLine task + +## Azure DevOps input + +```yaml +# Command line +# Run a Windows command or batch script and optionally allow it to change the environment +- task: BatchScript@1 + inputs: + filename: build.bat + #arguments: # Optional + #modifyEnvironment: False # Optional + #workingFolder: # Optional + #failOnStandardError: false # Optional +``` + +### Transformed Github Action + +```yaml +- run: build.bat + shell: cmd +``` + +### Unsupported inputs + +- failOnStderr +- modifyEnvironment diff --git a/docs/azure_devops/Checkout.md b/docs/azure_devops/Checkout.md new file mode 100644 index 00000000..dea39da6 --- /dev/null +++ b/docs/azure_devops/Checkout.md @@ -0,0 +1,26 @@ +# Checkout task + +## Azure DevOps input + +```yaml +- checkout: self | none | repository name # self represents the repo where the initial Pipelines YAML file was found + #clean: boolean # if true, run `execute git clean -ffdx && git reset --hard HEAD` before fetching + #fetchDepth: number # the depth of commits to ask Git to fetch; defaults to no limit + #lfs: boolean # whether to download Git-LFS files; defaults to false + #submodules: true | recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules; defaults to not checking out submodules + #path: string # path to check out source code, relative to the agent's build directory (e.g. \_work\1); defaults to a directory called `s` + #persistCredentials: boolean # if 'true', leave the OAuth token in the Git config after the initial fetch; defaults to false +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 + with: + repository: repository name + token: "${{ secrets.CHECKOUT_TOKEN }}" +``` + +### Unsupported inputs + +This action only supports checking out GitHub repositories. diff --git a/docs/azure_devops/CmdLine.md b/docs/azure_devops/CmdLine.md new file mode 100644 index 00000000..32e360d8 --- /dev/null +++ b/docs/azure_devops/CmdLine.md @@ -0,0 +1,42 @@ +# CmdLine task + +## Azure DevOps input + +```yaml +# Command line +# Run a command line script using Bash on Linux and macOS and cmd.exe on Windows +- task: CmdLine@2 + inputs: + script: "echo Write your commands here." + #workingDirectory: # Optional + #failOnStderr: false # Optional +``` + +```yaml +steps: +- script: string # contents of the script to run + displayName: string # friendly name displayed in the UI + name: string # identifier for this step (A-Z, a-z, 0-9, and underscore) + workingDirectory: string # initial working directory for the step + failOnStderr: boolean # if the script writes to stderr, should that be treated as the step failing? + condition: string + continueOnError: boolean # 'true' if future steps should run even if this step fails; defaults to 'false' + enabled: boolean # whether to run this step; defaults to 'true' + target: + container: string # where this step will run; values are the container name or the word 'host' + commands: enum # whether to process all logging commands from this step; values are `any` (default) or `restricted` + timeoutInMinutes: number + env: { string: string } # list of environment variables to add +``` + +### Transformed Github Action + +```yaml +- run: echo Write your commands here. + #working-directory: +``` + +### Unsupported inputs + +- failOnStderr +- target diff --git a/docs/azure_devops/ContinousIntegration.md b/docs/azure_devops/ContinousIntegration.md new file mode 100644 index 00000000..8da9fbbf --- /dev/null +++ b/docs/azure_devops/ContinousIntegration.md @@ -0,0 +1,39 @@ +# ContinuousIntegration trigger + +## Azure DevOps input + +```yaml +trigger: + batch: true # batch changes if true; start a new build for every push if false (default) + branches: + include: [main, dev] + exclude: [user/*] + tags: + include: [release-v*] + exclude: [whoopsie] + paths: + include: [app/**/*.cs, test/**/*.cs] + exclude: ["**/*.csproj"] +``` + +### Transformed Github Action + +```yaml +on: + push: + branches: + - main + - dev + - "!user/*" + tags: + - release-v* + - "!whoopsie" + paths: + - app/**/*.cs + - test/**/*.cs + - "!**/*.csproj" +``` + +### Unsupported inputs + +- batch diff --git a/docs/azure_devops/CopyFiles.md b/docs/azure_devops/CopyFiles.md new file mode 100644 index 00000000..5b466acd --- /dev/null +++ b/docs/azure_devops/CopyFiles.md @@ -0,0 +1,83 @@ +# CopyFiles task + +## Azure DevOps input + +```yaml +# Copy files +# Copy files from a source folder to a target folder using patterns matching file paths (not folder paths) +- task: CopyFiles@2 + inputs: + #sourceFolder: # Optional + #contents: '**' + targetFolder: + #cleanTargetFolder: false # Optional + #overWrite: false # Optional + #flattenFolders: false # Optional + #preserveTimestamp: false # Optional + #retryCount: 0 # Optional +``` + +### Transformed Github Action + +```yaml + # The following script preserves the globbing behavior of the CopyFiles task. + # Refer to this transformer's documentation for an alternative that will work in simple cases. + - uses: actions/github-script@v6.4.0 + env: + TARGET_FOLDER: dest + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + script: |- + const fs = require('fs').promises + const path = require('path') + + const target = path.resolve(process.env.TARGET_FOLDER) + process.chdir(process.env.SOURCE_FOLDER || '.') + + if (process.env.CLEAN_TARGET_FOLDER === 'true') await io.rmRF(target) + + const flattenFolders = process.env.FLATTEN_FOLDERS === 'true' + const options = {force: process.env.OVERWRITE === 'true'} + const globber = await glob.create(process.env.CONTENTS || '**') + + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + + const filename = flattenFolders ? path.basename(file) : file.substring(process.cwd().length) + const dest = path.join(target, filename) + + await io.mkdirP(path.dirname(dest)) + await io.cp(file, dest, options) + } +``` + +### Unsupported inputs + +- preserveTimestamp +- retryCount + +### Alternative transformation + +The above script might be overly complicated for simple cases where extended blob syntax is not used. Use the following custom transformer for a more idiomatic result (when possible). + +```ruby +transform "CopyFiles@2" do |item| + contents = item["contents"] || "**" + source = item["sourceFolder"] || "." + target = item["targetFolder"] + + script = [] + + script << "rm -rf #{target}/*" if item["cleanTargetFolder"] == true + script << "mkdir -p #{target}" + + contents.split("\n").each do |pattern| + script << "cp #{source}/#{pattern} #{target}" + end + + { + name: "Copy files", + run: script.join("\n") + } +end +``` diff --git a/docs/azure_devops/CopyPublishBuildArtifacts.md b/docs/azure_devops/CopyPublishBuildArtifacts.md new file mode 100644 index 00000000..e5ae1c5e --- /dev/null +++ b/docs/azure_devops/CopyPublishBuildArtifacts.md @@ -0,0 +1,51 @@ +# Copy Publish Build Artifacts task + +## Azure DevOps input + +```yaml +task: CopyPublishBuildArtifacts@1 + inputs: + CopyRoot: 'SampleAzureFunction' + Contents: '**\\bin\\Release' + ArtifactName: 'SampleAzureFunction' + ArtifactType: 'Container' +``` + +## Transformed Github Action + +```yaml + # The following script preserves the globbing behavior of the CopyFiles task. + - name: 'Copy Publish Artifact: SampleAzureFunction' + uses: actions/github-script@v6.4.0 + env: + TARGET_FOLDER: ${{ runner.temp }}/${{ github.run_id }}_publishartifact + SOURCE_FOLDER: SampleAzureFunction + CONTENTS: "**\\bin\\Release" + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.TARGET_FOLDER) + process.chdir(process.env.SOURCE_FOLDER || '.') + if (process.env.CLEAN_TARGET_FOLDER === 'true') await io.rmRF(target) + const flattenFolders = process.env.FLATTEN_FOLDERS === 'true' + const options = {force: process.env.OVERWRITE === 'true'} + const globber = await glob.create(process.env.CONTENTS || '**') + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + const filename = flattenFolders ? path.basename(file) : file.substring(process.cwd().length) + const dest = path.join(target, filename) + await io.mkdirP(path.dirname(dest)) + await io.cp(file, dest, options) + } + - name: 'Copy Publish Artifact: SampleAzureFunction' + uses: actions/upload-artifact@v2 + with: + name: SampleAzureFunction + path: "${{ runner.temp }}/${{ github.run_id }}_publishartifact" +``` + +## Unsupported inputs and aliases +- artifactType +- fileSharePath diff --git a/docs/azure_devops/DatabricksDeployScripts.md b/docs/azure_devops/DatabricksDeployScripts.md new file mode 100644 index 00000000..a73d79ee --- /dev/null +++ b/docs/azure_devops/DatabricksDeployScripts.md @@ -0,0 +1,36 @@ +# Databricks Deploy Scripts task + +## Azure DevOps input + +```yaml +- task: databricksDeployScripts@0 + inputs: + region: 'westus2' #Required, Defaults to westeurope + localPath: "Databricks/Notebooks" #Required, Defaults to "" + databricksPath: "/Shared/Notebooks" #Required, Defaults to "/Shared + #clean: true #Defaults to false +``` + +## Transformed Github Action + +```yaml +- name: Install Databricks CLI + uses: microsoft/install-databricks-cli@v1.0.0 +- name: Databricks Notebooks deployment + uses: microsoft/databricks-import-notebook@v1.0.0 + with: + databricks-host: https://westus2.azuredatabricks.net + databricks-token: "${{ secrets.DATABRICKS_TOKEN }}" + local-path: Databricks/Notebooks + remote-path: "/Shared/Notebooks" +``` + +## Unsupported inputs and aliases +- authMethod +- bearerToken +- applicationId +- spSecret +- resourceGroup +- workspace +- subscriptionId +- tenantId \ No newline at end of file diff --git a/docs/azure_devops/DeleteFiles.md b/docs/azure_devops/DeleteFiles.md new file mode 100644 index 00000000..dfb134e2 --- /dev/null +++ b/docs/azure_devops/DeleteFiles.md @@ -0,0 +1,51 @@ +# Delete Files task + +## Azure DevOps input + +```yaml +- task: DeleteFiles@1 + inputs: + SourceFolder: + Contents: | + tests + *.json + RemoveSourceFolder: false + RemoveDotFiles: false +``` + +## Transformed Github Action + +```yaml +- name: Delete files + uses: actions/github-script@v6.4.0 + env: + REMOVE_SOURCE_FOLDER: false + SOURCE_FOLDER: "." + FILE_PATTERNS: |- + tests + *.json + !**/.* + with: + script: |- + const fs = require('fs') + const sourceFolder = process.env.SOURCE_FOLDER + process.chdir(sourceFolder) + const removeSourceFolder = process.env.REMOVE_SOURCE_FOLDER + const globber = await glob.create(process.env.FILE_PATTERNS) + const files = await globber.glob() + files.sort().reverse() + for (file of files) { + console.log(`deleting ${file}`) + await io.rmRF(file) + } + if (removeSourceFolder == "true" && sourceFolder !== ".") { + if (fs.readdirSync(".").length === 0) { + process.chdir("${{ github.workspace }}") + console.log(`deleting ${sourceFolder}`) + await io.rmRF(sourceFolder) + } + } +``` + +## Unsupported inputs and aliases +- Contents: Does not support entries that contain brace expansion and extglob style patterns \ No newline at end of file diff --git a/docs/azure_devops/DeployAdfJson.md b/docs/azure_devops/DeployAdfJson.md new file mode 100644 index 00000000..2727d856 --- /dev/null +++ b/docs/azure_devops/DeployAdfJson.md @@ -0,0 +1,55 @@ +# Deploy Adf Json task + +## Azure DevOps input + +```yaml +task: deploy-adf-json@2 + inputs: + azureSubscription: 'ff' + ResourceGroupName: 'rg' + DatafactoryName: 'adf' + ServicePath: 'sp' + DataflowPath: 'df' + DatasetPath: 'ds' + PipelinePath: 'pd' + TriggerPath: 'td' + Continue: true + Sorting: 'ascending' +``` + +## Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" + - name: Deploy ADF JSON + env: + RESOURCE_GROUP_NAME: rg + DATA_FACTORY_NAME: adf + shell: pwsh + run: |- + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module -Name Az.DataFactory -AllowClobber + $DataFactory = Get-AzDataFactoryV2 -ResourceGroupName $env:RESOURCE_GROUP_NAME -Name $env:DATA_FACTORY_NAME + $linked_service_name_file = Get-Content sp -Raw | ConvertFrom-Json + $linked_service_name = $linked_service_name_file.Name + Set-AzDataFactoryV2LinkedService -ResourceGroupName $env:RESOURCE_GROUP_NAME -DataFactoryName $env:DATA_FACTORY_NAME -Name $linked_service_name -File sp + $data_set_name_file = Get-Content ds -Raw | ConvertFrom-Json + $data_set_name = $data_set_name_file.Name + Set-AzDataFactoryV2Dataset -ResourceGroupName $env:RESOURCE_GROUP_NAME -DataFactoryName $env:DATA_FACTORY_NAME -Name $data_set_name -DefinitionFile ds + $data_flow_name_file = Get-Content df -Raw | ConvertFrom-Json + $data_flow_name = $data_flow_name_file.Name + Set-AzDataFactoryV2DataFlow -ResourceGroupName $env:RESOURCE_GROUP_NAME -DataFactoryName $env:DATA_FACTORY_NAME -Name $data_flow_name -DefinitionFile df + $pipeline_name_file = Get-Content pd -Raw | ConvertFrom-Json + $pipeline_name = $pipeline_name_file.Name + Set-AzDataFactoryV2Pipeline -ResourceGroupName $env:RESOURCE_GROUP_NAME -DataFactoryName $env:DATA_FACTORY_NAME -Name $pipeline_name -File pd + $linked_service_name_file = Get-Content td -Raw | ConvertFrom-Json + $linked_service_name = $linked_service_name_file.Name + Set-AzDataFactoryV2Trigger -ResourceGroupName $env:RESOURCE_GROUP_NAME -DataFactoryName $env:DATA_FACTORY_NAME -Name $linked_service_name -DefinitionFile td +``` + +## Unsupported inputs and aliases +- azureSubscription +- Continue +- Sorting diff --git a/docs/azure_devops/Docker.md b/docs/azure_devops/Docker.md new file mode 100644 index 00000000..72d40031 --- /dev/null +++ b/docs/azure_devops/Docker.md @@ -0,0 +1,339 @@ +# Docker task + +## Azure DevOps input + +### Login + +V1 + +```yaml +- task: Docker@1 + inputs: + containerRegistryType: 'Container Registry' + dockerRegistryEndpoint: 'GitHubContainerRegistryConnection' + command: 'login' +``` + +V2 + +```yaml +- task: Docker@2 + displayName: Login to ACR + inputs: + command: login + containerRegistry: GitHubContainerRegistryConnection +``` + +#### Transformed Github Action for login + +```yaml +env: + GITHUBCONTAINERREGISTRY_DOCKER_REGISTRY: ghcr.io + +jobs: + __default-Job: + - uses: docker/login-action@v2.1.0 + with: + registry: "${{ env.GITHUBCONTAINERREGISTRY_DOCKER_REGISTRY }}" + username: "${{ env.GITHUBCONTAINERREGISTRY_DOCKER_USERNAME }}" + password: "${{ secrets.GITHUBCONTAINERREGISTRY_DOCKER_PASSWORD }}" +``` + +### Logout + +V1 + +```yaml +- task: Docker@1 + inputs: + command: 'logout' +``` + +V2 + +```yaml +- task: Docker@2 + inputs: + containerRegistry: dockerRegistryServiceConnection + command: 'logout' +``` + +#### Transformed Github Action for logout + +```yaml +-run: docker logout '${{ env.GITHUBCONTAINERREGISTRY_DOCKER_REGISTRY }}' +``` + +### Build + +If no `dockerfile` parameter is passed (defualt value: `**/Dockerfile`) or `**/Dockerfile`) is used we automatically convert it to `Dockerfile`, this will break some +pipelines but we emit a manual task to check if fixing is needed. + +V0 + +```yaml +- task: Docker@0 + inputs: + command: 'Build an image' + dockerFile: '**/Dockerfile' + imageName: '$(Build.Repository.Name):$(Build.BuildId)' + # containerRegistryType: # 'Azure Container Registry' || 'Container Registry` + # dockerRegistryEndpoint: # if containerRegistryType == 'Container Registry' + # azureSubscriptionEndpoint # if containerRegistryType == 'Azure Container Registry' + # azureContainerRegistry # if containerRegistryType == 'Azure Container Registry' + # qualifyImageName: true # default true + # buildArguments: + # includeSourceTags: false + # includeLatestTag: false + # useDefaultContext: true + # context: + # additionalImageTags: +``` + +V1 + +```yaml +- task: Docker@1 + inputs: + command: 'Build' + dockerFile: '**/Dockerfile' + imageName: '$(Build.Repository.Name):$(Build.BuildId)' + # containerRegistryType: # 'Azure Container Registry' || 'Container Registry` + # dockerRegistryEndpoint: # if containerRegistryType == 'Container Registry' + # azureSubscriptionEndpoint # if containerRegistryType == 'Azure Container Registry' + # azureContainerRegistry # if containerRegistryType == 'Azure Container Registry' + # qualifyImageName + # arguments: + # includeSourceTags: false + # includeLatestTag: false + # useDefaultContext: true + # buildContext: +``` + +V2 + +```yaml +- task: Docker@2 + inputs: + command: 'Build' + dockerFile: '**/Dockerfile' + # repository: '' + # containerRegistry: + # arguments: + # includeSourceTags: true + # buildContext: ** + # tags +``` + +> The default value for `tags` is automatically mapped from `$(Build.BuildId)` to `${{ github.run_id }}` + +#### Transformed Github Action for build + +```yaml +-run: docker build . --file "Dockerfile" -t ghcr.io/$(Build.Repository.Name):$(Build.BuildId) +``` + +### Push + +V0 + +```yaml +- task: Docker@0 + inputs: + action: 'Push an image' + imageName: '$(Build.Repository.Name):$(Build.BuildId)' + # containerRegistryType: # 'Azure Container Registry' || 'Container Registry` + # dockerRegistryConnection: # if containerRegistryType == 'Container Registry' + # azureSubscription # if containerRegistryType == 'Azure Container Registry' + # azureContainerRegistry # if containerRegistryType == 'Azure Container Registry' + # includeSourceTags: false +``` + +V1 + +```yaml +- task: Docker@1 + inputs: + command: 'push' + imageName: '$(Build.Repository.Name):$(Build.BuildId)' + # containerRegistryType: # 'Azure Container Registry' || 'Container Registry` + # dockerRegistryEndpoint: # if containerRegistryType == 'Container Registry' + # azureSubscriptionEndpoint # if containerRegistryType == 'Azure Container Registry' + # azureContainerRegistry # if containerRegistryType == 'Azure Container Registry' + # qualifyImageName: true # default true + # arguments: ??? + # includeSourceTags: false +``` + +V2 + +```yaml +- task: Docker@2 + inputs: + command: 'push' + # repository: '' + # containerRegistry: + # arguments: + # includeSourceTags: true + # buildContext + # Dockerfile + # tags +``` + +> The default value for `tags` is automatically mapped from `$(Build.BuildId)` to `${{ github.run_id }}` + +#### Transformed Github Action for push + +```yaml +run: docker push ${{ env.CUSTOM_REGISTRY_DOCKER_REGISTRY }}/hello:latest +``` + +### Build and Push + +V2 + +```yaml +- task: Docker@2 + inputs: + command: 'buildAndPush' + # repository: '' + # containerRegistry: + # arguments: + # includeSourceTags: true + # Dockerfile: '**/Dockerfile2' + # addPipelineData: + # arguments: + # buildContext: ** + # tags: $(Build.BuildId) +``` + +#### Transformed Github Action for build and push + +```yaml +- uses: docker/login-action@v2.1.0 + with: + username: "${{ env.DUMMY_DOCKER_HUB_DOCKER_USERNAME }}" + password: "${{ secrets.DUMMY_DOCKER_HUB_DOCKER_PASSWORD }}" +- run: docker build . --file "Dockerfile" -t dancingwombat:${{ github.run_id }} +- run: docker push dancingwombat:${{ github.run_id }} +``` + +### Tag + +V0 + +> `Tag Images` are not supported + +V1 + +```yaml +- task: Docker@1 + inputs: + command: 'Tag image' + imageName: '$(Build.Repository.Name):$(Build.BuildId)' + # arguments: + # containerRegistryType: # 'Azure Container Registry' || 'Container Registry` + # dockerRegistryConnection: # if containerRegistryType == 'Azure Container Registry' + # azureSubscription # if containerRegistryType == 'Azure Container Registry' + # azureContainerRegistry # if containerRegistryType == 'Azure Container Registry' + # qualifyImageName: true + # qualifySourceImageName: false + # includeSourceTags: false +``` + +#### Transformed Github Action for tag + +```yaml +- run: docker tag $(Build.Repository.Name):$(Build.BuildId) ghcr.io/$(Build.Repository.Name):$(Build.BuildId) +``` + +### Docker Run Command + +V0 + +```yaml +- task: Docker@0 + inputs: + action: 'Run a Docker command' + customCommand: 'images ls' +``` + +#### Transformed Github Action for run command + +```yaml +run: docker images ls +``` + +### Docker Run Image + +V0 + +```yaml +- task: Docker@0 + inputs: + action: 'action = Run an image' + # containerRegistryType: # 'Azure Container Registry' || 'Container Registry` + # dockerRegistryEndpoint: # if containerRegistryType == 'Container Registry' + # azureSubscriptionEndpoint # if containerRegistryType == 'Azure Container Registry' + # azureContainerRegistry # if containerRegistryType == 'Azure Container Registry' + # imageName: $(Build.Repository.Name):$(Build.BuildId) + # qualifyImageName: true + # containerName: + # ports: + # volumes: + # envVars: + # workDir: + # entrypoint: + # containerCommand: + # detached: true + # restartPolicy: No # no || onFailure || always || unlessStopped + # restartMaxRetries: # if restartPolicy == onFailure + # memory: +``` + +V1 + +```yaml +- task: Docker@1 + inputs: + command: 'Run' + # imageName: $(Build.Repository.Name):$(Build.BuildId) + # qualifyImageName: true + # containerName: + # ports: + # volumes: + # envVars: + # workingDirectory: + # entrypointOverride: + # containerCommand: + # runInBackground: true + # restartPolicy: No # no || onFailure || always || unlessStopped + # maxRestartRetries: + # memoryLimit: +``` + +#### Transformed Github Action for run image + +```yaml +run: docker run -d --name mycontainer-p 80:80 --restart no image:295 +``` + + +### Start/Stop + +Not Supported + +### Unsupported inputs + +Docker registries defined with a URL (only hostnames are supported) + +- addPipelineData +- memoryLimit +- dockerFile (with minimatch expressions) +- includeSourceTags +- addDefaultLabels +- enforceDockerNamingConvention +- dockerHostEndpoint +- imageDigestFile +- pushMultipleImages +- imageNamesPath diff --git a/docs/azure_devops/DotNetCoreCLI.md b/docs/azure_devops/DotNetCoreCLI.md new file mode 100644 index 00000000..d508806a --- /dev/null +++ b/docs/azure_devops/DotNetCoreCLI.md @@ -0,0 +1,61 @@ +# DotNetCoreCLI task + +## Azure DevOps input + +```yaml +# .NET Core +# Build, test, package, or publish a dotnet application, or run a custom dotnet command +- task: DotNetCoreCLI@2 + inputs: + #command: 'build' # Options: build, push, pack, publish, restore, run, test, custom + #publishWebProjects: true # Required when command == Publish + #projects: # Optional + #custom: # Required when command == Custom + #arguments: # Optional + #publishTestResults: true # Optional + #testRunTitle: # Optional + #zipAfterPublish: true # Optional + #modifyOutputPath: true # Optional + #feedsToUse: 'select' # Options: select, config + #vstsFeed: # Required when feedsToUse == Select + #feedRestore: # Required when command == restore. projectName/feedName for project-scoped feed. FeedName only for organization-scoped feed. + #includeNuGetOrg: true # Required when feedsToUse == Select + #nugetConfigPath: # Required when feedsToUse == Config + #externalFeedCredentials: # Optional + #noCache: false + restoreDirectory: + #restoreArguments: # Optional + #verbosityRestore: 'Detailed' # Options: -, quiet, minimal, normal, detailed, diagnostic + #packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' # Required when command == Push + #nuGetFeedType: 'internal' # Required when command == Push# Options: internal, external + #publishVstsFeed: # Required when command == Push && NuGetFeedType == Internal + #publishPackageMetadata: true # Optional + #publishFeedCredentials: # Required when command == Push && NuGetFeedType == External + #packagesToPack: '**/*.csproj' # Required when command == Pack + #packDirectory: '$(Build.ArtifactStagingDirectory)' # Optional + #nobuild: false # Optional + #includesymbols: false # Optional + #includesource: false # Optional + #versioningScheme: 'off' # Options: off, byPrereleaseNumber, byEnvVar, byBuildNumber + #versionEnvVar: # Required when versioningScheme == ByEnvVar + #majorVersion: '1' # Required when versioningScheme == ByPrereleaseNumber + #minorVersion: '0' # Required when versioningScheme == ByPrereleaseNumber + #patchVersion: '0' # Required when versioningScheme == ByPrereleaseNumber + #buildProperties: # Optional + #verbosityPack: 'Detailed' # Options: -, quiet, minimal, normal, detailed, diagnostic + workingDirectory: +``` + +### Transformed Github Action + +```yaml +- run: dotnet build +``` + +### Unsupported inputs + +- publishWebProjects +- testRunTitle +- zipAfterPublish +- modifyOutputPath +- publishPackageMetadata diff --git a/docs/azure_devops/DownloadBuildArtifacts.md b/docs/azure_devops/DownloadBuildArtifacts.md new file mode 100644 index 00000000..785165bf --- /dev/null +++ b/docs/azure_devops/DownloadBuildArtifacts.md @@ -0,0 +1,66 @@ +# DownloadBuildArtifacts task + +## Azure DevOps input + +```yaml +# Download files that were saved as artifacts of a completed build +- task: DownloadBuildArtifacts@0 + inputs: + #buildType: 'current' # Options: current, specific + #project: # Required when buildType == Specific + #pipeline: # Required when buildType == Specific + #specificBuildWithTriggering: false # Optional + #buildVersionToDownload: 'latest' # Required when buildType == Specific. Options: latest, latestFromBranch, specific + #allowPartiallySucceededBuilds: false # Optional + #branchName: 'refs/heads/master' # Required when buildType == Specific && BuildVersionToDownload == LatestFromBranch + #buildId: # Required when buildType == Specific && BuildVersionToDownload == Specific + #tags: # Optional + #downloadType: 'single' # Choose whether to download a single artifact or all artifacts of a specific build. Options: single, specific + #artifactName: # Required when downloadType == Single + #itemPattern: '**' # Optional + #downloadPath: '$(System.ArtifactsDirectory)' + #parallelizationLimit: '8' # Optional +``` + +```yaml +steps: +- downloadBuild: string # Required as first property. ID for the build resource. + artifact: string # Artifact name. + path: string # Path to download the artifact into. + patterns: string # Downloads the files which matches the patterns. + condition: string # Evaluate this condition expression to determine whether to run this task. + continueOnError: boolean # Continue running even on failure?. (false,n,no,off,on,true,y,yes) + displayName: string # Human-readable name for the task. + target: stepTarget # Environment in which to run this task + enabled: boolean # Run this task when the job runs?. (false,n,no,off,on,true,y,yes) + env: # Variables to map into the process's environment + string: string # Name/value pairs. + name: string # ID of the step. ([-_A-Za-z0-9]*) + timeoutInMinutes: string # Time to wait for this task to complete before the server kills it. + retryCountOnTaskFailure: string # Number of retries if the task fails. +``` + +### Transformed Github Action + +```yaml +- uses: actions/download-artifact@v2 + with: + name: drop + path: out +``` + +### Unsupported inputs + +- source (specific) +- project +- pipeline +- specificBuildWithTriggering +- buildVersionToDownload +- allowPartiallySucceededBuilds +- branchName +- buildId +- tags +- itemPattern +- parallelizationLimit +- target +- retryCountOnTaskFailure diff --git a/docs/azure_devops/DownloadPipelineArtifact.md b/docs/azure_devops/DownloadPipelineArtifact.md new file mode 100644 index 00000000..6358c739 --- /dev/null +++ b/docs/azure_devops/DownloadPipelineArtifact.md @@ -0,0 +1,60 @@ +# DownloadPipelineArtifact task + +## Azure DevOps input + +```yaml +# Download build and pipeline artifacts +- task: DownloadPipelineArtifact@2 + inputs: + source: "current" # Options: current, specific + artifact: "drop" # Optional + path: "out" + #project: # Required when source == Specific + #pipeline: # Required when source == Specific + #preferTriggeringPipeline: false # Optional + #runVersion: 'latest' # Required when source == Specific# Options: latest, latestFromBranch, specific + #runBranch: 'refs/heads/master' # Required when source == Specific && RunVersion == LatestFromBranch + #runId: # Required when source == Specific && RunVersion == Specific + #tags: # Optional + #patterns: '**' # Optional +``` + +```yaml +steps: +- download: string # Required as first property. Specify current, pipeline resource identifier, or none to disable automatic download. + artifact: string # Artifact name.. + patterns: string # Pattern to download files from artifact. + condition: string # Evaluate this condition expression to determine whether to run this task. + continueOnError: boolean # Continue running even on failure?. (false,n,no,off,on,true,y,yes) + displayName: string # Human-readable name for the task. + target: stepTarget # Environment in which to run this task + enabled: boolean # Run this task when the job runs?. (false,n,no,off,on,true,y,yes) + env: # Variables to map into the process's environment + string: string # Name/value pairs. + name: string # ID of the step. ([-_A-Za-z0-9]*) + timeoutInMinutes: string # Time to wait for this task to complete before the server kills it. + retryCountOnTaskFailure: string # Number of retries if the task fails. + +``` + +### Transformed Github Action + +```yaml +- uses: actions/download-artifact@v2 + with: + name: drop + path: out +``` + +### Unsupported inputs + +- source (specific) +- project +- preferTriggeringPipeline +- runVersion +- runBranch +- runId +- tags +- patterns +- target +- retryCountOnTaskFailure diff --git a/docs/azure_devops/ExtractFiles.md b/docs/azure_devops/ExtractFiles.md new file mode 100644 index 00000000..c9610eac --- /dev/null +++ b/docs/azure_devops/ExtractFiles.md @@ -0,0 +1,42 @@ +# Extract Files task + +## Azure DevOps input + +```yaml +- task: ExtractFiles@1 + inputs: + archiveFilePatterns: '**/*.zip' # Required + destinationFolder: 'base_folder' # Required, Default: $(Build.SourcesDirectory) + cleanDestinationFolder: true # Required, Default: true + overwriteExistingFiles: true # Required, Default: false + pathToSevenZipTool: 'path-to-7z-utility' # Optional, +``` + +## Transformed Github Action + +```yaml +- run: npm i @actions/exec +- name: Extract Files + uses: actions/github-script@v6.4.0 + env: + DESTINATION_FOLDER: base_folder + ARCHIVE_FILE_PATTERNS: "**/*.zip" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const exec = require('@actions/exec') + + const target = path.resolve(process.env.DESTINATION_FOLDER) + const patterns = process.env.ARCHIVE_FILE_PATTERNS + const globber = await glob.create(patterns) + await io.mkdirP(path.dirname(target)) + + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await exec.exec(`7z x ${file} -o${target} -aoa`) + } +``` + +## Unsupported inputs and aliases +- pathToSevenZipTool diff --git a/docs/azure_devops/Gradle.md b/docs/azure_devops/Gradle.md new file mode 100644 index 00000000..2c16b1eb --- /dev/null +++ b/docs/azure_devops/Gradle.md @@ -0,0 +1,60 @@ +# Gradle task + +## Azure DevOps input + +```yaml +- task: Gradle@2 + inputs: + cwd: './test-gradle' # Optional, alias: workingDirectory + gradleWrapperFile: 'gradlew' # Required, alias: wrapperScript + tasks: 'build' # Required, default: build + options: "-DProp=One" # Optional + javaHomeOption: 'JDKVersion' # Options: JDKVersion, path, Alias: javaHomeSelection + jdkVersionOption: 'default' # Optional. Options: default, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, Alias: JDKVersion + jdkUserInputDirectory: # Required when javaHomeOption == Path, Alias: jdkUserInputPath + jdkArchitectureOption: 'x64' # Optional. Options: x86, x64, Alias: jdkArchitecture + publishJUnitResults: true # Required + testResultsFiles: '*/test-file*.xml' # Required when publishJUnitResults == true + testRunTitle: "Test Run Title" # Optional + gradleOptions: '-Xmx1024m' # Optional + sonarQubeRunAnalysis: true # Optional + sqGradlePluginVersionChoice: 'specify' # Required when sonarQubeRunAnalysis == True Options: specify, build + sonarQubeGradlePluginVersion: '2.5' # Required when sonarQubeRunAnalysis == True && SqGradlePluginVersionChoice == Specify + checkStyleRunAnalysis: false # Optional + findBugsRunAnalysis: false # Optional + pmdRunAnalysis: false # Optional +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.8 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.8' +- name: Run gradle + run: "./gradlew build sonarqube -DProp=One -Dsonar.projectVersion=2.5" + working-directory: ./test-gradle + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + GRADLE_OPTS: -Xmx1024m + +- name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2.4.1 + if: always() + with: + comment_title: Test Run Title + files: "*/test-file*.xml" +``` + +### Unsupported inputs + +- codeCoverageToolOptions, alias: codeCoverageTool +- codeCoverageClassFilesDirectories, alias: classFilesDirectories +- codeCoverageClassFilter, alias: classFilter +- codeCoverageSourceDirectories, alias: srcDirectories +- codeCoverageFailIfEmpty, alias: failIfCoverageEmpty +- checkstyleAnalysisEnabled, alias: checkStyleRunAnalysis +- findbugsAnalysisEnabled, alias: findBugsRunAnalysis +- pmdAnalysisEnabled, alias: pmdRunAnalysis diff --git a/docs/azure_devops/HelmDeploy.md b/docs/azure_devops/HelmDeploy.md new file mode 100644 index 00000000..d45680b4 --- /dev/null +++ b/docs/azure_devops/HelmDeploy.md @@ -0,0 +1,34 @@ +# Helm Deploy task + +## Azure DevOps input + +```yaml +- task: HelmDeploy@0 + continueOnError: true + inputs: + connectionType: 'Azure Resource Manager' + azureSubscription: 'test-service-connection' + azureResourceGroup: 'myResourceGroup' + kubernetesCluster: 'myAKSCluster' + namespace: 'default' + command: 'ls' +``` + +## Transformed Github Action + +```yaml +- uses: azure/aks-set-context@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" + resource-group: myResourceGroup + cluster-name: myAKSCluster +- shell: bash + run: helm ls --namespace default +``` + +## Unsupported inputs and aliases +- Enable TLS. This is only applicable to Helm 2 installs +- Publish pipeline metadata + +## Useful links +- ACR credentials for `helm registry login` command. See [HERE](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-helm-repos#authenticate-with-the-registry) \ No newline at end of file diff --git a/docs/azure_devops/HelmInstaller.md b/docs/azure_devops/HelmInstaller.md new file mode 100644 index 00000000..135eb300 --- /dev/null +++ b/docs/azure_devops/HelmInstaller.md @@ -0,0 +1,33 @@ +# Helm Installer task + +## Azure DevOps input + +```yaml +- task: HelmInstaller@1 + inputs: + helmVersionToInstall: '3.7.0' +- task: HelmInstaller@0 + inputs: + helmVersion: '2.14.1' + checkLatestHelmVersion: false + installKubectl: true + kubectlVersion: '1.9.0' + checkLatestKubectl: false +``` + +## Transformed Github Action + +```yaml +- uses: azure/setup-helm@v3.5 + with: + version: v3.7.0 +- uses: azure/setup-helm@v3.5 + with: + version: v2.14.1 +- uses: azure/setup-kubectl@v1 + with: + version: v1.9.0 +``` + +## Unsupported inputs and aliases +none \ No newline at end of file diff --git a/docs/azure_devops/IisWebAppDeploymentOnMachineGroup.md b/docs/azure_devops/IisWebAppDeploymentOnMachineGroup.md new file mode 100644 index 00000000..a92cbc34 --- /dev/null +++ b/docs/azure_devops/IisWebAppDeploymentOnMachineGroup.md @@ -0,0 +1,36 @@ +# I I S Web App Deployment On Machine Group task + +## Azure DevOps input + +```yaml +- task: IISWebAppDeploymentOnMachineGroup@0 + displayName: "Sample Deploy" + inputs: + WebSiteName: 'Sample-Website' + Package: '$(System.DefaultWorkingDirectory)\**\*.zip' + RemoveAdditionalFilesFlag: true + TakeAppOfflineFlag: true + XmlTransformation: true +``` + +## Transformed Github Action + +```yaml +- name: Sample Deploy + uses: cschleiden/webdeploy-action@v1.1.0 + with: + webSiteName: Sample-Website + package: "${{ github.workspace }}\\**\\*.zip" + removeAdditionalFilesFlag: true + takeAppOfflineFlag: true +``` + +## Unsupported inputs and aliases + +- VirtualApplication +- XmlTransformation +- AdditionalArguments +- XmlVariableSubstitution +- JSONFiles +- ExcludeFilesFromAppDataFlag +- SetParametersFile diff --git a/docs/azure_devops/InlineAzurePowershell.md b/docs/azure_devops/InlineAzurePowershell.md new file mode 100644 index 00000000..50263684 --- /dev/null +++ b/docs/azure_devops/InlineAzurePowershell.md @@ -0,0 +1,46 @@ +# Inline Azure Powershell task + +## Azure DevOps input + +```yaml +- task: InlineAzurePowershell@1 + inputs: + ConnectedServiceNameSelector: 'ConnectedServiceNameARM' + ConnectedServiceNameARM: 'service-connection' + Script: | + Param( + [string]$buildNumber, + [string]$buildStatus + ) + + Write-Output "The buildNumber -> $buildNumber" + Write-Output "build status: -> $buildStatus" + ScriptArguments: '-buildNumber 29 -buildStatus passing' +``` + +## Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" + enable-AzPSSession: true +- uses: azure/powershell@v1 + with: + azPSVersion: latest + inlineScript: |- + $params = "-buildNumber 29 -buildStatus passing" + $scriptBlock = @' + Param( + [string]$buildNumber, + [string]$buildStatus + ) + Write-Output "The buildNumber -> $buildNumber" + Write-Output "build status: -> $buildStatus" + '@ + $func = New-Item -Path function: -Name inline_script_$(Get-Random) -Value $scriptBlock + Invoke-Expression "$func $params" +``` + +## Unsupported inputs and aliases +- none \ No newline at end of file diff --git a/docs/azure_devops/InlinePowershell.md b/docs/azure_devops/InlinePowershell.md new file mode 100644 index 00000000..8cf5c963 --- /dev/null +++ b/docs/azure_devops/InlinePowershell.md @@ -0,0 +1,38 @@ +# Inline Powershell task + +## Azure DevOps input + +```yaml +- task: InlinePowershell@1 + inputs: + Script: | + Param( + [string]$buildNumber, + [string]$buildStatus + ) + + Write-Output "The buildNumber -> $buildNumber" + Write-Output "build status: -> $buildStatus" + ScriptArguments: '-buildNumber 29 -buildStatus passing' +``` + +## Transformed Github Action + +```yaml +- shell: pwsh + run: |- + $params = "-buildNumber 29 -buildStatus passing" + $scriptBlock = @' + Param( + [string]$buildNumber, + [string]$buildStatus + ) + Write-Output "The buildNumber -> $buildNumber" + Write-Output "build status: -> $buildStatus" + '@ + $func = New-Item -Path function: -Name inline_script_$(Get-Random) -Value $scriptBlock + Invoke-Expression "$func $params" +``` + +## Unsupported inputs and aliases +- none \ No newline at end of file diff --git a/docs/azure_devops/InstallAppleCertificate.md b/docs/azure_devops/InstallAppleCertificate.md new file mode 100644 index 00000000..13907bcb --- /dev/null +++ b/docs/azure_devops/InstallAppleCertificate.md @@ -0,0 +1,40 @@ +# Install Apple Certificate task + +## Azure DevOps input + +```yaml +- task: InstallAppleCertificate@2 + inputs: + certSecureFile: 'Apple_Certificates.p12' + certPwd: '$(CERT_PWD)' + keychain: 'temp' +``` + +## Transformed Github Action + +```yaml +# If using a self-hosted runner, ensure the runner’s keychain is cleaned up at the end of the build +- name: Install Apple Certificate + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + KEYCHAIN_PATH: "${{ runner.temp }}/app-signing.keychain-db" + run: |- + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + # import certificate + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + # import certificate to keychain + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH +``` + +## Unsupported inputs and aliases +None + +## Addition Notes +See [here](https://docs.github.com/en/actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development) for details creating a base64 certificate secret \ No newline at end of file diff --git a/docs/azure_devops/InstallAppleProvisioningProfile.md b/docs/azure_devops/InstallAppleProvisioningProfile.md new file mode 100644 index 00000000..0b6e134e --- /dev/null +++ b/docs/azure_devops/InstallAppleProvisioningProfile.md @@ -0,0 +1,29 @@ +# Install Apple Provisioning Profile task + +## Azure DevOps input + +```yaml +- task: InstallAppleProvisioningProfile@1 + inputs: + provisioningProfileLocation: 'secureFiles' + provProfileSecureFile: 'Provisioning_Profile.mobileprovision' +``` + +## Transformed Github Action + +```yaml +- name: Install Apple Provisioning Profile + env: + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + run: | + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles +- name: Delete Provision Profile + run: rm -f ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision + if: always() +``` + +## Unsupported inputs and aliases +None \ No newline at end of file diff --git a/docs/azure_devops/InvokeRestApi.md b/docs/azure_devops/InvokeRestApi.md new file mode 100644 index 00000000..15e6e223 --- /dev/null +++ b/docs/azure_devops/InvokeRestApi.md @@ -0,0 +1,32 @@ +# Invoke RestApi task + +## Azure DevOps input + +```yaml +- task: InvokeRESTAPI@1 + inputs: + connectionType: 'connectedServiceNameARM' + azureServiceConnection: "123-456-789" + method: 'GET' + headers: '{ Content-Type:application/json }' + urlSuffix: 'subscriptions/123/resources?api-version=2019-07-01' + waitForCompletion: 'false' +``` + +## Transformed Github Action + +```yaml +- name: 'Invoke REST API: GET' + uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- name: 'Invoke REST API: GET' + shell: bash + run: |- + az rest --method GET \ + --url https://management.azure.com/subscriptions/123/resources?api-version=2019-07-01 \ + --headers Content-Type="application/json" +``` + +## Unsupported inputs +- Completion Event type Callback (waitForCompletion == true) \ No newline at end of file diff --git a/docs/azure_devops/Kubernetes.md b/docs/azure_devops/Kubernetes.md new file mode 100644 index 00000000..7b29fe73 --- /dev/null +++ b/docs/azure_devops/Kubernetes.md @@ -0,0 +1,42 @@ +# Kubernetes task + +## Azure DevOps input + +```yaml +- task: Kubernetes@1 + inputs: + connectionType: 'Azure Resource Manager' + azureSubscriptionEndpoint: 'test-service-connection' + azureResourceGroup: 'myResourceGroup' + kubernetesCluster: 'myAKSCluster' + command: 'get' + arguments: 'nodes' + secretType: 'generic' + secretArguments: '--from-literal=password=1234' + secretName: 'password' +``` + +## Transformed Github Action + +```yaml +- uses: azure/aks-set-context@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" + resource-group: myResourceGroup + cluster-name: myAKSCluster +- uses: azure/k8s-create-secret@v1 + with: + secret-type: generic + arguments: "--from-literal=password=1234" + secret-name: password +- shell: bash + working-directory: "${{ github.workspace }}" + run: kubectl get nodes -o json +``` + +## Unsupported inputs and aliases +- useClusterAdmin +- Force update secret +- Force update configmap +- Path to kubectl +- Check for latest version \ No newline at end of file diff --git a/docs/azure_devops/ManualIntervention.md b/docs/azure_devops/ManualIntervention.md new file mode 100644 index 00000000..7df81990 --- /dev/null +++ b/docs/azure_devops/ManualIntervention.md @@ -0,0 +1,22 @@ +# Manual Intervention task + +## Azure DevOps input + +```yaml +- task: ManualIntervention@8 + inputs: +``` + +## Transformed Github Action + +```yaml +jobs: + build: + environment: + name: approval_required +``` + +## Unsupported inputs and aliases +- instructions +- emailRecipients +- onTimeout \ No newline at end of file diff --git a/docs/azure_devops/Maven.md b/docs/azure_devops/Maven.md new file mode 100644 index 00000000..e1059e25 --- /dev/null +++ b/docs/azure_devops/Maven.md @@ -0,0 +1,89 @@ +# Maven task + +## Azure DevOps input + +```yaml +steps: +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.8' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + goals: 'clean' +``` + +```yaml +# Maven +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + goals: 'package' # Optional + options: # Optional + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' # Required when publishJUnitResults == True + #testRunTitle: # Optional + #codeCoverageToolOption: 'None' # Optional. Options: none, cobertura, jaCoCo. Enabling code coverage inserts the `clean` goal into the Maven goals list when Maven runs. + #codeCoverageClassFilter: # Optional. Comma-separated list of filters to include or exclude classes from collecting code coverage. For example: +:com.*,+:org.*,-:my.app*.* + #codeCoverageClassFilesDirectories: # Optional + #codeCoverageSourceDirectories: # Optional + #codeCoverageFailIfEmpty: false # Optional + #javaHomeOption: 'JDKVersion' # Options: jDKVersion, path + jdkVersionOption: 'default' # Optional. Options: default, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6 + #jdkDirectory: # Required when javaHomeOption == Path + jdkArchitectureOption: 'x64' # Optional. Options: x86, x64 + #mavenVersionOption: 'Default' # Options: default, path + #mavenDirectory: # Required when mavenVersionOption == Path + #mavenSetM2Home: false # Required when mavenVersionOption == Path + #mavenOptions: '-Xmx1024m' # Optional + #mavenAuthenticateFeed: false + #effectivePomSkip: false + #sonarQubeRunAnalysis: false + #sqMavenPluginVersionChoice: 'latest' # Required when sonarQubeRunAnalysis == True# Options: latest, pom + #checkStyleRunAnalysis: false # Optional + #pmdRunAnalysis: false # Optional + #findBugsRunAnalysis: false # Optional + +``` + +### Transformed Github Action + +```yaml +name: Set up JDK +uses: actions/setup-java@v3.10.0 +with: + java_version: '1.8' + architecture: x86 +name: Run maven + run: mvn --file pom.xml clean + env: + MAVEN_OPTS: "-Xmx3072m" +name: Publish Test Report +uses: scacap/action-surefire-report@v1 +with: + path: "**/surefire-reports/TEST-*.xml" +``` + +### Unsupported inputs + +- testRunTitle +- codeCoverageToolOption +- codeCoverageClassFilter +- codeCoverageClassFilesDirectories +- codeCoverageSourceDirectories +- codeCoverageFailIfEmpty +- javaHomeOption +- jdkDirectory +- mavenVersionOption +- mavenDirectory +- mavenSetM2Home +- mavenAuthenticateFeed +- effectivePomSkip +- sonarQubeRunAnalysis +- sqMavenPluginVersionChoice +- checkStyleRunAnalysis +- pmdRunAnalysis +- findBugsRunAnalysis diff --git a/docs/azure_devops/MsBuild.md b/docs/azure_devops/MsBuild.md new file mode 100644 index 00000000..9a65f296 --- /dev/null +++ b/docs/azure_devops/MsBuild.md @@ -0,0 +1,48 @@ +# MS Build task + +## Azure DevOps input + +```yaml +- task: MSBuild@1 + inputs: + solution: '**/*.sln' + msbuildVersion: '16.0' + platform: 'platform-field' + configuration: 'config-field' + msbuildArguments: 'msbuild args' + clean: true + maximumCpuCount: true + restoreNugetPackages: true + logProjectEvents: true + createLogFile: true + logFileVerbosity: 'minimal' + +- task: MSBuild@1 + inputs: + solution: '**/*.sln' + msbuildLocationMethod: 'location' + msbuildLocation: 'path/to/msbuild' +``` + +## Transformed Github Action + +```yaml +- name: install msbuild + uses: microsoft/setup-msbuild@v1.3.1 +- name: run msbuild + shell: cmd + run: msbuild solution/*.sln -t:Clean -p:First=value;NewProperty=TestResult;Configuration=Release;Platform="x86";RestorePackagesConfig=true -maxCpuCount -v:minimal -fileLogger + +- name: install msbuild + uses: microsoft/setup-msbuild@v1.3.1 + with: + vswhere-path: path/to/msbuild +- name: run msbuild + shell: cmd + run: msbuild **/*.sln +``` + +## Unsupported inputs and aliases + +- msbuildVersion +- logProjectEvents \ No newline at end of file diff --git a/docs/azure_devops/NodeTool.md b/docs/azure_devops/NodeTool.md new file mode 100644 index 00000000..e53c9904 --- /dev/null +++ b/docs/azure_devops/NodeTool.md @@ -0,0 +1,28 @@ +# NodeTool task + +## Azure DevOps input + +```yaml +# Node.js tool installer +# Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH +- task: NodeTool@0 + inputs: + #versionSpec: '10.x' + #force32bit: false # Optional + #checkLatest: false # Optional +``` + +### Transformed Github Action + +```yaml + - uses: actions/setup-node@v2 + with: + node-version: 10.x + architecture: x86 +``` + +> force32bit: true sets architecture to x86 + +### Unsupported inputs + +- checkLatest diff --git a/docs/azure_devops/Npm.md b/docs/azure_devops/Npm.md new file mode 100644 index 00000000..c52785ba --- /dev/null +++ b/docs/azure_devops/Npm.md @@ -0,0 +1,39 @@ +# NPM task + +## Azure DevOps input + +```yaml +# npm task +# Install and publish npm packages, or run an npm command. +- task: Npm@1 + inputs: + command: 'install' # Options: install, publish, custom + workingDir: # Optional + verbose: # Optional + customCommand: # Required when command == Custom + customRegistry: 'useNpmrc' # Optional. Options: useNpmrc, useFeed + customFeed: # Required when customRegistry == UseFeed + customEndpoint: # Optional + publishRegistry: 'useExternalRegistry' # Optional. Options: useExternalRegistry, useFeed + publishFeed: # Required when publishRegistry == UseFeed + publishPackageMetadata: true # Optional + publishEndpoint: # Required when publishRegistry == UseExternalRegistry +``` + +### Transformed Github Action + +```yaml + - name: Run npm + run: npm install +``` + +### Unsupported inputs + +- verbose +- customRegistry +- customFeed +- customEndpoint +- publishRegistry +- publishFeed +- publishPackageMetadata +- publishEndpoint diff --git a/docs/azure_devops/NuGetCommand.md b/docs/azure_devops/NuGetCommand.md new file mode 100644 index 00000000..43dc31b9 --- /dev/null +++ b/docs/azure_devops/NuGetCommand.md @@ -0,0 +1,90 @@ +# NUGetInstaller/NuGetCommand task + +## NuGetCommand task + +### Azure DevOps input + +```yaml +# NuGet +# Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Azure Artifacts and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task. +- task: NuGetCommand@2 + inputs: + #command: 'restore' # Options: restore, pack, push, custom + #restoreSolution: '**/*.sln' # Required when command == Restore + #feedsToUse: 'select' # Options: select, config + #vstsFeed: # Required when feedsToUse == Select + #includeNuGetOrg: true # Required when feedsToUse == Select + #nugetConfigPath: # Required when feedsToUse == Config + #externalFeedCredentials: # Optional + #noCache: false + #disableParallelProcessing: false + restoreDirectory: + #verbosityRestore: 'Detailed' # Options: quiet, normal, detailed + #packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' # Required when command == Push + #nuGetFeedType: 'internal' # Required when command == Push# Options: internal, external + #publishVstsFeed: # Required when command == Push && NuGetFeedType == Internal + #publishPackageMetadata: true # Optional + #allowPackageConflicts: # Optional + #publishFeedCredentials: # Required when command == Push && NuGetFeedType == External + #verbosityPush: 'Detailed' # Options: quiet, normal, detailed + #packagesToPack: '**/*.csproj' # Required when command == Pack + #configuration: '$(BuildConfiguration)' # Optional + #packDestination: '$(Build.ArtifactStagingDirectory)' # Optional + #versioningScheme: 'off' # Options: off, byPrereleaseNumber, byEnvVar, byBuildNumber + #includeReferencedProjects: false # Optional + #versionEnvVar: # Required when versioningScheme == ByEnvVar + #majorVersion: '1' # Required when versioningScheme == ByPrereleaseNumber + #minorVersion: '0' # Required when versioningScheme == ByPrereleaseNumber + #patchVersion: '0' # Required when versioningScheme == ByPrereleaseNumber + #packTimezone: 'utc' # Required when versioningScheme == ByPrereleaseNumber# Options: utc, local + #includeSymbols: false # Optional + #toolPackage: # Optional + #buildProperties: # Optional + #basePath: # Optional, specify path to nuspec files + #verbosityPack: 'Detailed' # Options: quiet, normal, detailed + #arguments: # Required when command == Custom +``` + +#### Transformed Github Action + +```yaml +- run: nuget restore +``` + +#### Unsupported inputs + +- publishPackageMetadata +- allowPackageConflicts +- packTimezone + +## NuGetInstaller task + +Use this task to install and update NuGet package dependencies. +- Restore will restore the packages a solution depends upon, and is generally what you want. +- Install will install packages from a packages.config file. Use this option if you want to install a standalone tool package. + +### Azure DevOps input + +```YAML +-task: NuGetInstaller@0 + inputs: + #solution: + #nugetConfigPath: + #restoreMode: 'restore' # Options: install or restore + #noCache: false + #nuGetRestoreArgs: #Optional arguments such as DependencyVersion, Recursive, etc + #verbosity: 'Detailed' # Options: Quiet, Normal, Detailed + #nuGetPath: +``` + +#### Transformed Github Action + +```yaml +- run: nuget restore solution.sln -NoCache -Recursive +``` + +or + +```yaml +- run: nuget install solution.sln -Configfile "nuget.config" -NoCache -Verbosity "Detailed" -DependencyVersion Highest +``` \ No newline at end of file diff --git a/docs/azure_devops/NuGetToolInstaller.md b/docs/azure_devops/NuGetToolInstaller.md new file mode 100644 index 00000000..f4e7ca85 --- /dev/null +++ b/docs/azure_devops/NuGetToolInstaller.md @@ -0,0 +1,26 @@ +# NuGetToolInstaller task + +## Azure DevOps input + +```yaml +# NuGet tool installer +# Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this task to change the version of NuGet used in the NuGet tasks. +- task: NuGetToolInstaller@1 + inputs: + #versionSpec: # Optional + #checkLatest: false # Optional +``` + +> Also supports NuGetToolInstaller@0 + +### Transformed Github Action + +```yaml +- uses: nuget/setup-nuget@v1.1.1 + with: + nuget-version: '4.3.0' +``` + +### Unsupported inputs + +- checkLatest diff --git a/docs/azure_devops/NugetAuthenticate.md b/docs/azure_devops/NugetAuthenticate.md new file mode 100644 index 00000000..fe791007 --- /dev/null +++ b/docs/azure_devops/NugetAuthenticate.md @@ -0,0 +1,26 @@ +# Nuget Authenticate task + +## Azure DevOps input + +```yaml +- task: NuGetAuthenticate@0 + displayName: 'NuGet Authenticate' + inputs: + nuGetServiceConnections: # Optional +``` + +## Transformed Github Action + +```yaml +- name: NuGet Authenticate + uses: actions/setup-dotnet@v3.0.3 + env: + NUGET_AUTH_TOKEN: "${{ secrets.NUGET_AUTH_TOKEN }}" + NUGET_FEED_URL: "${{ env.NUGET_FEED_URL }}" + with: + source-url: "${{ env.NUGET_FEED_URL }}" +``` + +## Unsupported inputs and aliases + +- forceReinstallCredentialProvider diff --git a/docs/azure_devops/PowerShell.md b/docs/azure_devops/PowerShell.md new file mode 100644 index 00000000..79520982 --- /dev/null +++ b/docs/azure_devops/PowerShell.md @@ -0,0 +1,61 @@ +# Powershell task + +## Azure DevOps input + +```yaml +# Run a PowerShell script on Linux, macOS, or Windows +- task: PowerShell@2 + inputs: + filePath: ./build.ps1 # Required when targetType == FilePath + arguments: '-Name someName -Path -Value "Some long string value"' # Optional + #targetType: 'filePath' # Optional. Options: filePath, inline + #script: '# Write your PowerShell commands here.Write-Host Hello World' # Required when targetType == Inline + #errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue + #failOnStderr: false # Optional + #ignoreLASTEXITCODE: false # Optional + #pwsh: false # Optional + #workingDirectory: # Optional +``` + +```yaml +- powershell: # inline script + workingDirectory: # + displayName: # + failOnStderr: # + errorActionPreference: # + warningPreference: # + informationPreference: # + verbosePreference: # + debugPreference: # + ignoreLASTEXITCODE: # + env: # mapping of environment variables to add +``` + +```yaml +- pwsh: # inline script + workingDirectory: # + displayName: # + failOnStderr: # + errorActionPreference: # + warningPreference: # + informationPreference: # + verbosePreference: # + debugPreference: # + ignoreLASTEXITCODE: # + env: # mapping of environment variables to add +``` + +### Transformed Github Action + +```yaml +- run: ./build.ps1 -Name someName -Path -Value \"Some long string value\" + shell: powershell +``` + +### Unsupported inputs + +- failOnStderr +- warningPreference +- informationPreference +- verbosePreference +- debugPreference diff --git a/docs/azure_devops/PowerShellOnTargetMachines.md b/docs/azure_devops/PowerShellOnTargetMachines.md new file mode 100644 index 00000000..578ff92f --- /dev/null +++ b/docs/azure_devops/PowerShellOnTargetMachines.md @@ -0,0 +1,81 @@ +# Power Shell On Target Machines task + +## Azure DevOps input + +```yaml +steps: +- task: PowerShellOnTargetMachines@3 + displayName: 'Run PowerShell on $(machineNames)' + inputs: + Machines: 'test-vm1.westus.cloudapp.azure.com:5986' + UserName: 'admin' + UserPassword: '$(sysPassword)' + ScriptType: FilePath + ScriptPath: 'C:\Scripts\MainScript.ps1' + ScriptArguments: '-p1 $A -p2 $B -p3 $C' + InitializationScript: 'C:\Scripts\InitializationScript.ps1' + NewPsSessionOptionArguments: '-SkipCACheck -IdleTimeout 7200000 -OperationTimeout 0 -OutputBufferingMode Block' + failOnStderr: true + ignoreLASTEXITCODE: true + WorkingDirectory: 'C:\Scripts' + continueOnError: true +``` + +## Transformed Github Action + +```yaml +name: PowerShellOnTargetMachines-Classic +on: + workflow_dispatch: +env: + machineName: test-vm1.westus.cloudapp.azure.com:5986 + sysAccount: admin + system_debug: 'false' +jobs: + Job_1: + name: Agent job 1 + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Run PowerShell on ${{ env.machineNames }} + continue-on-error: true + uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" + enable-AzPSSession: true + - name: Run PowerShell on ${{ env.machineNames }} + continue-on-error: true + uses: azure/powershell@v1 + env: + ACCOUNT_NAME: admin + MACHINE_NAMES: vm1.westus.cloudapp.azure.com:5986 + with: + inlineScript: | + $securePwd = ConvertTo-SecureString -String ${{ secrets.sysPassword }} -AsPlainText -Force + $cred = New-Object System.Management.Automation.PSCredential("${{ env.SYSACCOUNT }}", $securePwd) + $sessionOptions = New-PSSessionOption -SkipCACheck -IdleTimeout 7200000 -OperationTimeout 0 -OutputBufferingMode Block + $scriptBlock = [scriptblock]::Create( + { + cd C:\Scripts + C:\Scripts\InitializationScript.ps1 + C:\Scripts\MainScript.ps1 -p1 $A -p2 $B -p3 $C + }) + $machineNames = "${{ env.MACHINENAMES }}".split(",") + foreach($machine in $machineNames) + { + $spec = $machine.split(":") + $fqdn = $spec[0] + $port = [String]::IsNullOrWhiteSpace($spec[1]) ? "5986" : $spec[1] + $session = New-PSSession -ComputerName $fqdn -port $port -Credential $cred -useSSL -SessionOption $sessionOptions + Invoke-Command -Session $session -ScriptBlock $scriptBlock + } + errorActionPreference: Stop + failOnStandardError: false + azPSVersion: latest +``` + +### Unsupported inputs + +- AuthenticationMechanism +- SessionVariables + diff --git a/docs/azure_devops/PublishBuildArtifacts.md b/docs/azure_devops/PublishBuildArtifacts.md new file mode 100644 index 00000000..9875190b --- /dev/null +++ b/docs/azure_devops/PublishBuildArtifacts.md @@ -0,0 +1,33 @@ +# PublishBuildArtifacts task + +## Azure DevOps input + +```yaml +# Publish build artifacts to Azure Pipelines or a Windows file share +- task: PublishBuildArtifacts@1 + inputs: + pathToPublish: artifact.zip + artifactName: "drop" + #publishLocation: 'Container' # Options: container, filePath + #targetPath: # Required when publishLocation == FilePath + #parallel: false # Optional + #parallelCount: # Optional + #fileCopyOptions: #Optional +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + with: + name: drop + path: artifact.zip +``` + +### Unsupported inputs + +- publishLocation +- targetPath +- parallel +- parallelCount +- fileCopyOptions diff --git a/docs/azure_devops/PublishCodeCoverageResults.md b/docs/azure_devops/PublishCodeCoverageResults.md new file mode 100644 index 00000000..24a4d426 --- /dev/null +++ b/docs/azure_devops/PublishCodeCoverageResults.md @@ -0,0 +1,39 @@ +# Publish Code Coverage Results task + +## Azure DevOps input + +```yaml +- task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml' + pathToSources: '$(System.DefaultWorkingDirectory)/src/' + failIfCoverageEmpty: true + additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/**/results.xml' +``` + +## Transformed Github Action + +```yaml +- name: Generate Coverage Report + uses: danielpalme/ReportGenerator-GitHub-Action@4.8.12 + with: + reports: "${{ github.workspace }}/**/*coverage.xml" + sourcedirs: "${{ github.workspace }}/src/" + targetdir: coveragereport_${{ github.run_number }} + reporttypes: HtmlInline + continue-on-error: false +- name: Upload CoverageReport + uses: actions/upload-artifact@v2 + with: + name: CoverageReport + path: coveragereport_${{ github.run_number }} +- name: Upload CoverageReportFiles + uses: actions/upload-artifact@v2 + with: + name: CoverageReportFiles + path: "${{ github.workspace }}/**/results.xml" +``` + +## Unsupported inputs and aliases +- reportDirectory \ No newline at end of file diff --git a/docs/azure_devops/PublishPipelineArtifact.md b/docs/azure_devops/PublishPipelineArtifact.md new file mode 100644 index 00000000..8e430c31 --- /dev/null +++ b/docs/azure_devops/PublishPipelineArtifact.md @@ -0,0 +1,41 @@ +# PublishPipelineArtifact task + +## Azure DevOps input + +```yaml +# Publish (upload) a file or directory as a named artifact for the current run +- task: PublishPipelineArtifact@1 + inputs: + targetPath: "artifact.zip" # Required + artifactName: "drop" # Optional + #artifactType: 'pipeline' # Required. Options: pipeline, filepath. Default value: pipeline + #fileSharePath: '\server\folderName' # Required when artifactType = filepath + #parallel: false # Optional. Default value: false + #parallelCount: 1 # Optional. Value must be at least 1 and not greater than 128. D + +- publish: artifact.zip + artifact: drop +``` + +```yaml +steps: +- publish: string # path to a file or folder + artifact: string # artifact name + displayName: string # friendly name to display in the UI +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + with: + name: drop + path: artifact.zip +``` + +### Unsupported inputs + +- artifactType +- fileSharePath +- parallel +- parallelCount diff --git a/docs/azure_devops/PublishSymbols.md b/docs/azure_devops/PublishSymbols.md new file mode 100644 index 00000000..efb206cc --- /dev/null +++ b/docs/azure_devops/PublishSymbols.md @@ -0,0 +1,41 @@ +# Publish Symbols task + +## Azure DevOps input + +```yaml +steps: +- task: PublishSymbols@2 + inputs: + SearchPattern: '**/bin/**/*.pdb' + SymbolServerType: 'TeamServices' + SymbolsMaximumWaitTime: '12' +``` + +## Transformed Github Action + +```yaml +- uses: microsoft/action-publish-symbols@v1 + timeout-minutes: 12 + with: + accountName: "${{ env.AZ_ACCOUNT_NAME }}" + personalAccessToken: "${{ secrets.PUBLISH_SYMBOLS_ACCESS_TOKEN }}" + symbolsFolder: "${{ github.workspace }}" + searchPattern: "**/bin/**/*.pdb" + symbolServiceUrl: "${{ env.ARTIFACT_SERVICE_URL }}" + env: + AZ_ACCOUNT_NAME: UPDATE_ME + ARTIFACT_SERVICE_URL: "'https://artifacts.dev.azure.com" +``` + +## Unsupported inputs and aliases +- symbolServerType: only `TeamServices` type supported +- indexSources +- publishSymbols: `false` is not a supported value +- symbolsPath +- compressSymbols +- detailedLog +- treatNotIndexedAsWarning +- useNetCoreClientTool +- symbolsProduct +- symbolsVersion +- symbolsArtifactName \ No newline at end of file diff --git a/docs/azure_devops/PublishTestResults.md b/docs/azure_devops/PublishTestResults.md new file mode 100644 index 00000000..b725fdd9 --- /dev/null +++ b/docs/azure_devops/PublishTestResults.md @@ -0,0 +1,47 @@ +# Publish Test Results task + +## Azure DevOps input + +```yaml +- task: PublishTestResults@2 + inputs: + testResultsFormat: 'JUnit' # XUnit, NUnit, VSTest, CTest + testResultsFiles: '/TEST-*.xml' + searchFolder: 'folder/path' + mergeTestResults: true + failTaskOnFailedTests: true + testRunTitle: 'Junit title' + buildPlatform: 'build-platform' + buildConfiguration: 'BuildConfiguration-field' +``` + +### Transformed Github Action + +```yaml +# JUnit +- name: Publish XUnit test results + uses: EnricoMi/publish-unit-test-result-action@v2.4.1 + if: always() + with: + comment_title: XUnit Title + files: "**/TEST-*.xml" +``` + +```yaml +# XUnit, NUnit +- name: Publish XUnit test results + uses: dorny/test-reporter@v1.6.0 + if: success() || failure() + with: + name: XUnit Title + path: /TEST-*.xml + reporter: dotnet-trx + working-directory: folder/path +``` + +### Unsupported inputs + +- testResultsFormat (VSTest, CTest) +- mergeTestResults +- buildPlatform +- buildConfiguration diff --git a/docs/azure_devops/PullRequest.md b/docs/azure_devops/PullRequest.md new file mode 100644 index 00000000..16e0b09c --- /dev/null +++ b/docs/azure_devops/PullRequest.md @@ -0,0 +1,35 @@ +# PullRequest trigger + +## Azure DevOps input + +```yaml +trigger: + autoCancel: false # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true + branches: + include: [main, dev] + exclude: [user/*] + paths: + include: [app/**/*.cs, test/**/*.cs] + exclude: ["**/*.csproj"] + drafts: false # For GitHub only, whether to build draft PRs, defaults to true +``` + +### Transformed Github Action + +```yaml +on: + pull_request: + branches: + - main + - dev + - "!user/*" + paths: + - app/**/*.cs + - test/**/*.cs + - "!**/*.csproj" +``` + +### Unsupported inputs + +- autoCancel +- drafts diff --git a/docs/azure_devops/PythonScript.md b/docs/azure_devops/PythonScript.md new file mode 100644 index 00000000..b1f9f129 --- /dev/null +++ b/docs/azure_devops/PythonScript.md @@ -0,0 +1,35 @@ +# PythonScript task + +## Azure DevOps input + +```yaml +# Python script +# Run a Python file or inline script +- task: PythonScript@0 + inputs: + #scriptSource: 'filePath' # Options: filePath, inline + #scriptPath: # Required when scriptSource == filePath + #script: # Required when scriptSource == inline + #arguments: # Optional + #pythonInterpreter: # Optional + #workingDirectory: # Optional + #failOnStderr: false # Optional``` + +### Transformed Github Action + +```yaml +- name: inline with arguments + run: |- + import sys + print ("hello i''m an inline script") + print('Number of arguments: {}'.format(len(sys.argv))) + print('Argument(s) passed: {}'.format(str(sys.argv))) + shell: python {0} one two three + +- name: pythong file with arguments + run: python cleese.py one two three +``` + +### Unsupported inputs + +- failOnStderr diff --git a/docs/azure_devops/ReplaceTokens.md b/docs/azure_devops/ReplaceTokens.md new file mode 100644 index 00000000..4d3c6fda --- /dev/null +++ b/docs/azure_devops/ReplaceTokens.md @@ -0,0 +1,52 @@ +# Replace Tokens + +## Azure DevOps input + +```yaml +steps: +- task: qetza.replacetokens.replacetokens-task.replacetokens@3 + displayName: 'Replace tokens' + inputs: + targetFiles: | + **/*.config + **/*.json +```yaml + +### Transformed Github Action + +```yaml +- uses: cschleiden/replace-tokens@v1 + with: + tokenPrefix: '#{' + tokenSuffix: '}#' + files: '["**/*.config","**/*.json"]' +``` + +### Unsupported inputs + +- rootDirectory +- encoding +- writeBOM +- escapeType +- escapeChar +- charsToEscape +- verbosity +- actionOnMissing +- keepToken +- useLegacyPattern +- emptyValue +- defaultValue +- enableTransforms +- transformPrefix +- transformSuffix +- variableFiles +- variableSeparator +- enableTelemetry + +### Unsupported outputss + +- tokenReplacedCount +- tokenFoundCount +- fileProcessedCount +- transformExecutedCount +- defaultValueCount diff --git a/docs/azure_devops/SSISBuild.md b/docs/azure_devops/SSISBuild.md new file mode 100644 index 00000000..3fd798dc --- /dev/null +++ b/docs/azure_devops/SSISBuild.md @@ -0,0 +1,28 @@ +# Sql Azure Dacpac Deployment task + +## Azure DevOps input + +```yaml +- task: SSISBuild@1 + displayName: 'Build SSIS' + inputs: + projectPath: folder/containing/projects + projectPassword: hunter12 + stripSensitive: true + +``` + +## Transformed Github Action + +```yaml +- name: Build SSIS + run: |- + Get-ChildItem -Path folder/containing/projects -Filter *.dtproj -Recurse -File -Name| ForEach-Object { + SSISBuild.exe -project:$_ -projectPassword:hunter12 -stripSensitive -output:${{ runner.temp }} + } + shell: pwsh +``` + +## Additional Information + +- This script relies on the `SSISBuild.exe` executable being present on the runner. Instructions to install this can be found [here](https://docs.microsoft.com/en-us/sql/integration-services/devops/ssis-devops-standalone?view=sql-server-ver16#installation). diff --git a/docs/azure_devops/ShellPlusPlus.md b/docs/azure_devops/ShellPlusPlus.md new file mode 100644 index 00000000..4be9ee84 --- /dev/null +++ b/docs/azure_devops/ShellPlusPlus.md @@ -0,0 +1,23 @@ +# Shell++ + +## Azure DevOps input + +```yaml +steps: +- task: Shellpp@0 + inputs: + type: 'InlineScript' + script: echo Hello World +``` + + +### Transformed Github Action + +```yaml +- run: echo Hello World + shell: bash +``` + +### Unsupported inputs + +- failOnStderr diff --git a/docs/azure_devops/SqlAzureDacpacDeployment.md b/docs/azure_devops/SqlAzureDacpacDeployment.md new file mode 100644 index 00000000..b98a126d --- /dev/null +++ b/docs/azure_devops/SqlAzureDacpacDeployment.md @@ -0,0 +1,41 @@ +# Sql Azure Dacpac Deployment task + +## Azure DevOps input + +```yaml +- task: SqlAzureDacpacDeployment@1 + inputs: + azureConnectionType: 'ConnectedServiceName' + azureClassicSubscription: 'azure-temp' + AuthenticationType: 'connectionString' + ConnectionString: '$(connection_string)' + deployType: 'DacpacTask' + DeploymentAction: 'Publish' + DacpacFile: 'AwesomeCompany.dacpac' + IpDetectionMethod: 'AutoDetect' +``` + +## Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +# if 'Allow Azure Services and resources to access this server' is ON the Azure/login step above can likely be removed +- name: Azure SQL Deploy + uses: Azure/sql-action@v2 + with: + connection-string: "${{ secrets.AZURE_SQL_CONNECTION_STRING }}" + path: AwesomeCompany.dacpac + action: Publish +``` + +## Unsupported inputs and aliases +- deploymentAction: Extract, Export, Import +- publishProfile +- authenticationType: server, aadAuthenticationPassword, aadAuthenticationIntegrated, and servicePrincipal + +## Additional Information +- Connection to Azure is handled by the Azure/login action and can be removed if not required to access Server +- Only supported authentication type is connectionString + diff --git a/docs/azure_devops/SqlDacpacDeploy.md b/docs/azure_devops/SqlDacpacDeploy.md new file mode 100644 index 00000000..cc01422c --- /dev/null +++ b/docs/azure_devops/SqlDacpacDeploy.md @@ -0,0 +1,44 @@ +# Sql Dacpac Deploy task + +## Azure DevOps input + +```yaml +- task: SqlDacpacDeploy@1 + inputs: + machinesList: "db_server.fabrikam.com" + AdminUserName: "admin" + AdminPassword: "password123" + WinRMProtocol: Https + DacpacFile: update.dacpac + ServerName: "fabrikam1" + DatabaseName: fabrikam +``` + +## Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- uses: Azure/sql-action@v1 + with: + connection-string: "${{ secrets.AZURE_SQL_CONNECTION_STRING }}" + path: update.dacpac + action: publish +``` + +## Unsupported inputs and aliases +- PublishProfile +- DeployInParallel + +The following inputs are ignored because it is assumed the target server is a Azure SQL Server and the connection and authentication will be handled by the Azure SQL Deploy [Action](https://github.com/marketplace/actions/azure-sql-deploy) +- AdminUserName +- AdminPassword +- WinRMProtocol +- TestCertificate +- TargetMethod +- ServerName +- DatabaseName +- AuthScheme +- SqlUsername +- SqlPassword \ No newline at end of file diff --git a/docs/azure_devops/SqlDacpacDeploymentOnMachineGroup.md b/docs/azure_devops/SqlDacpacDeploymentOnMachineGroup.md new file mode 100644 index 00000000..65e2862d --- /dev/null +++ b/docs/azure_devops/SqlDacpacDeploymentOnMachineGroup.md @@ -0,0 +1,38 @@ +# Sql Dacpac Deployment On Machine Group task + +## Azure DevOps input + +```yaml +- task: SqlDacpacDeploymentOnMachineGroup@0 + inputs: + TaskType: 'dacpac' + DacpacFile: 'AwesomeCompany.dacpac' + TargetMethod: 'server' + ServerName: 'testing.database.windows.net' + DatabaseName: 'testing' + AuthScheme: 'sqlServerAuthentication' + SqlUsername: 'matz' + SqlPassword: 'password' +``` + +## Transformed Github Action + +```yaml +- name: Install Powershell Module TaskModuleSqlUtility + shell: pwsh + run: Install-Module -Name TaskModuleSqlUtility -Scope CurrentUser -Force +- shell: pwsh + run: |- + $sqlPassword = "${{ env.SQL_PASSWORD }}" | ConvertTo-SecureString -AsPlainText -Force + $sqlServerCredentials = New-Object System.Management.Automation.PSCredential ("${{ env.SQL_USER }}", $sqlPassword) + Invoke-DacpacDeployment -dacpacFile "${{ env.DACPAC_FILE }}" -targetMethod "server" -serverName "testing.database.windows.net" -databaseName "testing" -authscheme "sqlServerAuthentication" -sqlServerCredentials $sqlServerCredentials + env: + DACPAC_FILE: AwesomeCompany.dacpac + SQL_USER: matz + SQL_PASSWORD: "${{ secrets.SQL_DEPLOY_PASSWORD }}" +``` + +## Unsupported inputs and aliases +- Execute within a Transaction +- Acquire an exclusive app lock while executing script(s) +- App Lock Name \ No newline at end of file diff --git a/docs/azure_devops/Terraform.md b/docs/azure_devops/Terraform.md new file mode 100644 index 00000000..567ca39d --- /dev/null +++ b/docs/azure_devops/Terraform.md @@ -0,0 +1,32 @@ +# Terraform task + +## Azure DevOps input + +```yaml +- task: TerraformTaskV3@3 + inputs: + command: plan + workingDirectory: '' # Optional + commandOptions: '-out=path' # Optional + environmentServiceNameAzureRM: 'uuid' # Optional + continueOnError: true # Optional + +``` + +## Transformed Github Action + +```yaml + +- name: Terraform plan + continue-on-error: true + run: terraform plan -out=path + working-directory: "${{ github.workspace }}" + envs: + ARM_SUBSCRIPTION_ID: "{{ secrets.ARM_SUBSCRIPTION_ID }}" + ARM_TENANT_ID: "{{ secrets.ARM_TENANT_ID }}" + ARM_CLIENT_ID: "{{ secrets.ARM_CLIENT_ID }}" + ARM_CLIENT_SECRET: "{{ secrets.ARM_CLIENT_SECRET }}" +``` + +## Unsupported inputs and aliases + diff --git a/docs/azure_devops/TerraformInstaller.md b/docs/azure_devops/TerraformInstaller.md new file mode 100644 index 00000000..06ff5a2b --- /dev/null +++ b/docs/azure_devops/TerraformInstaller.md @@ -0,0 +1,20 @@ +# Setup Terraform task + +## Azure DevOps input + +```yaml +steps: +- task: ms-devlabs.custom-terraform-tasks.custom-terraform-installer-task.TerraformInstaller@0 + displayName: 'Install Terraform' + inputs: + terraformVersion: +``` + +## Transformed Github Action + +```yaml +- name: 'Terraform : azurerm' + uses: hashicorp/setup-terraform@v2 +``` + +## Unsupported inputs and aliases diff --git a/docs/azure_devops/ToggleAdfTrigger.md b/docs/azure_devops/ToggleAdfTrigger.md new file mode 100644 index 00000000..095a3a75 --- /dev/null +++ b/docs/azure_devops/ToggleAdfTrigger.md @@ -0,0 +1,39 @@ +# Toggle Adf Trigger task + +## Azure DevOps input + +```yaml +- task: toggle-adf-trigger@2 + inputs: + azureSubscription: 'Subs' + ResourceGroupName: 'RG' + DatafactoryName: 'ADF' + TriggerFilter: '*' + TriggerStatus: 'Start' +``` + +## Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- name: Toggle ADF Trigger + id: toggle-adf-trigger + env: + RESOURCE_GROUP_NAME: RG + DATA_FACTORY_NAME: ADF + shell: pwsh + run: |- + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module -Name Az.DataFactory -AllowClobber + $triggers = Get-AzDataFactoryV2Trigger -ResourceGroupName $env:ResourceGroupName -DataFactoryName $env:DataFactoryName + foreach($trigger in $triggers){ + Write-Host "Starting Trigger" $trigger.Name + Start-AzDataFactoryV2Trigger -ResourceGroupName $env:ResourceGroupName -DataFactoryName $env:DataFactoryName -Name $trigger.Name -Force + } +``` + +## Unsupported inputs and aliases +- azureSubscription +- TriggerFilter diff --git a/docs/azure_devops/Tokenization.md b/docs/azure_devops/Tokenization.md new file mode 100644 index 00000000..53bbd166 --- /dev/null +++ b/docs/azure_devops/Tokenization.md @@ -0,0 +1,30 @@ +# Tokenization task + +## Azure DevOps input + +```yaml +- task: Tokenization@2 + inputs: + SourcePath: 'path/to/file' #Required, Defaults to "" + TargetFileNames: 'file1.json,*.config' #Required, Defaults to "" + #RecursiveSearch: false #Optional, Defaults to true + #TokenStart: '{' #Optional, Defaults to __ + #TokenEnd: '}' #Optional, Defaults to __ + +``` + +## Transformed Github Action + +```yaml +- uses: cschleiden/replace-tokens@v1 + with: + tokenPrefix: __ + tokenSuffix: __ + files: '["path/to/file/**/file1.json", "path/to/file/**/*.config"]' +``` + +## Unsupported inputs and aliases +- RequireVariable + +## Additional Information +- Tokens that are found within the specified files that do not have a corresponding environment variable will be replaced by an empty string \ No newline at end of file diff --git a/docs/azure_devops/Tokenizer.md b/docs/azure_devops/Tokenizer.md new file mode 100644 index 00000000..f887dc8e --- /dev/null +++ b/docs/azure_devops/Tokenizer.md @@ -0,0 +1,72 @@ +# Tokenizer task + +## Azure DevOps input + +```yaml +- task: Tokenizer@2 + inputs: + SourcePath: '.\settings.xml' + ConfigurationJsonFile: '$(Build.SourcesDirectory)\token_config.json' + ReplaceUndefinedValuesWithEmpty: true +``` + +## Transformed Github Action + +```yaml +- shell: pwsh + run: |- + $tempFile = "${{ runner.temp }}\$(Split-Path $Env:DESTINATION_PATH -leaf)" + Copy-Item -Force $Env:SOURCE_PATH $tempFile -Verbose + Write-Host "Starting token updates using xpaths for environments $validEnviroments" + $validEnviroments = $Env:ENVIRONMENTS.Split(',') | ForEach {$_.Trim()} + $config = Get-Content $Env:CONFIG_PATH | ConvertFrom-Json + $sourceIsXML = [bool]((Get-Content $Env:SOURCE_PATH) -as [xml]) + if($sourceIsXML){ + $xml = [xml](Get-Content $tempFile) + ForEach ($env in $validEnviroments) { + $keys = $config.$env.ConfigChanges + ForEach ($key in $keys) { + if ($key.NamespaceUrl -And $key.NamespacePrefix) { + $ns = New-Object System.Xml.XmlNamespaceManager($xml.NameTable) + $ns.AddNamespace($key.NamespacePrefix, $key.NamespaceUrl) + $node = $xml.SelectSingleNode($key.KeyName, $ns) + } else { + $node = $xml.SelectSingleNode($key.KeyName) + } + if ($node) { + Write-Host "Updating $($key.Attribute) of $($key.KeyName): $($key.Value)" + $node.($key.Attribute) = $key.Value + } + } + } + $xml.save($tempFile) + } + Write-Host "Starting token updates using pattern '____'" + $regex = '__[A-Za-z0-9._-]*__' + $matches = select-string -Path $tempFile -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value } + ForEach ($match in $matches){ + $tokenValue = if($Env:REPLACE_UNDEFINED_WITH_EMPTY -eq "true") {$null} else {$match} + $token= $match.Trim('_') + if (Test-Path Env:$token) { + $tokenValue = (get-item env:$token).Value + } elseif ($config) { + $customVar = $validEnviroments | foreach {$config.$_.CustomVariables.$token} | where { $_ } | select -Last 1 + if ($customVar){ $tokenValue = $customVar } + } + Write-Host "Found token: $token and updating with value '$tokenValue'" + (Get-Content $tempFile) | + Foreach-Object { + $_ -replace $match, $tokenValue + } | Set-Content $tempFile -Force + } + Copy-Item -Force $tempFile $Env:DESTINATION_PATH + env: + SOURCE_PATH: ".\\settings.xml" + DESTINATION_PATH: ".\\settings.xml" + ENVIRONMENTS: default + CONFIG_PATH: "${{ github.workspace }}\\token_config.json" + REPLACE_UNDEFINED_WITH_EMPTY: true +``` + +## Unsupported inputs and aliases +- None \ No newline at end of file diff --git a/docs/azure_devops/UseDotNet.md b/docs/azure_devops/UseDotNet.md new file mode 100644 index 00000000..c06a98a8 --- /dev/null +++ b/docs/azure_devops/UseDotNet.md @@ -0,0 +1,32 @@ +# UseDotnet task + +## Azure DevOps input + +```yaml +- task: UseDotNet@2 + displayName: 'Use .NET Core sdk' + inputs: + # packageType: sdk + # version: 2.2.203 + # installationPath: $(Agent.ToolsDirectory)/dotnet +``` + +> Also supports `DotNetCoreInstaller@0` and `DotNetCoreInstaller@1` + +### Transformed Github Action + +```yaml + - name: Use .NET Core sdk + uses: actions/setup-dotnet@v3.0.3 + with: + dotnet-version: 2.2.203 +``` + +### Unsupported inputs + +- packageType +- useGlobalJson +- workingDirectory +- includePreviewVersions +- installationPath +- performMultiLevelLookup diff --git a/docs/azure_devops/UsePythonVersion.md b/docs/azure_devops/UsePythonVersion.md new file mode 100644 index 00000000..7eb904d1 --- /dev/null +++ b/docs/azure_devops/UsePythonVersion.md @@ -0,0 +1,27 @@ +# UsePythonVersion task + +## Azure DevOps input + +```yaml +# Use Python version +# Use the specified version of Python from the tool cache, optionally adding it to the PATH +- task: UsePythonVersion@0 + inputs: + #versionSpec: '3.x' + #addToPath: true + #architecture: 'x64' # Options: x86, x64 (this argument applies only on Windows agents) +``` + +### Transformed Github Action + +```yaml +- name: Setup Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: '3.7' + architecture: x64 +``` + +### Unsupported inputs + +- addToPath (it is always added to PATH) diff --git a/docs/azure_devops/UseRubyVersion.md b/docs/azure_devops/UseRubyVersion.md new file mode 100644 index 00000000..c3f11cc3 --- /dev/null +++ b/docs/azure_devops/UseRubyVersion.md @@ -0,0 +1,26 @@ +# UseRubyVersion task + +## Azure DevOps input + +```yaml +# Use Ruby version +# Use the specified version of Ruby from the tool cache, optionally adding it to the PATH +- task: UseRubyVersion@0 + inputs: + #versionSpec: '3.7' + #addToPath: true # Optional +``` + +### Transformed Github Action + +```yaml + uses: ruby/setup-ruby@v1.138.0 + with: + ruby-version: '3.7' +``` + +### Unsupported inputs + +- addToPath (it is always added to PATH) + +> Version ranges in `versionSpec` are not supported (eg: `>= 2.2`) \ No newline at end of file diff --git a/docs/azure_devops/VsTest.md b/docs/azure_devops/VsTest.md new file mode 100644 index 00000000..ad698d2a --- /dev/null +++ b/docs/azure_devops/VsTest.md @@ -0,0 +1,61 @@ +# VSTest task + +## Azure DevOps input + +```yaml +- task: VSTest@2 + inputs: + testAssemblyVer2: '**\\*test*.dll' + searchFolder: 'path/to/tests' + testFiltercriteria: 'test_filter' + vstestLocationMethod: 'version' + vsTestVersion: 'latest' + runSettingsFile: 'Local.RunSettings' + pathtoCustomTestAdapters: '/TestAdapterPath' + runInParallel: true + runTestsInIsolation: false + codeCoverageEnabled: true + otherConsoleOptions: '/Logger:trx' + platform: 'x64' +``` + +## Transformed Github Action + +```yaml + uses: microsoft/vstest-action@v1.0.0 + with: + testAssembly: "**\\\\*test*.dll" + searchFolder: path/to/tests + testFiltercriteria: test_filter + vstestLocationMethod: version + vsTestVersion: latest + runSettingsFile: Local.RunSettings + pathToCustomTestAdapters: "/TestAdapterPath" + runInParallel: true + runTestsInIsolation: false + codeCoverageEnabled: true + otherConsoleOptions: "/Logger:trx" + platform: x64 +``` + +### Unsupported inputs and aliases + +-testSelector: Unsupported Options: testPlan, testRun +-testPlan: # Required when testSelector == TestPlan +-testSuite: # Required when testSelector == TestPlan +-testConfiguration: # Required when testSelector == TestPlan +-distributionBatchType: 'basedOnTestCases' # Optional. Options: basedOnTestCases, basedOnExecutionTime, basedOnAssembly +-batchingBasedOnAgentsOption: 'autoBatchSize' # Optional. Options: autoBatchSize, customBatchSize +-customBatchSizeValue: '10' # Required when distributionBatchType == BasedOnTestCases && BatchingBasedOnAgentsOption == CustomBatchSize +-batchingBasedOnExecutionTimeOption: 'autoBatchSize' # Optional. Options: autoBatchSize, customTimeBatchSize +-customRunTimePerBatchValue: '60' # Required when distributionBatchType == BasedOnExecutionTime && BatchingBasedOnExecutionTimeOption == CustomTimeBatchSize +-dontDistribute: False # Optional +-failOnMinTestsNotRun: false # Optional +-minimumExpectedTests: '1' # Optional +-diagnosticsEnabled: false # Optional +-collectDumpOn: 'onAbortOnly' # Optional. Options: onAbortOnly, always, never +-rerunFailedTests: False # Optional +-rerunType: 'basedOnTestFailurePercentage' # Optional. Options: basedOnTestFailurePercentage, basedOnTestFailureCount +-rerunFailedThreshold: '30' # Optional +-rerunFailedTestCasesMaxLimit: '5' # Optional +-rerunMaxAttempts: '3' # Optional \ No newline at end of file diff --git a/docs/azure_devops/WindowsMachineFileCopy.md b/docs/azure_devops/WindowsMachineFileCopy.md new file mode 100644 index 00000000..99795901 --- /dev/null +++ b/docs/azure_devops/WindowsMachineFileCopy.md @@ -0,0 +1,68 @@ +# Windows Machine File Copy task + +## Azure DevOps input + +```yaml +- task: WindowsMachineFileCopy@2 + inputs: + SourcePath: 'copy_me' + MachineNames: 'testing.westus.cloudapp.azure.com' + AdminUserName: 'matz' + AdminPassword: 'P@ssW0rd' + TargetPath: 'C:\Users\matz\Desktop\testing' + CleanTargetBeforeCopy: true + CopyFilesInParallel: false + AdditionalArguments: '/pf' +``` + +## Transformed Github Action + +```yaml +- name: Copy Files to Machine File Share + shell: pwsh + run: |- + $sourcePath = "${{ env.SOURCE_PATH }}" + $robocopyParameters="${{ env.ADDITIONAL_COPY_ARGS }}" + $isFileCopy = Test-Path -Path $sourcePath -PathType Leaf + if($isFileCopy) { + $sourceDirectory = Split-Path $sourcePath + $filesToCopy = Split-Path $sourcePath -Leaf + if(-not $sourceDirectory){ $sourceDirectory = "." } + } + else { + $sourceDirectory = $sourcePath + $filesToCopy = "" + $robocopyParameters += " /E" + } + # mount machine file share + $psCredentialObject = New-Object pscredential -ArgumentList "${{ env.USER }}", (ConvertTo-SecureString -String "${{ env.PASSWORD }}" -AsPlainText -Force) + New-PSDrive -Name 'WFCPSDrive' -PSProvider FileSystem -Root "${{ env.FILE_SHARE }}" -Credential $psCredentialObject -ErrorAction "Stop" + # create missing target directories + New-Item -ItemType Directory ${{ env.TARGET_PATH }} -ErrorAction 'Stop' -Force + # clean target directory + if("${{ env.CLEAN_DESTINATION}}" -eq "true") { + $tempDirectory = "${{ runner.temp }}/clean_up" + New-Item -ItemType Directory -Force -Path $tempDirectory + Invoke-Expression "robocopy `"$tempDirectory`" `"${{ env.TARGET_PATH }}`" `"*.*`" /NOCOPY /E /PURGE" + Remove-Item $tempDirectory -Recurse -ErrorAction Ignore + } + # copy files + Invoke-Expression "robocopy `"$sourceDirectory`" `"${{ env.TARGET_PATH }}`" `"$filesToCopy`" $robocopyParameters" + # robocopy exitcodes of 0 thru 8 are considered successful + $copyExitCode = ($LASTEXITCODE -ge 8) ? 1 : 0 + # remove file share + Remove-PSDrive -Name "WFCPSDrive" -ErrorAction SilentlyContinue + exit $copyExitCode + env: + USER: matz + PASSWORD: "${{ secrets.FILE_SHARE_USER_PASSWORD }}" + SOURCE_PATH: copy_me + TARGET_PATH: "\\\\testing.westus.cloudapp.azure.com\\C$\\Users\\matz\\Desktop\\testing" + FILE_SHARE: "\\\\testing.westus.cloudapp.azure.com\\C$\\Users\\matz\\Desktop\\testing" + ADDITIONAL_COPY_ARGS: "/COPY:DAT /pf" + CLEAN_DESTINATION: true +``` + +## Unsupported inputs and aliases +- Copy Files in Parallel +- Machine Name Filter (only available in version 1) \ No newline at end of file diff --git a/docs/azure_devops/XamarinAndroid.md b/docs/azure_devops/XamarinAndroid.md new file mode 100644 index 00000000..a3712681 --- /dev/null +++ b/docs/azure_devops/XamarinAndroid.md @@ -0,0 +1,42 @@ +# Xamarin Android task + +## Azure DevOps input + +```yaml +- task: XamarinAndroid@1 + inputs: + project: "**/*.csproj" #Required, Defaults to "**/*.csproj" + #target: "Target1;Target2" #Optional + #outputDir: "path/to/output" #Optional + #configuration: "Debug" #Optional + #createAppPackage: false #Optional, Defaults to true + #clean: true #Optional, Defaults to false + #msbuildLocationMethod: "version" #Optional, Defaults to "version" + #msbuildVersion: "16.0" #Optional, Defaults to "15.0" + #msbuildLocation: "path/to/msbuild" #Required when msbuildLocationMethod == "version" + #msbuildArchitecture: "x86" #Optional, Defaults to "x86" + #msbuildArguments: "args" #Optional + jdkSelection: "JDKVersion" #Required, Defaults to "JDKVersion" + jdkVersion: "1.8" #Optional, Defaults to "default" + #jdkUserInputPath: "path/to/jdk" #Required when jdkSelection == "Path" + #jdkArchitecture: "x86" #Optional, Defaults to "x64 + +``` + +## Transformed Github Action + +```yaml +- name: Install Java Version 8 + uses: actions/setup-java@v3.10.0 + with: + distribution: zulu + java-version: '8' +- name: Build Xamarin Project + run: msbuild ${{ env.PROJECT_PATH }} /t:PackageForAndroid /p:JavaSdkDirectory="${{ env.JAVA_HOME }}" + env: + PROJECT_PATH: UPDATE_ME +``` + +## Unsupported inputs and aliases +- msbuildVersion (On macos runners) +- msbuildArchitecture \ No newline at end of file diff --git a/docs/azure_devops/XamarinIos.md b/docs/azure_devops/XamarinIos.md new file mode 100644 index 00000000..d9104bd1 --- /dev/null +++ b/docs/azure_devops/XamarinIos.md @@ -0,0 +1,34 @@ +# Xamarin Ios task + +## Azure DevOps input + +```yaml +- task: XamariniOS@2 + inputs: + solutionFile: '**/*iOS.csproj' + configuration: 'Release' + clean: true + packageApp: true + buildForSimulator: true + runNugetRestore: true + args: '-noLogo' +``` + +## Transformed Github Action + +```yaml +- name: Xamarin Clean Build + run: msbuild ${{ env.SOLUTION_PATH }} /p:Configuration=Release /p:Platform=iPhoneSimulator -noLogo /t:Clean + env: + SOLUTION_PATH: UPDATE_ME +- name: Xamarin Nuget Restore + run: nuget restore ${{ env.SOLUTION_PATH }} + env: + SOLUTION_PATH: UPDATE_ME +- name: Xamarin Build + run: msbuild ${{ env.SOLUTION_PATH }} /p:Configuration=Release /p:Platform=iPhoneSimulator /p:BuildIpa=true -noLogo + env: + SOLUTION_PATH: UPDATE_ME +``` + +## Unsupported inputs and aliases \ No newline at end of file diff --git a/docs/azure_devops/Xcode.md b/docs/azure_devops/Xcode.md new file mode 100644 index 00000000..4fa83518 --- /dev/null +++ b/docs/azure_devops/Xcode.md @@ -0,0 +1,47 @@ +# Xcode task + +## Azure DevOps input + +```yaml +- task: Xcode@5 + inputs: + actions: build test + packageApp: true + scheme: '' + configuration: 'Debug' + sdk: 'iphoneos' + useXcpretty: true + destinationTypeOption: simulators + destinationPlatformOption: 'iOS' + destinationSimulators: 'iPad Air (4th generation)' + exportOptions: plist + exportOptionsPlist: export.plist + +``` + +## Transformed Github Action + +```yaml +- name: Run XcodeBuild Command + run: "/usr/bin/xcodebuild -sdk iphoneos -configuration Debug -workspace ${{ env.XC_WORKSPACE_PATH }} -scheme ${{ env.SCHEME }} -destination platform='iOS Simulator',name='iPad Air (4th generation)' build testCODE_SIGNING_ALLOWED=NO | xcpretty -r junit --no-color" + env: + SCHEME: UPDATE_ME + XC_WORKSPACE_PATH: UPDATE_ME +- name: Run XcodeBuild Command + run: "/usr/bin/xcodebuild -sdk iphoneos -configuration Debug -workspace ${{ env.XC_WORKSPACE_PATH }} -scheme ${{ env.SCHEME }} archive -archivePath ${{ env.ARCHIVE_PATH }} CODE_SIGNING_ALLOWED=NO | xcpretty--no-color" + env: + SCHEME: UPDATE_ME + XC_WORKSPACE_PATH: UPDATE_ME + ARCHIVE_PATH: UPDATE_ME +- name: Run XcodeBuild Export Archive + run: "/usr/bin/xcodebuild -exportArchive -archivePath ${{ env.ARCHIVE_PATH }} -exportPath output/iphoneos/Debug -exportOptionsPlist export.plist | xcpretty --no-color" + env: + ARCHIVE_PATH: UPDATE_ME +``` + +## Unsupported inputs and aliases +- publishJUnitResults +- testRunTitle +- exportOptions: Options `auto` and `specify` are not support. A export plist file is required if packaging +- exportMethod: Should be specified in export plist file +- exportTeamId: Should be specifed in export plist file \ No newline at end of file diff --git a/docs/azure_devops/Yarn.md b/docs/azure_devops/Yarn.md new file mode 100644 index 00000000..c4ba4188 --- /dev/null +++ b/docs/azure_devops/Yarn.md @@ -0,0 +1,35 @@ +# Yarn task + +## Azure DevOps input + +```yaml +#Execute yarn command with optional arguments and custom Azure DevOps registries and authentication +- task: Yarn@3 + inputs: + projectDirectory: path/to/project # Optional + arguments: build --verbose # Optional + productionMode: false # Optional + customRegistry: useNpmrc # Optional + #customFeed: 314a13d9-056a-4c0b-bcec-64d99aae0323 # Required when customRegistry == useFeed + customEndpoint: 671e9496-9011-4a21-9dbf-b97f41d496eb # Optional + +``` + +## Transformed Github Action + +```yaml +- run: |- + npm set //pkgs.dev.azure.com/adoOrg/b675ba30-3f64-43c8-b35d-79c162dc3fd7/_packaging/NpmFeed1/npm/registry/:username=user + npm set //pkgs.dev.azure.com/adoOrg/b675ba30-3f64-43c8-b35d-79c162dc3fd7/_packaging/NpmFeed1/npm/registry/:_password=${{ env.NPM_PASSWORD_1 }} + npm set //pkgs.dev.azure.com/adoOrg/b675ba30-3f64-43c8-b35d-79c162dc3fd7/_packaging/NpmFeed1/npm/registry/:email=email + npm set //pkgs.dev.azure.com/adoOrg/b675ba30-3f64-43c8-b35d-79c162dc3fd7/_packaging/NpmFeed1/npm/:username=user + npm set //pkgs.dev.azure.com/adoOrg/b675ba30-3f64-43c8-b35d-79c162dc3fd7/_packaging/NpmFeed1/npm/:_password=${{ env.NPM_PASSWORD_1 }} + npm set //pkgs.dev.azure.com/adoOrg/b675ba30-3f64-43c8-b35d-79c162dc3fd7/_packaging/NpmFeed1/npm/:email=email + yarn --cwd path/to/project build --verbose + env: + NPM_PASSWORD_1: "${{ secrets.REPLACE_WITH_PASSWORD }}" + +``` + +## Unsupported inputs and aliases +Authentication for custom registries aside from Azure DevOps \ No newline at end of file diff --git a/docs/azure_devops/YarnInstaller.md b/docs/azure_devops/YarnInstaller.md new file mode 100644 index 00000000..2dc97d94 --- /dev/null +++ b/docs/azure_devops/YarnInstaller.md @@ -0,0 +1,23 @@ +# Yarn Installer task + +## Azure DevOps input + +```yaml +# Install specified version of yarn +- task: YarnInstaller@3 + inputs: + versionSpec: 1.22.* # Required, Defaults to 1.x + #checkLatest: false # Whether to download the latest matching version, Defaults to false + #includePrerelease: false # Whether to include prerelease versions, Defaults to false +``` + +## Transformed Github Action + +```yaml +- run: npm install yarn@"1.22.*" +``` + +## Unsupported inputs and aliases + +- checkLatest +- includePrerelease \ No newline at end of file diff --git a/docs/azure_devops/colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens.md b/docs/azure_devops/colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens.md new file mode 100644 index 00000000..67d7b269 --- /dev/null +++ b/docs/azure_devops/colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens.md @@ -0,0 +1,26 @@ +# Colins Replace Tokens task + +## Azure DevOps input + +```yaml +- task: colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens@1 + inputs: + sourcePath: + filePattern: 'settings.*' + tokenRegex: '__(\w+)__' +``` + +## Transformed Github Action + +```yaml +# Tokens will be matched using pattern '____', if no match is found it will be set to a empty string +- uses: cschleiden/replace-tokens@v1 + with: + files: '["settings.*"]' + tokenPrefix: __ + tokenSuffix: __ +``` + +## Unsupported inputs and aliases +- Token Regex: Only the prefix and suffix from the regex will be used. The group seletor will be ignored +- secretTokens \ No newline at end of file diff --git a/docs/azure_devops/index.md b/docs/azure_devops/index.md new file mode 100644 index 00000000..caffcf9e --- /dev/null +++ b/docs/azure_devops/index.md @@ -0,0 +1,97 @@ +# Task Mappings + +Click [here](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks) to view the full listing of built-in Azure DevOps tasks. + +| Azure DevOps | GitHub | +| :-------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | +| [Ant](Ant.md) | run | +| [ArchiveFiles](ArchiveFiles.md) | run | +| [AzureAppServiceManage](AzureAppServiceManage.md) | Azure/login@v1, azure/cli@v1.0.7 | +| [AzureCLI](AzureCLI.md) | run | +| [AzureFileCopy](AzureFileCopy.md) | run | +| [AzureFunction](AzureFunction.md) | run | +| [AzureFunctionApp](AzureFunctionApp.md) | Azure/login@v1, Azure/functions-action@v1, azure/appservice-settings@v1 | +| [AzureKeyVault](AzureKeyVault.md) | Azure/login@v1, run | +| [AzurePowershell](AzurePowershell.md) | Azure/login@v1, Azure/powershell@v1 | +| [AzureResourceGroupDeployment](AzureResourceGroupDeployment.md) | run | +| [AzureRmWebAppDeployment](AzureRmWebAppDeployment.md) | Azure/login@v1, Azure/functions-action@v1, Azure/webapps-deploy@v2,azure/appservice-settings@v1 | +| [AzureServicesSecurityStatus](AzureServicesSecurityStatus.md) | Azure/login@v1, run | +| [AzureWebApp](AzureWebApp.md) | Azure/login@v1, Azure/webapps-deploy@v2, azure/appservice-settings@v1 | +| [AzureWebAppContainer](AzureWebAppContainer.md) | Azure/login@v1, Azure/webapps-deploy@v2, azure/appservice-settings@v1 | +| [Bash](Bash.md) | run | +| [BatchScript](BatchScript.md) | run | +| [Checkout](Checkout.md) | actions/checkout@v2 | +| [CmdLine](CmdLine.md) | run | +| [colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens](colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task.ReplaceTokens.md) | cschleiden/replace-tokens@v1 | +| [ContinuousIntegration](ContinuousIntegration.md) | on.push | +| [CopyFiles](CopyFiles.md) | actions/github-script@v6.4.0 | +| [CopyPublishBuildArtifacts](CopyPublishBuildArtifacts.md) |actions/actions/github-script@v6.4.0, actions/upload-artifact@v2 | +| [databricksDeployScripts](DatabricksDeployScripts.md) | microsoft/install-databricks-cli@v1.0.0, microsoft/databricks-import-notebook@v1.0.0, run | +| [DeleteFiles](DeleteFiles.md) | actions/github-script@v6.4.0 | +| [DeployADFJSON](DeployAdfJson.md) | azure/login@v1, run | +| [Docker](Docker.md) | docker/login-action@v2 | +| [DotNetCoreCLI](DotNetCoreCLI.md) | run | +| [DownloadBuildArtifacts](DownloadBuildArtifacts.md) | actions/download-artifact@v2 | +| [DownloadPipelineArtifact](DownloadPipelineArtifact.md) | actions/download-artifact@v2 | +| [ExtractFiles](ExtractFiles.md) | actions/github-script@v6.4.0 | +| [Gradle](Gradle.md) | run | +| [HelmDeploy](HelmDeploy.md) | run, azure/aks-set-context@v1, azure/k8s-set-context@v1 | +| [HelmInstaller](HelmInstaller.md) | azure/setup-kubectl@v1, azure/setup-helm@v3.5 | +| [IISWebAppDeploymentOnMachineGroup](IisWebAppDeploymentOnMachineGroup.md.md) | cschleiden/webdeploy-action@v1.1.0 | +| [InlineAzurePowershell](InlineAzurePowershell.md) | azure/powershell@v1, azure/login@v1 | +| [InlinePowershell](InlinePowershell.md) | run | +| [InstallAppleCertificate](InstallAppleCertificate.md) | run | +| [InstallAppleProvisioningProfile](InstallAppleProvisioningProfile.md) | run | +| [InvokeRestApi](InvokeRestApi.md) | run, azure/login@v1 | +| [Kubernetes](Kubernetes.md) | run, azure/setup-kubectl@v1, azure/aks-set-context@v1, azure/k8s-set-context@v1, azure/k8s-create-secret@v1 | +| [Maven](Maven.md) | actions/setup-java@v3.10.0, run | +| [ManualIntervention](ManualIntervention.md) | | +| [MsBuild](MsBuild.md) | microsoft/setup-msbuild@v1.3.1, run | +| [Npm](Npm.md) | run | +| [NodeTool](NodeTool.md) | actions/setup-node@v1 | +| [NuGetAuthenticate](NuGetAuthenticate.md) | actions/setup-dotnet@v3 | +| [NuGetCommand](NuGetCommand.md) | run | +| [NuGetInstaller](NuGetCommand.md#NuGetInstaller) | run | +| [NuGetToolInstaller](NuGetToolInstaller.md) | nuget/setup-nuget@v1.1.1 | +| [PowerShell](PowerShell.md) | run | +| [PowerShellOnTargetMachines](PowerShellOnTargetMachines.md) | azure/login@v1, azure/powershell@v1 | +| [PublishBuildArtifacts](PublishBuildArtifacts.md) | actions/upload-artifact@v2 | +| [PublishCodeCoverageResults](PublishCodeCoverageResults.md) | actions/upload-artifact@v2, danielpalme/ReportGenerator-GitHub-Action@4.8.12 | +| [PublishPipelineArtifact](PublishPipelineArtifact.md) | actions/upload-artifact@v2 | +| [PublishSymbols](PublishSymbols.md) | microsoft/action-publish-symbols@v1 | +| [PublishTestResults](PublishTestResults.md) | EnricoMi/publish-unit-test-result-action@v2.4.1 or dorny/test-reporter@v1.6.0 | +| [PullRequest](PullRequest.md) | on.pull_request | +| [PythonScript](PythonScript.md) | run | +| [ReplaceTokens](ReplaceTokens.md) | cschleiden/replace-tokens@v1 | +| [Shell++](ShellPlusPlus.md) | run | +| [SSISBuild](SSISBuild.md) | run | +| [SqlAzureDacpacDeployment](SqlAzureDacpacDeployment.md) | run, Azure/login@v1, sql-action@v1 | +| [SqlDacpacDeploy](SqlDacpacDeploy.md) | run, Azure/login@v1, sql-action@v1 | +| [SqlDacpacDeploymentOnMachineGroup](SqlDacpacDeploymentOnMachineGroup.md) | run | +| [TerraformInstaller](TerraformInstaller.md) | hashicorp/setup-terraform@v2 | +| [Terraform](Terraform.md) | run | +| [Tokenization](Tokenization.md) | cschleiden/replace-tokens@v1 | +| [Tokenizer](Tokenizer.md) | run | +| [Toggle-ADF-Trigger](ToggleAdfTrigger.md) | azure/login@v1, run | +| [UseDotNet](UseDotNet.md) | actions/setup-dotnet@v1 | +| [UseRubyVersion](UseRubyVersion.md) | ruby/setup-ruby@v1.138.0 | +| [UsePythonVersion](UsePythonVersion.md) | actions/setup-python@v1 | +| [VsBuild](MsBuild.md) | microsoft/setup-msbuild@v1.3.1, run | +| [VSTest](VsTest.md) | microsoft/vstest-action@v1.0.0 | +| [WindowsMachineFileCopy](WindowsMachineFileCopy.md) | run | +| [XamarinAndroid](XamarinAndroid.md) | actions/setup-java@v3.10.0, microsoft/setup-msbuild@v1.3.1, run | +| [Xamarin iOS](XamarinIos.md) | run | +| [Xcode](Xcode.md) | run, maxim-lobanov/setup-xcode@v1 | +| [Yarn](Yarn.md) | run | +| [YarnInstaller](YarnInstaller.md) | run | + +## Unsupported + +The following tasks do not have any equivalent in GitHub Actions: + +- BuildQualityChecks +- Package +- ArtifactSource +- PublishSecurityAnalysisLogs + +Any task not listed above will not be mapped to an action and will be left as a comment in the converted workflow. diff --git a/docs/circle_ci/Executors/Docker.md b/docs/circle_ci/Executors/Docker.md new file mode 100644 index 00000000..2dce596b --- /dev/null +++ b/docs/circle_ci/Executors/Docker.md @@ -0,0 +1,26 @@ +# Docker + +## CircleCI input + +```yaml +docker: + - image: "circleci/node:9.6.1" + auth: + username: mydockerhub-user + password: $DOCKERHUB_PASSWORD +``` + +### Transformed Github Action + +```yaml +container: + image: "circleci/node:9.6.1" + credentials: + username: mydockerhub-user + password: $DOCKERHUB_PASSWORD +``` + +### Unsupported Options + +- aws_auth +- multiple docker images diff --git a/docs/circle_ci/Executors/Machine.md b/docs/circle_ci/Executors/Machine.md new file mode 100644 index 00000000..02391337 --- /dev/null +++ b/docs/circle_ci/Executors/Machine.md @@ -0,0 +1,19 @@ +# Machine + +## CircleCI input + +```yaml +machine: + - image: "ubuntu-2004:202104-01" +``` + +### Transformed Github Action + +```yaml +runs-on: ubuntu-20.04 +``` + +### Unsupported Options + +- docker_layer_caching +- resource_class diff --git a/docs/circle_ci/Executors/Macos.md b/docs/circle_ci/Executors/Macos.md new file mode 100644 index 00000000..cddd2c02 --- /dev/null +++ b/docs/circle_ci/Executors/Macos.md @@ -0,0 +1,22 @@ +# Macos + +## CircleCI input + +```yaml +macos: + xcode: "1.2.3" +``` + +### Transformed Github Action + +```yaml +runs-on: macos-latest +steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 1.2.3 +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/AwsCli/Default.md b/docs/circle_ci/Orbs/AwsCli/Default.md new file mode 100644 index 00000000..11f9efd2 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsCli/Default.md @@ -0,0 +1,26 @@ +# CircleCI/AwsCli Default Executor + +## CircleCI input + +```yaml +orbs: + aws: circleci/aws-cli@x.y +jobs: + install-aws-example: + executor: aws/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +job: + install-aws-example: + container: + image: cimg/python:3.9-node +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/AwsCli/Setup.md b/docs/circle_ci/Orbs/AwsCli/Setup.md new file mode 100644 index 00000000..fc703ea9 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsCli/Setup.md @@ -0,0 +1,36 @@ +# CircleCI/AwsCli Setup + +## CircleCI input + +```yaml +orbs: + aws-cli: circleci/aws-cli@x.y +jobs: + aws-cli-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-cli/setup: + aws-region: AWS_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" +``` + +### Unsupported Options + +- configure-default-region +- disable-aws-pager +- override-installed +- profile-name +- role-arn +- version diff --git a/docs/circle_ci/Orbs/AwsCli/index.md b/docs/circle_ci/Orbs/AwsCli/index.md new file mode 100644 index 00000000..5dd61ee5 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsCli/index.md @@ -0,0 +1,10 @@ +# [CircleCI AwsCli](https://circleci.com/developer/orbs/orb/circleci/aws-cli) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------- | +| [Default](Default.md) | container | +| [Setup](Setup.md) | aws-actions/configure-aws-credentials@v1 | + +## Indeterminate behavior on self-hosted runners + +- install diff --git a/docs/circle_ci/Orbs/AwsEcr/BuildAndPushImage.md b/docs/circle_ci/Orbs/AwsEcr/BuildAndPushImage.md new file mode 100644 index 00000000..e08bd6ab --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/BuildAndPushImage.md @@ -0,0 +1,62 @@ +# CircleCI/AwsEcr Build And Push Image + +## CircleCI input + +```yaml +orbs: + aws-ecr: circleci/aws-ecr@x.y +jobs: + aws-ecr-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecr/build-and-push-image: + account-url: AWS_ECR_ACCOUNT_URL + attach-workspace: true + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + checkout: true + create-repo: true + docker-login: true + dockerfile: MyDockerFile + dockerhub-username: DOCKERHUB_USERNAME + dockerhub-password: DOCKERHUB_PASSWORD + extra-build-args: -e example + no-output-timeout: "20m" + path: . + region: AWS_REGION + repo: my-repo + tag: my-tag-1, my-tag-2 + workspace-root: my-path +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 +- uses: actions/download-artifact@v2 + with: + path: my/path +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" +- uses: aws-actions/amazon-ecr-login@v1.5.3 +- run: aws ecr create-repository --profile non-default --region ${{ env.AWS_REGION }} --repository-name my-repo --image-scanning-configuration scanOnPush=true +- run: docker login -u ${{ env.MY_DOCKERHUB_USER }} -p ${{ env.MY_DOCKERHUB_PASS }} +- run: |- + docker build -e example -f ./MyDockerFile -t ${{ env.AWS_ECR_ACCOUNT_URL }}/my-repo:my-tag-1 . + docker build -e example -f ./MyDockerFile -t ${{ env.AWS_ECR_ACCOUNT_URL }}/my-repo:my-tag-2 . + timeout-minutes: '20' +- run: docker push ${{ env.AWS_EXAMPLE_ENV_VAR }}/my-repo:my-tag +``` + +### Unsupported Options + +- setup-remote-docker +- remote-docker-layer-caching +- remote-docker-version +- skip-when-tags-exist +- repo-scan-on-push +- profile-name diff --git a/docs/circle_ci/Orbs/AwsEcr/BuildImage.md b/docs/circle_ci/Orbs/AwsEcr/BuildImage.md new file mode 100644 index 00000000..47df571c --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/BuildImage.md @@ -0,0 +1,46 @@ +# CircleCI/AwsEcr Build Image + +## CircleCI input + +```yaml +orbs: + aws-ecr: circleci/aws-ecr@x.y +jobs: + aws-ecr-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecr/build-image: + region: AWS_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + checkout: true + ecr-login: true + account-url: AWS_ECR_ACCOUNT_URL + dockerfile: MyDockerFile + path: . + extra-build-args: -e example + repo: my-repo + tags: my-tag-1, my-tag-2 + no-output-timeout: "20m" +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" +- uses: aws-actions/amazon-ecr-login@v1.5.3 +- run: |- + docker build -e example -f ./MyDockerFile -t ${{ env.AWS_ECR_ACCOUNT_URL }}/my-repo:my-tag-1 . + docker build -e example -f ./MyDockerFile -t ${{ env.AWS_ECR_ACCOUNT_URL }}/my-repo:my-tag-2 . + timeout-minutes: '20' +``` + +### Unsupported Options + +- skip-when-tags-exist +- profile-name diff --git a/docs/circle_ci/Orbs/AwsEcr/CreateRepo.md b/docs/circle_ci/Orbs/AwsEcr/CreateRepo.md new file mode 100644 index 00000000..87935c86 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/CreateRepo.md @@ -0,0 +1,28 @@ +# CircleCI/AwsEcr Create Repo + +## CircleCI input + +```yaml +orbs: + aws-ecr: circleci/aws-cli@x.y +jobs: + aws-ecr-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecr/create-repo: + region: AWS_REGION + repo: my-repo-name + profile-name: my-profile + repo-scan-on-push: true +``` + +### Transformed Github Action + +```yaml +- run: aws ecr create-repository --profile my-profile --region ${{ env.AWS_REGION }} --repository-name my-repo-name --image-scanning-configuration scanOnPush=true +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/AwsEcr/Default.md b/docs/circle_ci/Orbs/AwsEcr/Default.md new file mode 100644 index 00000000..5497b07e --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/Default.md @@ -0,0 +1,25 @@ +# CircleCI/aws-ecr Default Executor + +## CircleCI input + +```yaml +orbs: + aws-ecr: circleci/aws-ecr@x.y +jobs: + use-aws-ecr-example: + executor: aws-ecr/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +job: + ubuntu-job: + runs-on: ubuntu-20.04 +``` + +### Unsupported Options + +- use-docker-layer-caching diff --git a/docs/circle_ci/Orbs/AwsEcr/EcrLogin.md b/docs/circle_ci/Orbs/AwsEcr/EcrLogin.md new file mode 100644 index 00000000..043c13f3 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/EcrLogin.md @@ -0,0 +1,33 @@ +# CircleCI/AwsEcr Ecr Login + +## CircleCI input + +```yaml +orbs: + aws-ecr: circleci/aws-ecr@x.y +jobs: + aws-ecr-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecr/ecr-login: + region: AWS_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" +- uses: aws-actions/amazon-ecr-login@v1.5.3 +``` + +### Unsupported Options + +- account-url +- profile-name diff --git a/docs/circle_ci/Orbs/AwsEcr/PushImage.md b/docs/circle_ci/Orbs/AwsEcr/PushImage.md new file mode 100644 index 00000000..2dc8ee3e --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/PushImage.md @@ -0,0 +1,29 @@ +# CircleCI/AwsEcr Push Image + +## CircleCI input + +```yaml +orbs: + aws-ecr: circleci/aws-ecr@x.y +jobs: + aws-ecr-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecr/push-image: + account-url: AWS_ECR_ACCOUNT_URL + repo: my-repo + tags: my-tag-1, my-tag-2 +``` + +### Transformed Github Action + +```yaml +- run: |- + docker push ${{ env.AWS_ECR_ACCOUNT_URL }}/my-repo:my-tag-1 + docker push ${{ env.AWS_ECR_ACCOUNT_URL }}/my-repo:my-tag-2 +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/AwsEcr/index.md b/docs/circle_ci/Orbs/AwsEcr/index.md new file mode 100644 index 00000000..74a65dc2 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcr/index.md @@ -0,0 +1,15 @@ +# [CircleCI AwsEcr](https://circleci.com/developer/orbs/orb/circleci/aws-ecr) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------- | +| [BuildAndPushImage](BuildAndPushImage.md) | actions/checkout@v1, actions/download-artifact@v2, aws-actions/configure-aws-credentials@v1, aws-actions/amazon-ecr-login, run | +| [BuildImage](BuildImage.md) | aws-actions/configure-aws-credentials@v1, aws-actions/amazon-ecr-login, run | +| [CreateRepo](CreateRepo.md) | run | +| [Default](Default.md) | runs-on | +| [EcrLogin](EcrLogin.md) | aws-actions/configure-aws-credentials@v1, aws-actions/amazon-ecr-login | +| [PushImage](PushImage.md) | run | + +## Indeterminate behavior on self-hosted runners + +- create-repo +- ecr-login diff --git a/docs/circle_ci/Orbs/AwsEcs/DeployServiceUpdate.md b/docs/circle_ci/Orbs/AwsEcs/DeployServiceUpdate.md new file mode 100644 index 00000000..73a5a13a --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcs/DeployServiceUpdate.md @@ -0,0 +1,60 @@ +# CircleCI/Aws-Ecs Update Service + +## CircleCI input + +```yaml +orbs: + aws-ecs: circleci/aws-ecs@x.y +jobs: + aws-ecs-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecs/deploy-service-update: + task-definition: my-task-def.json, + cluster-name: my-cluster-name, + family: my-ecs-family, + deployment-controller: CODE_DEPLOY, + codedeploy-application-name: my-app-name, + codedeploy-deployment-group-name: my-deployment-group, + container-env-var-updates: container=container-name,name=env-var-name,value=env-var-value, + force-new-deployment: true, + service-name: my-service, + verification-timeout: 20m +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/amazon-ecs-render-task-definition@v1.1.2 + with: + task-definition: "{{ env.TASK_DEFINITION_JSON }}" + container-name: "${{ env.ECS_CONTAINER_NAME }}" + image: "${{ env.ECS_CONTAINER_IMAGE_URI }}" +- uses: aws-actions/amazon-ecs-deploy-task-definition@v1.4.11 + with: + task-definition: "{{ env.TASK_DEFINITION_JSON }}" + service: my-service + cluster: my-cluster-name + wait-for-service-stability: true + codedeploy-appspec: "${{ env.CODE_DEPLOY_APPSPEC }}" + codedeploy-application: my-app-name + codedeploy-deployment-group: my-deployment-group + wait-for-minutes: '20' + force-new-deployment: true + env: + CONTAINER: container-name + NAME: env-var-name + VALUE: env-var-value +``` + +### Unsupported Options + +- skip-task-definition-registration +- task-definition-tag +- codedeploy-load-balanced-container-name +- codedeploy-load-balanced-container-port +- container-image-name-updates +- max-poll-attempts +- poll-interval +- fail-on-verification-timeout diff --git a/docs/circle_ci/Orbs/AwsEcs/RunTask.md b/docs/circle_ci/Orbs/AwsEcs/RunTask.md new file mode 100644 index 00000000..f0e57bfd --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcs/RunTask.md @@ -0,0 +1,31 @@ +# CircleCI/Aws-Ecs RunTask + +## CircleCI input + +```yaml +orbs: + aws-ecs: circleci/aws-ecs@x.y +jobs: + aws-ecs-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecs/run-task: + task-definition: my-task-def.json + +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_DEFAULT_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" + run: aws ecs run-task --task-definition my-task-def.json +``` + +### Unsupported Options + +- docker-image-for-job diff --git a/docs/circle_ci/Orbs/AwsEcs/UpdateService.md b/docs/circle_ci/Orbs/AwsEcs/UpdateService.md new file mode 100644 index 00000000..8713e60c --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcs/UpdateService.md @@ -0,0 +1,60 @@ +# CircleCI/Aws-Ecs Update Service + +## CircleCI input + +```yaml +orbs: + aws-ecs: circleci/aws-ecs@x.y +jobs: + aws-ecs-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecs/update-service: + task-definition: my-task-def.json, + cluster-name: my-cluster-name, + family: my-ecs-family, + deployment-controller: CODE_DEPLOY, + codedeploy-application-name: my-app-name, + codedeploy-deployment-group-name: my-deployment-group, + container-env-var-updates: container=container-name,name=env-var-name,value=env-var-value, + force-new-deployment: true, + service-name: my-service, + verification-timeout: 20m +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/amazon-ecs-render-task-definition@v1.1.2 + with: + task-definition: "{{ env.TASK_DEFINITION_JSON }}" + container-name: "${{ env.ECS_CONTAINER_NAME }}" + image: "${{ env.ECS_CONTAINER_IMAGE_URI }}" +- uses: aws-actions/amazon-ecs-deploy-task-definition@v1.4.11 + with: + task-definition: "{{ env.TASK_DEFINITION_JSON }}" + service: my-service + cluster: my-cluster-name + wait-for-service-stability: true + codedeploy-appspec: "${{ env.CODE_DEPLOY_APPSPEC }}" + codedeploy-application: my-app-name + codedeploy-deployment-group: my-deployment-group + wait-for-minutes: '20' + force-new-deployment: true + env: + CONTAINER: container-name + NAME: env-var-name + VALUE: env-var-value +``` + +### Unsupported Options + +- skip-task-definition-registration +- task-definition-tag +- codedeploy-load-balanced-container-name +- codedeploy-load-balanced-container-port +- container-image-name-updates +- max-poll-attempts +- poll-interval +- fail-on-verification-timeout diff --git a/docs/circle_ci/Orbs/AwsEcs/UpdateTaskDefinitionFromJson.md b/docs/circle_ci/Orbs/AwsEcs/UpdateTaskDefinitionFromJson.md new file mode 100644 index 00000000..19269ad2 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcs/UpdateTaskDefinitionFromJson.md @@ -0,0 +1,29 @@ +# CircleCI/Aws-Ecs UpdateTaskDefinitionFromJson + +## CircleCI input + +```yaml +orbs: + aws-ecs: circleci/aws-ecs@x.y +jobs: + aws-ecs-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-ecs/update-task-definition-from-json: + task-definition-json: my-task-def.json +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/amazon-ecs-render-task-definition@v1.1.2 + with: + task-definition: my-task-def.json + container-name: ${{ env.ECS_CONTAINER_NAME }} + image: ${{ env.ECS_CONTAINER_IMAGE_URI }} +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/AwsEcs/index.md b/docs/circle_ci/Orbs/AwsEcs/index.md new file mode 100644 index 00000000..09280e84 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsEcs/index.md @@ -0,0 +1,13 @@ +# [CircleCI Aws-Ecs](https://circleci.com/developer/orbs/orb/circleci/aws-ecs) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :----------------------------------------------------------------------------- | +| [DeployServiceUpdate](DeployServiceUpdate.md) | aws-actions/configure-aws-credentials@v1, run | +| [RunTask](RunTask.md) | aws-actions/configure-aws-credentials@v1, run | +| [UpdateService](UpdateService.md) | aws-actions/configure-aws-credentials@v1, run | +| [UpdateTaskDefinitionFromJson](UpdateTaskDefinitionFromJson.md) | aws-actions/amazon-ecs-render-task-definition@v1.1.2 | + +## Unsupported + +- UpdateTaskDefinition +- VerifyRevisionDeployment diff --git a/docs/circle_ci/Orbs/AwsS3/Copy.md b/docs/circle_ci/Orbs/AwsS3/Copy.md new file mode 100644 index 00000000..25c3f6d8 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsS3/Copy.md @@ -0,0 +1,35 @@ +# CircleCI/AwsS3 Setup + +## CircleCI input + +```yaml +orbs: + aws-s3: circleci/aws-s3@x.y +jobs: + aws-s3-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-s3/copy: + aws-region: AWS_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + to: copy/to + from: copy/from + arguments: -sse +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" +- run: aws s3 cp copy/from copy/to -sse +``` + +### Unsupported Options + +- None \ No newline at end of file diff --git a/docs/circle_ci/Orbs/AwsS3/Sync.md b/docs/circle_ci/Orbs/AwsS3/Sync.md new file mode 100644 index 00000000..fefbedc0 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsS3/Sync.md @@ -0,0 +1,35 @@ +# CircleCI/AwsS3 Sync + +## CircleCI input + +```yaml +orbs: + aws-s3: circleci/aws-s3@x.y +jobs: + aws-s3-example: + docker: + - image: 'cimg/base:stable' + steps: + - aws-s3/sync: + aws-region: AWS_REGION + aws-access-key-id: AWS_ACCESS_KEY_ID + aws-secret-access-key: AWS_SECRET_ACCESS_KEY + to: copy/to + from: copy/from + arguments: -sse +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: "${{ env.AWS_REGION }}" + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" +- run: aws s3 sync copy/from copy/to -sse +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/AwsS3/index.md b/docs/circle_ci/Orbs/AwsS3/index.md new file mode 100644 index 00000000..0e4d7655 --- /dev/null +++ b/docs/circle_ci/Orbs/AwsS3/index.md @@ -0,0 +1,6 @@ +# [CircleCI AwsS3](https://circleci.com/developer/orbs/orb/circleci/aws-s3) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :----------------------------------------------------------------------------- | +| [Copy](Copy.md) | aws-actions/configure-aws-credentials@v1, run | +| [Sync](Sync.md) | aws-actions/configure-aws-credentials@v1, run | diff --git a/docs/circle_ci/Orbs/BrowserTools/index.md b/docs/circle_ci/Orbs/BrowserTools/index.md new file mode 100644 index 00000000..8a97fd3e --- /dev/null +++ b/docs/circle_ci/Orbs/BrowserTools/index.md @@ -0,0 +1,9 @@ +# [CircleCI BrowserTools](https://circleci.com/developer/orbs/orb/circleci/browser-tools) + +## Indeterminate behavior on self-hosted runners + +- install-browser-tools +- install-chrome +- install-chromedriver +- install-firefox +- install-geckodriver diff --git a/docs/circle_ci/Orbs/Cypress/Executors.md b/docs/circle_ci/Orbs/Cypress/Executors.md new file mode 100644 index 00000000..37e92f95 --- /dev/null +++ b/docs/circle_ci/Orbs/Cypress/Executors.md @@ -0,0 +1,49 @@ +# CypressIo/Cypress Executors + +## CircleCI input + +```yaml +orbs: + cypress: cypress-io/cypress@x.y +jobs: + cypress-example: + executor: cypress/base-6 + steps: + - cypress/run +``` + +### Transformed Github Action + +```yaml +jobs: + cypress-example: + runs-on: ubuntu-latest + container: + image: cypress/base:6 + steps: + - uses: actions/checkout@v2 +``` + +## Supported Executors + +- default +- base-6 +- base-8 +- base-10 +- base-10-22-0 +- base-12-6-0 +- base-12-14-0 +- base-12-16-1 +- base-12-18-3 +- base-12 +- base-14-0-0 +- base-14-7-0 +- base-14 +- browsers-chrome69 +- browsers-chrome73 +- browsers-chrome74 +- browsers-chrome75 +- browsers-chrome76 +- browsers-chrome77 +- browsers-chrome78-ff70 +- browsers-chrome73-ff68 diff --git a/docs/circle_ci/Orbs/Cypress/Install.md b/docs/circle_ci/Orbs/Cypress/Install.md new file mode 100644 index 00000000..9422beb1 --- /dev/null +++ b/docs/circle_ci/Orbs/Cypress/Install.md @@ -0,0 +1,42 @@ +# CypressIo/Cypress Install + +## CircleCI input + +```yaml +orbs: + cypress: cypress-io/cypress@x.y +jobs: + cypress-example: + docker: + - image: 'cimg/base:stable' + steps: + - cypress/install: + post-install: + - checkout + build: npm run build + install-command: yarn --frozen-lockfile --silent + cache-key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "MY_CUSTOM_CACHE_KEY" }} + working_directory: my/path + verify-command: npx verify-mycommand + yarn: true +``` + +### Transformed Github Action + +```yaml +- uses: actions/cache@v2 + with: + key: my-cache-key + path: "~/.cache" +- run: yarn --frozen-lockfile --silent + working-directory: my/path +- uses: actions/checkout@v2 +- run: npx verify-mycommand + working-directory: my/path +- run: npm run build + working-directory: my/path +``` + +### Unsupported Options + +- executor diff --git a/docs/circle_ci/Orbs/Cypress/Run.md b/docs/circle_ci/Orbs/Cypress/Run.md new file mode 100644 index 00000000..929433a4 --- /dev/null +++ b/docs/circle_ci/Orbs/Cypress/Run.md @@ -0,0 +1,85 @@ +# CypressIo/Cypress Run + +## CircleCI input + +```yaml +orbs: + cypress: cypress-io/cypress@x.y +jobs: + cypress-example: + docker: + - image: 'cimg/base:stable' + steps: + - cypress/run: + post-checkout: + - restore_cache + record: true + debug: true + parallel: true + ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' + group: my-group + build: npm run build + start: npm start + wait-on: 'http://localhost:8080' + browser: firefox + store_artifacts: true + spec: --spec * + install-command: yarn --frozen-lockfile --silent + command: yarn cypress run-ct + command-prefix: 'percy exec -- npx' + cache-key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "MY_CUSTOM_CACHE_KEY" }} + working-directory: my/path + timeout: 20m + config-file: tests/cypress-config.json + config: pageLoadTimeout=100000,baseUrl=http://localhost:3000 +``` + +### Transformed Github Action + +```yaml +- name: restore_cache + uses: actions/cache@v2 + with: + key: my-example-key +- uses: cypress-io/github-action@v2 + with: + record: true + config: pageLoadTimeout=100000,baseUrl=http://localhost:3000 + config-file: tests/cypress-config.json + browser: firefox + command: yarn cypress run-ct + start: npm start + build: npm run build + install: true + install-command: yarn --frozen-lockfile --silent + wait-on: http://localhost:8080 + parallel: true + group: my-group + working-directory: my/path + spec: "--spec *" + command-prefix: percy exec -- npx + ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}" + cache-key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "MY_CUSTOM_CACHE_KEY" }} + timeout-minutes: '20' + env: + DEBUG: true +- uses: actions/upload-artifact@v2 + if: failure() + with: + name: cypress-screenshots + path: cypress/screenshots +- uses: actions/upload-artifact@v2 + if: always() + with: + name: cypress-videos + path: cypress/videos +``` + +### Unsupported Options + +- post-install +- verify-command +- yarn +- attach-workspace +- no-workspace +- executor diff --git a/docs/circle_ci/Orbs/Cypress/Setup.md b/docs/circle_ci/Orbs/Cypress/Setup.md new file mode 100644 index 00000000..f04bd47e --- /dev/null +++ b/docs/circle_ci/Orbs/Cypress/Setup.md @@ -0,0 +1,42 @@ +# CypressIo/Cypress Setup + +## CircleCI input + +```yaml +orbs: + cypress: cypress-io/cypress@x.y +jobs: + cypress-example: + docker: + - image: 'cimg/base:stable' + steps: + - cypress/setup: + post-install: + - checkout + build: npm run build + install-command: yarn --frozen-lockfile --silent + cache-key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "MY_CUSTOM_CACHE_KEY" }} + working_directory: my/path + verify-command: npx verify-mycommand + yarn: true +``` + +### Transformed Github Action + +```yaml +- uses: actions/cache@v2 + with: + key: my-cache-key + path: "~/.cache" +- run: yarn --frozen-lockfile --silent + working-directory: my/path +- uses: actions/checkout@v2 +- run: npx verify-mycommand + working-directory: my/path +- run: npm run build + working-directory: my/path +``` + +### Unsupported Options + +- executor diff --git a/docs/circle_ci/Orbs/Cypress/WriteWorkspace.md b/docs/circle_ci/Orbs/Cypress/WriteWorkspace.md new file mode 100644 index 00000000..bad38016 --- /dev/null +++ b/docs/circle_ci/Orbs/Cypress/WriteWorkspace.md @@ -0,0 +1,28 @@ +# CypressIo/Cypress Write Workspace + +## CircleCI input + +```yaml +orbs: + cypress: cypress-io/cypress@x.y +jobs: + cypress-example: + docker: + - image: 'cimg/base:stable' + steps: + - cypress/write_workspace +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + with: + path: |- + ~/project + ~/.cache/Cypress +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Cypress/index.md b/docs/circle_ci/Orbs/Cypress/index.md new file mode 100644 index 00000000..52614bf0 --- /dev/null +++ b/docs/circle_ci/Orbs/Cypress/index.md @@ -0,0 +1,13 @@ +# [CypressIO Cypress](https://circleci.com/developer/orbs/orb/cypress-io/cypress) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------------- | +| [Executors](Executors.md) | container | +| [Install](Install.md) | actions/cache@v2, run | +| [Run](Run.md) | cypress-io/github-action@v2 | +| [Setup](Setup.md) | actions/cache@v2, run | +| [WriteWorkspace](WriteWorkspace.md) | actions/upload-artifact@v2 | + +## Unsupported + +- None diff --git a/docs/circle_ci/Orbs/Docker/Build.md b/docs/circle_ci/Orbs/Docker/Build.md new file mode 100644 index 00000000..27f92381 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Build.md @@ -0,0 +1,50 @@ +# CircleCI/Docker Build + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/build: + attach-at: path-to-attach + cache_from: image1, image2 + extra_build_args: --compress + path: wd + image: my-image + lint-dockerfile: true + treat-warnings-as-errors: true + step-name: My docker build step + tag: my-tag + registry: my-registry +``` + +### Transformed Github Action + +```yaml +- run: npm install -g dockerlint +- run: dockerlint -p Dockerfile +- uses: actions/download-artifact@v2 + with: + path: path-to-attach +- run: docker pull image1 +- run: docker pull image2 +- name: My docker build step + run: |- + docker build \\ + --compress \\ + -f wd/Dockerfile \\ + --cache-from image1 \\ + --cache-from image2 \\ + -t my-registry/my-image:my-tag + timeout-minutes: '10' + continue-on-error: true +``` + +### Unsupported Options + +- debug diff --git a/docs/circle_ci/Orbs/Docker/Check.md b/docs/circle_ci/Orbs/Docker/Check.md new file mode 100644 index 00000000..5aff919d --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Check.md @@ -0,0 +1,172 @@ +# CircleCI/Docker Check + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/check: + docker-password: DOCKER_PASSWORD + docker-username: DOCKER_LOGIN + registry: docker.io + use-docker-credentials-store: true +``` + +### Transformed Github Action (Composite Action Feature Enabled) +workflow +```yaml +uses: "./.github/actions/docker_check" +with: + docker-password: "${{ secrets.DOCKER_PASSWORD }}" + docker-username: "${{ env.DOCKER_LOGIN }}" + registry: docker.io + use-docker-credentials-store: true +``` +action.yml +```yaml +name: docker_check +inputs: + docker-password: + required: true + docker-username: + required: true + registry: + required: false + default: docker.io + use-docker-credentials-store: + required: false + default: false +runs: + using: composite + steps: + - id: release_tag + run: |- + RELEASE_VERSION=$(curl -Ls --fail --retry 3 -o /dev/null -w %{url_effective} 'https://github.com/docker/docker-credential-helpers/releases/latest' | sed 's:.*/::') + echo ::set-output name=release_tag::$RELEASE_VERSION + if: "${{ fromJSON(inputs.use-docker-credentials-store) }}" + shell: bash + - run: |- + HELPER_FILENAME="docker-credential-${{ env.HELPER_NAME }}" + + if which "$HELPER_FILENAME" > /dev/null 2>&1; then + echo "$HELPER_FILENAME is already installed" + exit 0 + fi + + GPG_TEMPLATE=$(mktemp gpg_template.XXXXXX) + cat > $GPG_TEMPLATE <<-EOF + Key-Type: RSA + Key-Length: 2048 + Name-Real: GitHubActions + Expire-Date: 0 + %no-protection + %no-ask-passphrase + %commit + EOF + + if [ "$HELPER_FILENAME" = "docker-credential-pass" ]; then + sudo apt-get update --yes && sudo apt-get install gnupg2 pass --yes + gpg2 --batch --gen-key "$GPG_TEMPLATE" + FINGERPRINT_STRING=$(gpg2 --list-keys --with-fingerprint --with-colons GitHubActions | grep fpr) + arrFINGERPRINT=(${FINGERPRINT_STRING//:/ }) + FINGERPRINT=${arrFINGERPRINT[-1]} + pass init $FINGERPRINT + fi + rm $GPG_TEMPLATE + + curl -L -o "${HELPER_FILENAME}_archive" "https://github.com/docker/docker-credential-helpers/releases/download/${{ env.RELEASE_TAG }}/${HELPER_FILENAME}-${{ env.RELEASE_TAG }}-amd64.tar.gz" + tar xvf "./${HELPER_FILENAME}_archive" + chmod +x "./$HELPER_FILENAME" + mv "./$HELPER_FILENAME" "${{ env.BIN_PATH }}/$HELPER_FILENAME" + "${{ env.BIN_PATH }}/$HELPER_FILENAME" version + rm "./${HELPER_FILENAME}_archive" + env: + HELPER_NAME: pass + RELEASE_TAG: "${{ steps.release_tag.outputs.release_tag }}" + BIN_PATH: "/usr/local/bin" + if: "${{ fromJSON(inputs.use-docker-credentials-store) }}" + shell: bash + - run: |- + mkdir -p $(dirname $HOME/.docker/config.json) + cat $HOME/.docker/config.json | jq --arg credsStore '${{ env.HELPER_NAME }}' '. + {credsStore: $credsStore}' > /tmp/docker-config-credsstore-update.json + cat /tmp/docker-config-credsstore-update.json > $HOME/.docker/config.json + rm /tmp/docker-config-credsstore-update.json + env: + HELPER_NAME: pass + if: "${{ fromJSON(inputs.use-docker-credentials-store) }}" + shell: bash + - uses: docker/login-action@v2.1.0 + with: + username: "${{ inputs.docker-username }}" + password: "${{ inputs.docker-password }}" + registry: "${{ inputs.registry }}" +``` +### Transformed Github Action (Composite Action Feature Disabled) +```yaml +jobs: + docker-example: + runs-on: ubuntu-latest + container: + image: ubuntu + steps: + - id: release_tag + run: |- + RELEASE_VERSION=$(curl -Ls --fail --retry 3 -o /dev/null -w %{url_effective} 'https://github.com/docker/docker-credential-helpers/releases/latest' | sed 's:.*/::') + echo ::set-output name=release_tag::$RELEASE_VERSION + - run: |- + HELPER_FILENAME="docker-credential-${{ env.HELPER_NAME }}" + if which "$HELPER_FILENAME" > /dev/null 2>&1; then + echo "$HELPER_FILENAME is already installed" + exit 0 + fi + GPG_TEMPLATE=$(mktemp gpg_template.XXXXXX) + cat > $GPG_TEMPLATE <<-EOF + Key-Type: RSA + Key-Length: 2048 + Name-Real: GitHubActions + Expire-Date: 0 + %no-protection + %no-ask-passphrase + %commit + EOF + if [ "$HELPER_FILENAME" = "docker-credential-pass" ]; then + sudo apt-get update --yes && sudo apt-get install gnupg2 pass --yes + gpg2 --batch --gen-key "$GPG_TEMPLATE" + FINGERPRINT_STRING=$(gpg2 --list-keys --with-fingerprint --with-colons GitHubActions | grep fpr) + arrFINGERPRINT=(${FINGERPRINT_STRING//:/ }) + FINGERPRINT=${arrFINGERPRINT[-1]} + pass init $FINGERPRINT + fi + rm $GPG_TEMPLATE + curl -L -o "${HELPER_FILENAME}_archive" "https://github.com/docker/docker-credential-helpers/releases/download/${{ env.RELEASE_TAG }}/${HELPER_FILENAME}-${{ env.RELEASE_TAG }}-amd64.tar.gz" + tar xvf "./${HELPER_FILENAME}_archive" + chmod +x "./$HELPER_FILENAME" + mv "./$HELPER_FILENAME" "${{ env.BIN_PATH }}/$HELPER_FILENAME" + "${{ env.BIN_PATH }}/$HELPER_FILENAME" version + rm "./${HELPER_FILENAME}_archive" + env: + HELPER_NAME: pass + RELEASE_TAG: "${{ steps.release_tag.outputs.release_tag }}" + BIN_PATH: "/usr/local/bin" + - run: |- + mkdir -p $(dirname $HOME/.docker/config.json) + cat $HOME/.docker/config.json | jq --arg credsStore '${{ env.HELPER_NAME }}' '. + {credsStore: $credsStore}' > /tmp/docker-config-credsstore-update.json + cat /tmp/docker-config-credsstore-update.json > $HOME/.docker/config.json + rm /tmp/docker-config-credsstore-update.json + env: + HELPER_NAME: pass + - uses: docker/login-action@v2.1.0 + with: + username: "${{ env.DOCKER_LOGIN }}" + password: "${{ secrets.DOCKER_PASSWORD }}" + registry: docker.io +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/ConfigureDockerCredentialsStore.md b/docs/circle_ci/Orbs/Docker/ConfigureDockerCredentialsStore.md new file mode 100644 index 00000000..1d88ec44 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/ConfigureDockerCredentialsStore.md @@ -0,0 +1,32 @@ +# CircleCI/Docker Configure Docker Credentials Store + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/configure-docker-credentials-store: + helper-name: pass + docker-config-path: $HOME/.docker/config.json +``` + +### Transformed Github Action + +```yaml +- run: |- + mkdir -p $(dirname $HOME/.docker/config.json) + cat $HOME/.docker/config.json | jq --arg credsStore '${{ env.HELPER_NAME }}' '. + {credsStore: $credsStore}' > /tmp/docker-config-credsstore-update.json + cat /tmp/docker-config-credsstore-update.json > $HOME/.docker/config.json + rm /tmp/docker-config-credsstore-update.json + env: + HELPER_NAME: pass +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/Dockerlint.md b/docs/circle_ci/Orbs/Docker/Dockerlint.md new file mode 100644 index 00000000..0a4929bf --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Dockerlint.md @@ -0,0 +1,27 @@ +# CircleCI/Docker Dockerlint + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/dockerlint: + dockerfile: MyDockerfile + treat-warnings-as-errors: true +``` + +### Transformed Github Action + +```yaml +- run: npm install -g dockerlint +- run: dockerlint -p MyDockerfile +``` + +### Unsupported Options + +- debug diff --git a/docs/circle_ci/Orbs/Docker/Executors.md b/docs/circle_ci/Orbs/Docker/Executors.md new file mode 100644 index 00000000..f47ffb0c --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Executors.md @@ -0,0 +1,34 @@ +# CircleCI/Docker Executors + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + executor: + name: docker/docker + image: python + tag: 2 + + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +- container: + image: python:2 +``` + +## Supported Executors + +- hadolint +- docker +- machine + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/Hadolint.md b/docs/circle_ci/Orbs/Docker/Hadolint.md new file mode 100644 index 00000000..59520c6f --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Hadolint.md @@ -0,0 +1,33 @@ +# CircleCI/Docker Hadolint + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/hadolint: + dockerfiles: Dockerfile, MyDockerfile + ignore-rules: DL3000, SC1010 +``` + +### Transformed Github Action + +```yaml +- uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + ignore: DL3000 SC1010 +- uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: MyDockerfile + ignore: DL3000 SC1010 +``` + +### Unsupported Options + +- trusted-registries diff --git a/docs/circle_ci/Orbs/Docker/InstallDockerCredentialHelper.md b/docs/circle_ci/Orbs/Docker/InstallDockerCredentialHelper.md new file mode 100644 index 00000000..9683091c --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/InstallDockerCredentialHelper.md @@ -0,0 +1,63 @@ +# CircleCI/Docker Install Docker Credential Helper + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/install-docker-credential-helper: + helper-name: pass +``` + +### Transformed Github Action + +```yaml +- id: release_tag + run: |- + RELEASE_VERSION=$(curl -Ls --fail --retry 3 -o /dev/null -w %{url_effective} 'https://github.com/docker/docker-credential-helpers/releases/latest' | sed 's:.*/::') + echo ::set-output name=release_tag::$RELEASE_VERSION +- run: |- + HELPER_FILENAME="docker-credential-${{ env.HELPER_NAME }}" + if which "$HELPER_FILENAME" > /dev/null 2>&1; then + echo "$HELPER_FILENAME is already installed" + exit 0 + fi + GPG_TEMPLATE=$(mktemp gpg_template.XXXXXX) + cat > $GPG_TEMPLATE <<-EOF + Key-Type: RSA + Key-Length: 2048 + Name-Real: GitHubActions + Expire-Date: 0 + %no-protection + %no-ask-passphrase + %commit + EOF + if [ "$HELPER_FILENAME" = "docker-credential-pass" ]; then + sudo apt-get update --yes && sudo apt-get install gnupg2 pass --yes + gpg2 --batch --gen-key "$GPG_TEMPLATE" + FINGERPRINT_STRING=$(gpg2 --list-keys --with-fingerprint --with-colons GitHubActions | grep fpr) + arrFINGERPRINT=(${FINGERPRINT_STRING//:/ }) + FINGERPRINT=${arrFINGERPRINT[-1]} + pass init $FINGERPRINT + fi + rm $GPG_TEMPLATE + curl -L -o "${HELPER_FILENAME}_archive" "https://github.com/docker/docker-credential-helpers/releases/download/${{ env.RELEASE_TAG }}/${HELPER_FILENAME}-${{ env.RELEASE_TAG }}-amd64.tar.gz" + tar xvf "./${HELPER_FILENAME}_archive" + chmod +x "./$HELPER_FILENAME" + mv "./$HELPER_FILENAME" "${{ env.BIN_PATH }}/$HELPER_FILENAME" + "${{ env.BIN_PATH }}/$HELPER_FILENAME" version + rm "./${HELPER_FILENAME}_archive" + env: + HELPER_NAME: pass + RELEASE_TAG: "${{ steps.release_tag.outputs.release_tag }}" + BIN_PATH: "/usr/local/bin" +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/InstallDockerTools.md b/docs/circle_ci/Orbs/Docker/InstallDockerTools.md new file mode 100644 index 00000000..9a3cdf98 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/InstallDockerTools.md @@ -0,0 +1,49 @@ +# CircleCI/Docker Install Docker Tools + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/install-docker-tools: + dockerize-version: v1 + dockerize-install-dir: dockerize/path + goss-verison: v2 + goss-install-dir: goss/path +``` + +### Transformed Github Action (Composite Action Enabled) + +```yaml +steps: +- uses: "./.github/actions/docker_install_dockerize" + with: + install-dir: dockerize/path + version: v1 +- run: curl -fsSL https://goss.rocks/install | GOSS_DST='goss/path' sh +``` + +### Transformed Github Action (Composite Action Disabled) +```yaml +steps: +- run: |- + if [[ $VERSION == "latest" ]]; then VERSION="${{ steps.version.outputs.version }}"; fi + curl -O --silent --show-error --location --fail --retry 3 "https://github.com/jwilder/dockerize/releases/download/$VERSION/dockerize-linux-amd64-$VERSION.tar.gz" + tar xf "dockerize-linux-amd64-$VERSION.tar.gz" + rm -f "dockerize-linux-amd64-$VERSION.tar.gz" + mv dockerize ${{ env.INSTALL_DIR }} + chmod +x ${{ env.INSTALL_DIR }}/dockerize + echo "dockerize $(dockerize --version) has been installed to $(which dockerize)" + env: + VERSION: v1 + INSTALL_DIR: dockerize/path +- run: curl -fsSL https://goss.rocks/install | GOSS_DST='goss/path' sh +``` +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/InstallDockerize.md b/docs/circle_ci/Orbs/Docker/InstallDockerize.md new file mode 100644 index 00000000..60e4e95b --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/InstallDockerize.md @@ -0,0 +1,76 @@ +# CircleCI/Docker Install Dockerize + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/install-dockerize: + version: latest +``` + +### Transformed Github Action (Composite Action Enabled) +workflow +```yaml +- uses: "./.github/actions/docker_install_dockerize" + with: + version: latest +``` +action.yml +```yaml +name: docker_install_dockerize +inputs: + install-dir: + required: false + default: "/usr/local/bin" + version: + required: false + default: latest +runs: + using: composite + steps: + - id: version + run: |- + DOCKERIZE_VERSION=$(curl --fail --retry 3 -Ls -o /dev/null -w %{url_effective} 'https://github.com/jwilder/dockerize/releases/latest' | sed 's:.*/::') + echo ::set-output name=version::$DOCKERIZE_VERSION + shell: bash + - run: |- + if [[ $VERSION == "latest" ]]; then VERSION="${{ steps.version.outputs.version }}"; fi + curl -O --silent --show-error --location --fail --retry 3 "https://github.com/jwilder/dockerize/releases/download/$VERSION/dockerize-linux-amd64-$VERSION.tar.gz" + tar xf "dockerize-linux-amd64-$VERSION.tar.gz" + rm -f "dockerize-linux-amd64-$VERSION.tar.gz" + mv dockerize ${{ env.INSTALL_DIR }} + chmod +x ${{ env.INSTALL_DIR }}/dockerize + echo "dockerize $(dockerize --version) has been installed to $(which dockerize)" + env: + VERSION: "${{ inputs.version }}" + INSTALL_DIR: "${{ inputs.install-dir }}" + shell: bash +``` +### Transformed Github Action (Composite Action Disabled) +```yaml +steps: +- id: version + run: |- + DOCKERIZE_VERSION=$(curl --fail --retry 3 -Ls -o /dev/null -w %{url_effective} 'https://github.com/jwilder/dockerize/releases/latest' | sed 's:.*/::') + echo ::set-output name=version::$DOCKERIZE_VERSION +- run: |- + if [[ $VERSION == "latest" ]]; then VERSION="${{ steps.version.outputs.version }}"; fi + curl -O --silent --show-error --location --fail --retry 3 "https://github.com/jwilder/dockerize/releases/download/$VERSION/dockerize-linux-amd64-$VERSION.tar.gz" + tar xf "dockerize-linux-amd64-$VERSION.tar.gz" + rm -f "dockerize-linux-amd64-$VERSION.tar.gz" + mv dockerize ${{ env.INSTALL_DIR }} + chmod +x ${{ env.INSTALL_DIR }}/dockerize + echo "dockerize $(dockerize --version) has been installed to $(which dockerize)" + env: + VERSION: latest + INSTALL_DIR: "/usr/local/bin" +``` +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/InstallGoss.md b/docs/circle_ci/Orbs/Docker/InstallGoss.md new file mode 100644 index 00000000..173f7e13 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/InstallGoss.md @@ -0,0 +1,26 @@ +# CircleCI/Docker Install Goss + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/install-goss: + install-dir: my/path + version: v1.0 +``` + +### Transformed Github Action + +```yaml +- run: curl -fsSL https://goss.rocks/install | GOSS_DST='my/path' GOSS_VER=v1.0 sh +``` + +### Unsupported Options + +- debug diff --git a/docs/circle_ci/Orbs/Docker/Publish.md b/docs/circle_ci/Orbs/Docker/Publish.md new file mode 100644 index 00000000..2e601510 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Publish.md @@ -0,0 +1,104 @@ +# CircleCI/Docker Publish + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y.z + +workflows: + build-docker-image-only: + jobs: + - docker/publish: + attach-at: path-to-attach + cache_from: image1, image2 + extra_build_args: --compress + path: wd + image: my-image + lint-dockerfile: true + treat-warnings-as-errors: true + step-name: My docker build step + tag: my-tag + registry: my-registry + docker-password: DOCKER_PASSWORD + docker-username: DOCKER_LOGIN + registry: docker.io + use-docker-credentials-store: true + after_checkout: + - run: echo after checkout + before_build: + - run: echo before build + after_build: + - run: echo before build + update-description: true +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 +- run: echo after checkout +- uses: actions/download-artifact@v2 + with: + path: path-to-attach +- id: release_tag + run: |- + RELEASE_VERSION=$(curl -Ls --fail --retry 3 -o /dev/null -w %s 'https://github.com/docker/docker-credential-helpers/releases/latest' | sed 's:.*/::') + echo ::set-output name=release_tag::$RELEASE_VERSION +- run: |- + curl -L -o '${{ env.HELPER_FILENAME }}_archive' 'https://github.com/docker/docker-credential-helpers/releases/download/${{ env.RELEASE_TAG }}/${{ env.HELPER_FILENAME }}-${{ env.RELEASE_TAG }}-amd64.tar.gz' + tar xvf './${{ env.HELPER_FILENAME }}_archive' + chmod +x './${{ env.HELPER_FILENAME }}' + mv './${{ env.HELPER_FILENAME }}' '${{ env.BIN_PATH }}/${{ env.HELPER_FILENAME }}' + '${{ env.BIN_PATH }}/${{ env.HELPER_FILENAME }}' version + rm './${{ env.HELPER_FILENAME }}_archive' + env: + HELPER_FILENAME: docker-credential-pass + RELEASE_TAG: "${{ steps.release_tag.outputs.release_tag }}" + BIN_PATH: "/usr/local/bin" +- run: |- + mkdir -p $(dirname $HOME/.docker/config.json) + cat $HOME/.docker/config.json | jq --arg credsStore '${{ env.HELPER_NAME }}' '. + {credsStore: $credsStore}' > /tmp/docker-config-credsstore-update.json + cat /tmp/docker-config-credsstore-update.json > $HOME/.docker/config.json + rm /tmp/docker-config-credsstore-update.json + env: + HELPER_NAME: docker-credential-pass +- uses: docker/login-action@v2.1.0 + with: + username: "${{ env.DOCKER_LOGIN }}" + password: "${{ secrets.DOCKER_PASSWORD }}" + registry: docker.io +- run: echo before build +- run: npm install -g dockerlint +- run: dockerlint -p Dockerfile +- uses: actions/download-artifact@v2 + with: + path: path-to-attach +- run: docker pull image1 +- run: docker pull image2 +- name: My docker build step + run: |- + docker build \ + --compress \ + --cache-from image1 \ + --cache-from image2 \ + -f wd/Dockerfile \ + -t docker.io/my-image:my-tag + timeout-minutes: 10 + continue-on-error: true +- run: echo before build +- name: My docker build step + run: docker push docker.io/my-image:my-tag +- uses: "./.github/actions/docker_update_description" + with: + docker-password: "${{ secrets.DOCKER_PASSWORD }}" + docker-username: "${{ env.DOCKER_USERNAME }}" + image: my-image + description-path: wd/README.md +``` + +### Unsupported Options + +- executor +- remote-docker-dlc +- use-remote-docker diff --git a/docs/circle_ci/Orbs/Docker/Pull.md b/docs/circle_ci/Orbs/Docker/Pull.md new file mode 100644 index 00000000..245d39f8 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Pull.md @@ -0,0 +1,29 @@ +# CircleCI/Docker Pull + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/pull: + images: my-image,my-other-image + ignore-docker-pull-error: true +``` + +### Transformed Github Action + +```yaml +- run: docker pull my-image + continue-on-error: true +- run: docker pull my-other-image + continue-on-error: true +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/Push.md b/docs/circle_ci/Orbs/Docker/Push.md new file mode 100644 index 00000000..7dc8ce97 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/Push.md @@ -0,0 +1,31 @@ +# CircleCI/Docker Push + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/push: + image: my-image + tag: mytag1,mytag2 + registry: my-registry + step-name: Docker Push Step +``` + +### Transformed Github Action + +```yaml +- name: Docker Push Step +- run: docker push my-registry/my-image:mytag1 +- name: Docker Push Step +- run: docker push my-registry/my-image:mytag2 +``` + +### Unsupported Options + +- digest-path diff --git a/docs/circle_ci/Orbs/Docker/UpdateDescription.md b/docs/circle_ci/Orbs/Docker/UpdateDescription.md new file mode 100644 index 00000000..097dfe8b --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/UpdateDescription.md @@ -0,0 +1,91 @@ +# CircleCI/Docker Update Description + +## CircleCI input + +```yaml +orbs: + docker: circleci/docker@x.y +jobs: + docker-example: + docker: + - image: 'cimg/base:stable' + steps: + - docker/update-description: + docker-password: $DOCKER_PASS + docker-username: $DOCKER_LOGIN + path: /user/local + readme: MYREADME.md + registry: docker.io + image: my-image +``` + +### Transformed Github Action (Composite Action Feature: enabled) +workflow +```yaml +- uses: "./.github/actions/docker_update_description" + with: + docker-password: "${{ secrets.DOCKER_PASSWORD }}" + docker-username: "${{ env.DOCKER_USERNAME }}" + image: my-image + description-path: "/user/local/MYREADME.md" + +``` + +action yaml +```yaml +name: docker_update_description +inputs: + docker-password: + required: true + docker-username: + required: true + image: + required: true + description-path: + required: false + default: "./README.md" +runs: + using: composite + steps: + - run: |- + PAYLOAD='username=${{ env.DOCKER_USERNAME }}&password=${{ env.DOCKER_PASSWORD }}' + JWT=$(curl -s -d $PAYLOAD https://hub.docker.com/v2/users/login/ | jq -r .token) + HEADER="Authorization: JWT $JWT" + URL='https://hub.docker.com/v2/repositories/${{ env.IMAGE }}/' + STATUS=$(curl -s -o /dev/null -w %{http_code} -X PATCH -H "$HEADER" --data-urlencode full_description@$DESCRIPTION_PATH $URL) + if [ $STATUS -ne 200 ]; then + echo 'Could not update image description' + echo "Error code: $STATUS" + exit 1 + fi + env: + DOCKER_USERNAME: "${{ inputs.docker-username }}" + DOCKER_PASSWORD: "${{ inputs.docker-password }}" + IMAGE: "${{ inputs.image }}" + DESCRIPTION_PATH: "${{ inputs.description-path }}" + shell: bash +``` +### Transformed Github Action (Composite Action Feature: disabled) +```yaml +- run: |- + PAYLOAD='username=${{ env.DOCKER_USERNAME }}&password=${{ env.DOCKER_PASSWORD }}' + JWT=$(curl -s -d $PAYLOAD https://hub.docker.com/v2/users/login/ | jq -r .token) + HEADER="Authorization: JWT $JWT" + URL='https://hub.docker.com/v2/repositories/${{ env.IMAGE }}/' + STATUS=$(curl -s -o /dev/null -w %{http_code} -X PATCH -H "$HEADER" --data-urlencode full_description@$DESCRIPTION_PATH $URL) + if [ $STATUS -ne 200 ]; then + echo 'Could not update image description' + echo "Error code: $STATUS" + exit 1 + fi + env: + DOCKER_USERNAME: "${{ env.$DOCKER_LOGIN }}" + DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" + IMAGE: my-image + DESCRIPTION_PATH: "/user/local/MYREADME.md" +``` + + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Docker/index.md b/docs/circle_ci/Orbs/Docker/index.md new file mode 100644 index 00000000..916cbf74 --- /dev/null +++ b/docs/circle_ci/Orbs/Docker/index.md @@ -0,0 +1,27 @@ +# [CircleCI Docker](https://circleci.com/developer/orbs/orb/circleci/docker) + +| CircleCI | GitHub | +| :---------------------------------------------------------------------- | :----------------------------------------------------------------------------- | +| [Build](Build.md) | actions/setup-node@v2, run | +| [Check](Check.md) | docker/login-action@v2.1.0 | +| [ConfigureDockerCredentialsStore](ConfigureDockerCredentialsStore.md) | run | +| [Dockerlint](Dockerlint.md) | actions/setup-node@v2, run | +| [Executors](Executors.md) | container, runs-on | +| [Hadolint](Hadolint.md) | hadolint/hadolint-action@v3.1.0 | +| [InstallDockerCredentialHelper](InstallDockerCredentialHelper.md) | run | +| [InstallDockerize](InstallDockerize.md) | run | +| [InstallDockerTools](InstallDockerTools.md) | run | +| [InstallGoss](InstallGoss.md) | run | +| [Publish](Publish.md) | run, docker/login-action@v2.1.0 | +| [Pull](Pull.md) | run | +| [Push](Push.md) | run | +| [UpdateDescription](UpdateDescription.md) | run | + +## Indeterminate behavior on self-hosted runners + +- install-docker-compose +- install-docker + +## Unsupported + +- None diff --git a/docs/circle_ci/Orbs/Go/Install.md b/docs/circle_ci/Orbs/Go/Install.md new file mode 100644 index 00000000..408b01df --- /dev/null +++ b/docs/circle_ci/Orbs/Go/Install.md @@ -0,0 +1,31 @@ +# CircleCI/Go Install + +## CircleCI input + +```yaml +orbs: + go: circleci/go@x.y +jobs: + my_job: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - go/install: + cache: true + cache-key: gocache + version: 1.17.0 +``` + +## Transformed Github Action + +```yaml +uses: actions/setup-go@v3 +with: + cache: true + version: 1.17.0 +``` + +## Unsupported Options + +The `cache` and `cache-key` options are ignored. GitHub Actions caches tools automatically. diff --git a/docs/circle_ci/Orbs/Go/LoadCache.md b/docs/circle_ci/Orbs/Go/LoadCache.md new file mode 100644 index 00000000..66b4f7ee --- /dev/null +++ b/docs/circle_ci/Orbs/Go/LoadCache.md @@ -0,0 +1,43 @@ +# CircleCI/Go Load Cache + +## CircleCI input + +```yaml +orbs: + go: circleci/go@x.y +jobs: + my_job: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - go/load-cache +``` + +## Transformed Github Action + +```yaml +uses: actions/setup-go@v3 +with: + cache: true +``` + +## Unsupported Options + +Actions which use repository cache are not supported with GitHub Enterprise Server (GHES) 3.4 (`ghes-3.4`) or lower. + +If a `key` is provided and a matching `go/save-cache` command cannot be found in the same workflow, a manual task will be created to provide a path for the generated `actions/cache` step. There are three options for configuring this: + +- Replace the placeholder string `''` with the path to the Go modules cache +- If the default key and Go module cache can be used, the `actions/cache` step can be removed. Update the `actions/setup-go` step to enable the cache by changing the value to `cache: true`. +- If a named key is needed and you need that to dynamically resolve to the Go modules cache, replace both the `actions/setup-go` step and `actions/cache` step with the following: + + ```yaml + - uses: "./.github/actions/go_cache" + with: + key: your-key + ``` + +## Additional Details + +Valet will automatically combine and remove any related `go/save-cache` steps in the same job. Valet will also remove any additional `go/load-cache` steps with the same key. The full details are provided with [SaveCache](SaveCache.md). diff --git a/docs/circle_ci/Orbs/Go/ModDownload.md b/docs/circle_ci/Orbs/Go/ModDownload.md new file mode 100644 index 00000000..fccd0ac6 --- /dev/null +++ b/docs/circle_ci/Orbs/Go/ModDownload.md @@ -0,0 +1,23 @@ +# CircleCI/Go Mod Download + +## CircleCI input + +```yaml +orbs: + go: circleci/go@x.y +jobs: + my_job: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - go/mod-download +``` + +## Transformed Github Action + +```yaml +run: go mod download +``` + +## Unsupported Options diff --git a/docs/circle_ci/Orbs/Go/ModDownloadCache.md b/docs/circle_ci/Orbs/Go/ModDownloadCache.md new file mode 100644 index 00000000..a60b102d --- /dev/null +++ b/docs/circle_ci/Orbs/Go/ModDownloadCache.md @@ -0,0 +1,40 @@ +# CircleCI/Go Mod Download Cache + +## CircleCI input + +```yaml +orbs: + go: circleci/go@x.y +jobs: + my_job: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - go/mod-download-cache +``` + +## Transformed Github Action + +```yaml +uses: actions/setup-go@v3 +with: + cache: true +run: go mod download +``` + +## Unsupported Options + +Actions which use repository cache are not supported with GitHub Enterprise Server (GHES) 3.4 (`ghes-3.4`) or lower. + +## Additional Details + +This command is a shorthand for the following: + +```yaml +- go/load-cache +- go/mode-download +- go/save-cache +``` + +Because these commands rely on the default Go path and a default cache key, the combined `load-cache` and `save-cache` functionality is replaced with `actions/setup-go` with `cache: true`. This provides the same behavior. See also [LoadCache](LoadCache.md), [SaveCache](SaveCache.md), and [ModDownload](ModDownload.md). diff --git a/docs/circle_ci/Orbs/Go/SaveCache.md b/docs/circle_ci/Orbs/Go/SaveCache.md new file mode 100644 index 00000000..15d6809d --- /dev/null +++ b/docs/circle_ci/Orbs/Go/SaveCache.md @@ -0,0 +1,67 @@ +# CircleCI/Go Save Cache + +## CircleCI input + +```yaml +orbs: + go: circleci/go@x.y +jobs: + my_job: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - go/load-cache +``` + +## Transformed Github Action + +```yaml +uses: actions/setup-go@v3 +with: + cache: true +``` + +## Unsupported Options + +Actions which use repository cache are not supported with GitHub Enterprise Server (GHES) 3.4 (`ghes-3.4`) or lower. + +## Additional Details + +The cache used by GitHub Actions is immutable, similar to CircleCI. The behavior of the caching Actions (such as `actions/cache`) are different. +CircleCI uses an explicit `go/load-cache` to retrieve the cache and `go/save-cache` to cache Go modules in a specific path. +GitHub Actions requires a single cache step to do both. The cache download happens during the `actions/cache` step, and the creation of a cache entry from the provided path happens automatically after the job completes. +Because of this difference, Valet automatically merges `load-cache` and `save-cache` steps with matching keys within a job. +The first `load-cache` with each key will be converted. If no `load-cache` exists in the job, the first `save-cache` for each key in the job will be converted. + +The default `key` used by CircleCI is `go-mod` and the default Go modules cache `path` is `/home/circleci/go/pkg/mod` (which is also the `GOMODCACHE` for CircleCI). +If no `key` or `path` is provided (or if the default values are used), Valet will use `actions/setup-go` with `cache: true`. This provides the an equivalent behavior. + +If a key or path is provided, Valet will create steps that manually configure the cache. It will use `actions/setup-go` with `cache: false` to configure the Go environment without configuring the cache. +It will then add an additional `actions/cache` step using the provided key and path. Because this step combines the load and save behaviors, it requires both a `key` and a `path`. + +If a `key` is used, Valet will search for a matching `go/save-cache` to resolve the `path`. It will first look within the existing job for a match. If no match is found, it will examine all jobs in the workflow. +If a match is still not found, a manual task will be created to configure the `path` for `actions/cache`. More details can be found in [LoadCache](LoadCache.md). + +When `key` is provided without a `path`, Valet will create a composite action (`.github/actions/go_cache`) to dynamically resolve the `GOMODCACHE` location. +Unlike CircleCI, this location is not a fixed path, and it can vary between versions of Go. The provided script has been tested with Go 1.9 - 1.19. + +CircleCI uses the provided key as the prefix for the actual cache key. The equivalent expression for the `actions/cache` key is `${{ inputs.key }}-${{ runner.arch }}-${{ hashFiles( 'go.sum' ) }}`. +As a best practice, it is generally recommended to recursively hash all of the available `go.sum` files. +Valet implements this recommendation and uses the key `${{ inputs.key }}-${{ runner.arch }}-${{ hashFiles( '**/go.sum' ) }}`. +If the old behavior is required, the key can be manually updated after the conversion. + +The implemented concersions: + +| `load-cache` exists | `load-cache` `key` | `save-cache` exists | `save-cache` `key` | `save-cache` `path` | `actions/setup-go` | `actions/cache` | Composite Action | Manual Task | +| ------------------- | ------------------ | ------------------- | ------------------ | ------------------- | ------------------ | ------------------------------- | ------------------------------ | ----------------------------------- | +| Yes | default | No | - | - | `cache:true` | No | No | No | +| Yes | user-provided | No | - | - | `cache:false` | Provided `key`, empty `path` | No | Configure `path` in `actions/cache` | +| No | - | Yes | default | default | `cache:true` | No | No | No | +| No | - | Yes | default | user-provided | `cache:false` | Default `key`, provided `path` | No | No | +| No | - | Yes | user-provided | default | No | No | Yes. Provided `key`, no `path` | No | +| No | - | Yes | user-provided | user-provided | `cache:false` | Provided `key`, provided `path` | No | No | +| Yes | user-provided | Yes | from `load-cache` | default | No | No | Yes. Provided `key`, no `path` | No | +| Yes | user-provided | Yes | from `load-cache` | user-provided | `cache:false` | Provided `key`, provided `path` | No | No | +| Yes | default | Yes | from `load-cache` | default | `cache:true` | No | No | No | +| Yes | default | Yes | from `load-cache` | user-provided | `cache:false` | Default `key`, provided `path` | No | No | diff --git a/docs/circle_ci/Orbs/Go/Test.md b/docs/circle_ci/Orbs/Go/Test.md new file mode 100644 index 00000000..3bd6e77c --- /dev/null +++ b/docs/circle_ci/Orbs/Go/Test.md @@ -0,0 +1,25 @@ +# CircleCI/Go Test + +## CircleCI input + +```yaml +orbs: + go: circleci/go@x.y +jobs: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - go/test: + covermode: atomic + failfast: true + race: true +``` + +## Transformed Github Action + +```yaml +- run: go test -covermode=atmoic -failfast -race +``` + +## Unsupported Options diff --git a/docs/circle_ci/Orbs/Go/index.md b/docs/circle_ci/Orbs/Go/index.md new file mode 100644 index 00000000..8ccb1de1 --- /dev/null +++ b/docs/circle_ci/Orbs/Go/index.md @@ -0,0 +1,14 @@ +# [CircleCI Go](https://circleci.com/developer/orbs/orb/circleci/go) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------- | +| [Install](Install.md) | actions/setup-go@v3, run | +| [LoadCache](LoadCache.md) | actions/cache@v3, actions/setup-go@v3, run | +| [ModDownload](ModDownload.md) | run | +| [ModDownloadCache](ModDownloadCache.md) | actions/cache@v3, actions/setup-go@v3, run | +| [SaveCache](SaveCache.md) | actions/cache@v3, actions/setup-go@v3, run | +| [Test](Test.md) | run | + +## Indeterminate behavior on self-hosted runners + +## Unsupported diff --git a/docs/circle_ci/Orbs/Heroku/CheckAuthentication.md b/docs/circle_ci/Orbs/Heroku/CheckAuthentication.md new file mode 100644 index 00000000..915d4a76 --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/CheckAuthentication.md @@ -0,0 +1,36 @@ +# CircleCI/Heroku Check Authentication + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@1.2.6 + +jobs: + example: + executor: heroku/default + steps: + - checkout + - heroku/check-authentication: + print-whoami: false +``` + +### Transformed Github Action + +```yaml +- shell: bash + env: + PRINT_WHOAMI: false + run: |- + if [[ $HEROKU_API_KEY == "" ]]; then + echo "No Heroku API key set, please set the HEROKU_API_KEY environment variable." + echo "This can be found by running the `heroku auth:token` command locally." + exit 1 + else + echo "Heroku API key found." + if [[ $PRINT_WHOAMI == "true" ]]; then heroku auth:whoami; fi + fi +``` + +### Unsupported Options +- None \ No newline at end of file diff --git a/docs/circle_ci/Orbs/Heroku/Default.md b/docs/circle_ci/Orbs/Heroku/Default.md new file mode 100644 index 00000000..f19bc396 --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/Default.md @@ -0,0 +1,28 @@ +# CircleCI/Heroku Default Executor + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@1.2.6 +jobs: + example: + executor: heroku/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +jobs: + example: + runs-on: ubuntu-latest + container: + image: cimg/base:stable + options: "--user root" +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Heroku/DeployViaGit.md b/docs/circle_ci/Orbs/Heroku/DeployViaGit.md new file mode 100644 index 00000000..c7799fca --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/DeployViaGit.md @@ -0,0 +1,104 @@ +# CircleCI/Heroku Deploy Via Git + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@1.2.6 + +jobs: + example: + executor: heroku/default + steps: + - heroku/deploy-via-git: + api-key: HEROKU_API_KEY + app-name: "gentle-yeti-42" + branch: dev +``` + +### Transformed Github Action(Composite Action Feature: enabled) +workflow +```yaml +- uses: "./.github/actions/heroku_deploy_via_git" + timeout-minutes: 10 + with: + api_key: "${{ secrets.HEROKU_API_KEY }}" + app_name: gentle-yeti-42 + branch: dev +``` + +action.yml +```yaml +name: heroku_deploy_via_git +inputs: + api_key: + required: true + app_name: + required: false + default: "$HEROKU_APP_NAME" + branch: + required: false + default: "${{ github.ref }}" + force: + required: false + default: false + maintenance_mode: + required: false + default: false + tag: + required: false + default: "${{ github.ref }}" +runs: + using: composite + steps: + - shell: bash + env: + HEROKU_API_KEY: "${{ inputs.api_key }}" + BRANCH: "${{ inputs.branch }}" + TAG: "${{ inputs.tag }}" + FORCE: "${{ inputs.force }}" + APP_NAME: "${{ inputs.app_name }}" + MAINTENANCE_MODE: "${{ inputs.maintenance_mode }}" + run: |- + if ${{ env.FORCE }};then force="-f"; fi + heroku_url="https://heroku:${{ env.HEROKU_API_KEY }}@git.heroku.com/${{ env.APP_NAME }}.git" + + if ${{ env.MAINTENANCE_MODE }}; then heroku maintenance:on --app ${{ env.APP_NAME }}; fi + if [ -n "${{ env.BRANCH }}" ]; then + git push $force $heroku_url ${{ env.BRANCH }}:main + elif [ -n "${{ env.TAG }}" ]; then + git push $force $heroku_url ${{ env.TAG }}^{}:main + else + echo "No branch or tag found." + fi + if ${{ env.MAINTENANCE_MODE }}; then heroku maintenance:off --app ${{ env.APP_NAME }}; fi +``` + +### Transformed Github Action(Composite Action Feature: disabled) +```yaml +- shell: bash + env: + HEROKU_API_KEY: "${{ secrets.HEROKU_API_KEY }}" + BRANCH: dev + TAG: "${{ github.ref }}" + FORCE: false + APP_NAME: gentle-yeti-42 + MAINTENANCE_MODE: false + run: |- + if ${{ env.FORCE }};then force="-f"; fi + heroku_url="https://heroku:${{ env.HEROKU_API_KEY }}@git.heroku.com/${{ env.APP_NAME }}.git" + if ${{ env.MAINTENANCE_MODE }}; then heroku maintenance:on --app ${{ env.APP_NAME }}; fi + if [ -n "${{ env.BRANCH }}" ]; then + git push $force $heroku_url ${{ env.BRANCH }}:main + elif [ -n "${{ env.TAG }}" ]; then + git push $force $heroku_url ${{ env.TAG }}^{}:main + else + echo "No branch or tag found." + fi + if ${{ env.MAINTENANCE_MODE }}; then heroku maintenance:off --app ${{ env.APP_NAME }}; fi + timeout-minutes: 10 +``` + + +### Unsupported Options +- None diff --git a/docs/circle_ci/Orbs/Heroku/Install.md b/docs/circle_ci/Orbs/Heroku/Install.md new file mode 100644 index 00000000..a942453f --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/Install.md @@ -0,0 +1,30 @@ +# CircleCI/Heroku Install + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@1.2.6 + +jobs: + example: + executor: heroku/default + steps: + - checkout + - heroku/install +``` + +### Transformed Github Action + +```yaml +- shell: bash + run: |- + if [[ $(command -v heroku) == "" ]]; then + curl https://cli-assets.heroku.com/install.sh | sh + else + echo "Heroku is already installed. No operation was performed." + fi +``` + +### Unsupported Options +- None \ No newline at end of file diff --git a/docs/circle_ci/Orbs/Heroku/JobDeployViaGit.md b/docs/circle_ci/Orbs/Heroku/JobDeployViaGit.md new file mode 100644 index 00000000..d6c00562 --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/JobDeployViaGit.md @@ -0,0 +1,64 @@ +# CircleCI/Heroku Job Deploy Via Git + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@x.y +version: 2.1 +workflows: + heroku_deploy: + jobs: + - heroku/deploy-via-git: + branch: main + post-deploy: + - run: + command: | + echo running your-database-migration-command + echo Done! + pre-deploy: + - run: echo command-that-run-before-deploying +``` + +### Transformed Github Action + +```yaml +jobs: + heroku_deploy-via-git: + runs-on: ubuntu-latest + steps: + - shell: bash + run: |- + if [[ $(command -v heroku) == "" ]]; then + curl https://cli-assets.heroku.com/install.sh | sh + else + echo "Heroku is already installed. No operation was performed." + fi + - shell: bash + env: + PRINT_WHOAMI: false + run: |- + if [[ $HEROKU_API_KEY == "" ]]; then + echo "No Heroku API key set, please set the HEROKU_API_KEY environment variable." + echo "This can be found by running the `heroku auth:token` command locally." + exit 1 + else + echo "Heroku API key found." + if [[ $PRINT_WHOAMI == "true" ]]; then heroku auth:whoami; fi + fi + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: echo command-that-run-before-deploying + - uses: "./.github/actions/heroku_deploy_via_git" + timeout-minutes: 10 + with: + api_key: "${{ secrets.HEROKU_API_KEY }}" + branch: main + - run: | + echo running your-database-migration-command + echo Done! +``` + +### Unsupported Options +- None diff --git a/docs/circle_ci/Orbs/Heroku/JobPushDockerImage.md b/docs/circle_ci/Orbs/Heroku/JobPushDockerImage.md new file mode 100644 index 00000000..16aa221d --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/JobPushDockerImage.md @@ -0,0 +1,65 @@ +# CircleCI/Heroku Job Push Docker Image + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@x.y +version: 2.1 +workflows: + heroku_deploy: + jobs: + - heroku/push-docker-image: + app-name: sprinkle-donut-123 + maintenance-mode: true + post-deploy: + - run: echo "running database migration command" + pre-deploy: + - run: echo "running pre-deploy command" +``` + +### Transformed Github Action + +```yaml +jobs: + heroku_push-docker-image: + runs-on: ubuntu-latest + steps: + - shell: bash + run: |- + if [[ $(command -v heroku) == "" ]]; then + curl https://cli-assets.heroku.com/install.sh | sh + else + echo "Heroku is already installed. No operation was performed." + fi + - shell: bash + env: + PRINT_WHOAMI: false + run: |- + if [[ $HEROKU_API_KEY == "" ]]; then + echo "No Heroku API key set, please set the HEROKU_API_KEY environment variable." + echo "This can be found by running the `heroku auth:token` command locally." + exit 1 + else + echo "Heroku API key found." + if [[ $PRINT_WHOAMI == "true" ]]; then heroku auth:whoami; fi + fi + - uses: actions/checkout@v2 + - run: heroku maintenance:on --app sprinkle-donut-123 + - run: echo "running pre-deploy command" + - shell: bash + run: |- + heroku container:login + heroku container:push -a sprinkle-donut-123 web + timeout-minutes: 10 + - shell: bash + run: |- + heroku container:login + heroku container:release -a sprinkle-donut-123 web + timeout-minutes: 10 + - run: echo "running database migration command" + - run: heroku maintenance:off --app sprinkle-donut-123 +``` + +### Unsupported Options +- None diff --git a/docs/circle_ci/Orbs/Heroku/PushDockerImage.md b/docs/circle_ci/Orbs/Heroku/PushDockerImage.md new file mode 100644 index 00000000..42840e41 --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/PushDockerImage.md @@ -0,0 +1,32 @@ +# CircleCI/Heroku Push Docker Image + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@1.2.6 + +jobs: + example: + executor: heroku/default + steps: + - checkout + - heroku/push-docker-image: + app-name: "tranquil-gopher-123" + recursive: false + process-types: web + no_output_timeout: 1m +``` + +### Transformed Github Action + +```yaml +- shell: bash + run: |- + heroku container:login + heroku container:push -a tranquil-gopher-123 web + timeout-minutes: 1 +``` + +### Unsupported Options +- api-key (ignoring because it does not seem to be used by Orb Command) \ No newline at end of file diff --git a/docs/circle_ci/Orbs/Heroku/ReleaseDockerImage.md b/docs/circle_ci/Orbs/Heroku/ReleaseDockerImage.md new file mode 100644 index 00000000..15ee9c49 --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/ReleaseDockerImage.md @@ -0,0 +1,31 @@ +# CircleCI/Heroku Release Docker Image + +## CircleCI input + +```yaml +orbs: + heroku: circleci/heroku@1.2.6 + +jobs: + example: + executor: heroku/default + steps: + - checkout + - heroku/release-docker-image: + app-name: "green-dinosaur" + process-types: db + no_output_timeout: 11m +``` + +### Transformed Github Action + +```yaml +- shell: bash + run: |- + heroku container:login + heroku container:release -a green-dinosaur db + timeout-minutes: 11 +``` + +### Unsupported Options +- api-key (ignoring because it does not seem to be used by Orb Command) \ No newline at end of file diff --git a/docs/circle_ci/Orbs/Heroku/index.md b/docs/circle_ci/Orbs/Heroku/index.md new file mode 100644 index 00000000..1928a698 --- /dev/null +++ b/docs/circle_ci/Orbs/Heroku/index.md @@ -0,0 +1,14 @@ +# [CircleCI Heroku](https://circleci.com/developer/orbs/orb/circleci/heroku) + +| CircleCI | GitHub | +| :------------------------------------------------------ | :------------------------- | +| [CheckAuthentication](CheckAuthentication.md) | run | +| [DeployViaGit](DeployViaGit.md) | run | +| [Install](Install.md) | run | +| [PushDockerImage](PushDockerImage.md) | run | +| [ReleaseDockerImage](ReleaseDockerImage.md) | run | +| [JobDeployViaGit](JobDeployViaGit.md) | run, actions/checkout@v2 | +| [JobPushDockerImage](JobPushDockerImage.md) | run, actions/checkout@v2 | + +Unsupported +None \ No newline at end of file diff --git a/docs/circle_ci/Orbs/Node/Default.md b/docs/circle_ci/Orbs/Node/Default.md new file mode 100644 index 00000000..07cf65d9 --- /dev/null +++ b/docs/circle_ci/Orbs/Node/Default.md @@ -0,0 +1,26 @@ +# CircleCI/Node Default Executor + +## CircleCI input + +```yaml +orbs: + node: circleci/node@x.y +jobs: + install-node-example: + executor: node/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +job: + install-node-example: + container: + image: node +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Node/Install.md b/docs/circle_ci/Orbs/Node/Install.md new file mode 100644 index 00000000..feade65d --- /dev/null +++ b/docs/circle_ci/Orbs/Node/Install.md @@ -0,0 +1,34 @@ +# CircleCI/Node Install + +## CircleCI input + +```yaml +orbs: + node: circleci/node@x.y +jobs: + install-node-example: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - node/install: + node-version: 3 + - run: node --version +``` + +### Transformed Github Action + +```yaml +uses: actions/setup-node@v2 +with: + node-version: 3 +``` + +### Unsupported Options + +- install-yarn +- install-npm +- node-install-dir +- npm-version +- yarn-version +- lts diff --git a/docs/circle_ci/Orbs/Node/InstallPackages.md b/docs/circle_ci/Orbs/Node/InstallPackages.md new file mode 100644 index 00000000..cdbf9fd0 --- /dev/null +++ b/docs/circle_ci/Orbs/Node/InstallPackages.md @@ -0,0 +1,40 @@ +# CircleCI/Node Install Packages + +## CircleCI input + +```yaml +orbs: + node: circleci/node@x.y +jobs: + install-node-example: + docker: + - image: "cimg/base:stable" + steps: + - checkout + - node/install-packages: + with-cache: true + pkg-manager: yarn + override-ci-command: my-custom-command +``` + +### Transformed Github Action + +```yaml +- 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: my-custom-command +``` + +### Unsupported Options + +- app-dir +- cache-path +- cache-version +- include-branch-in-cache-key +- caching with yarn-berry is transformed using regular yarn +- `actions/cache@v2` is not supported on GHES diff --git a/docs/circle_ci/Orbs/Node/Run.md b/docs/circle_ci/Orbs/Node/Run.md new file mode 100644 index 00000000..59cbcb6e --- /dev/null +++ b/docs/circle_ci/Orbs/Node/Run.md @@ -0,0 +1,39 @@ +# CircleCI/Node Run + +## CircleCI input + +```yaml +orbs: + node: circleci/node@x.y + +workflows: + my-workflow: + jobs: + node/run: + with-cache: true + pkg-manager: npm + npm-run: npm-script + setup: + - run: echo "setup step!" +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 +- id: npm-cache-dir + run: echo '::set-output name=dir::$(npm config get cache)' +- uses: actions/cache@v2 + with: + path: "${{ steps.npm-cache-dir.outputs.dir }}" + key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}" + restore-keys: "${{ runner.os }}-node-" +- run: npm run npm-script +``` + +### Unsupported Options + +- app-dir +- cache-version +- version +- `actions/cache@v2` is not supported on GHES diff --git a/docs/circle_ci/Orbs/Node/Test.md b/docs/circle_ci/Orbs/Node/Test.md new file mode 100644 index 00000000..100bc39b --- /dev/null +++ b/docs/circle_ci/Orbs/Node/Test.md @@ -0,0 +1,39 @@ +# CircleCI/Node Test + +## CircleCI input + +```yaml +orbs: + node: circleci/node@x.y + +workflows: + my-workflow: + jobs: + node/test: + with-cache: true + pkg-manager: npm + run-command: test + setup: + - run: echo "setup step!" +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 +- id: npm-cache-dir + run: echo '::set-output name=dir::$(npm config get cache)' +- uses: actions/cache@v2 + with: + path: "${{ steps.npm-cache-dir.outputs.dir }}" + key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}" + restore-keys: "${{ runner.os }}-node-" +- run: npm run test +``` + +### Unsupported Options + +- app-dir +- cache-version +- version +- `actions/cache@v2` is not supported on GHES diff --git a/docs/circle_ci/Orbs/Node/WithCache.md b/docs/circle_ci/Orbs/Node/WithCache.md new file mode 100644 index 00000000..3d17c6af --- /dev/null +++ b/docs/circle_ci/Orbs/Node/WithCache.md @@ -0,0 +1,34 @@ +# CircleCI/Node With Cache + +## CircleCI input + +```yaml +orbs: + node: circleci/node@x.y +jobs: + install-node-example: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - node/with-cache: + - run: npm install + - run: + name: Run Test + run: npm test +``` + +### Transformed Github Action + +```yaml +- uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm +- run: npm install +- name: Run Test + run: npm test +``` + +### Unsupported Options + diff --git a/docs/circle_ci/Orbs/Node/index.md b/docs/circle_ci/Orbs/Node/index.md new file mode 100644 index 00000000..3cca4b11 --- /dev/null +++ b/docs/circle_ci/Orbs/Node/index.md @@ -0,0 +1,19 @@ +# [CircleCI Node](https://circleci.com/developer/orbs/orb/circleci/node) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------- | +| [Default](Default.md) | container | +| [Install](Install.md) | actions/setup-node@v2 | +| [InstallPackages](InstallPackages.md) | actions/cache@v2, run | +| [Run](Run.md) | actions/cache@v2, run | +| [Test](Test.md) | actions/cache@v2, run | +| [WithCache](WithCache.md) | actions/setup-node@v3, run | + +## Indeterminate behavior on self-hosted runners + +- install-npm +- install-yarn + +## Unsupported + +- None diff --git a/docs/circle_ci/Orbs/Python/Default.md b/docs/circle_ci/Orbs/Python/Default.md new file mode 100644 index 00000000..d2b1560e --- /dev/null +++ b/docs/circle_ci/Orbs/Python/Default.md @@ -0,0 +1,26 @@ +# CircleCI/Python Default Executor + +## CircleCI input + +```yaml +orbs: + python: circleci/python@x.y +jobs: + install-python-example: + executor: python/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +job: + install-python-example: + container: + image: python +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Python/Dist.md b/docs/circle_ci/Orbs/Python/Dist.md new file mode 100644 index 00000000..f499e5ac --- /dev/null +++ b/docs/circle_ci/Orbs/Python/Dist.md @@ -0,0 +1,36 @@ +# CircleCI/Python Dist + +## CircleCI input + +```yaml +orbs: + python: circleci/python@x.y +jobs: + python-example: + docker: + - image: 'cimg/base:stable' + steps: + - python/dist: + app-dir: my-path +``` + +### Transformed Github Action + +```yaml +- run: pip install wheel +- name: Build distribution package + run: |- + python setup.py sdist + python setup.py sdist + ls -l dist + working-directory: my-path +``` + +### Unsupported Options + +- install-yarn +- install-npm +- node-install-dir +- npm-version +- yarn-version +- lts diff --git a/docs/circle_ci/Orbs/Python/InstallPackages.md b/docs/circle_ci/Orbs/Python/InstallPackages.md new file mode 100644 index 00000000..313a22a1 --- /dev/null +++ b/docs/circle_ci/Orbs/Python/InstallPackages.md @@ -0,0 +1,41 @@ +# CircleCI/Python Install Packages + +## CircleCI input + +```yaml +orbs: + python: circleci/python@x.y +jobs: + python-example: + docker: + - image: "cimg/base:stable" + steps: + - python/install-packages: + args: "-f file:///path/to/archive/" + pre-install-steps: + - checkout + app-dir: my-path + pkg-manager: pipenv + include-branch-in-cache-key: true + include-python-in-cache-key: true +``` + +### Transformed Github Action + +```yaml +- name: Get python version + id: python-version + run: echo '::set-output name=python-version::$(python -v)' +- uses: actions/cache@v2 + with: + key: "${{ runner.os }}-${{ github.ref }}-python-${{ steps.python-version.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}" +- uses: actions/checkout@v2 +- name: Install dependencies with pipenv using project Pipfile or inline packages + run: pipenv install -f file:///path/to/archive/ + working-directory: my-path +``` + +### Unsupported Options + +- cache-version +- `actions/cache@v2` is not supported on GHES diff --git a/docs/circle_ci/Orbs/Python/Test.md b/docs/circle_ci/Orbs/Python/Test.md new file mode 100644 index 00000000..5dbace06 --- /dev/null +++ b/docs/circle_ci/Orbs/Python/Test.md @@ -0,0 +1,45 @@ +# CircleCI/Python Test + +## CircleCI input + +```yaml +orbs: + python: circleci/python@x.y +jobs: + python-example: + docker: + - image: "cimg/base:stable" + steps: + - python/test: + setup: + - checkout + app-dir: my-path + pkg-manager: pipenv +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 +- name: Get python version + id: python-version + run: echo '::set-output name=python-version::$(python -v)' +- uses: actions/cache@v2 + with: + key: "${{ runner.os }}-${{ github.ref }}-python-${{ steps.python-version.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}" +- uses: actions/checkout@v2 +- name: Install dependencies with pipenv using project Pipfile or inline packages + run: pipenv install -f file:///path/to/archive/ + working-directory: my-path +- name: Run tests with pipenv run + run: pipenv run python -m unittest +- uses: actions/upload-artifact@v2 + with: + path: test-report +``` + +### Unsupported Options + +- cache-version +- version +- `actions/cache@v2` is not supported on GHES diff --git a/docs/circle_ci/Orbs/Python/index.md b/docs/circle_ci/Orbs/Python/index.md new file mode 100644 index 00000000..c2137965 --- /dev/null +++ b/docs/circle_ci/Orbs/Python/index.md @@ -0,0 +1,16 @@ +# [CircleCI Python](https://circleci.com/developer/orbs/orb/circleci/python) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------------- | +| [Default](Default.md) | container | +| [Dist](Dist.md) | run | +| [InstallPackages](InstallPackages.md) | run, actions/cache@v2 | +| [Test](Test.md) | run, actions/cache@v2, actions/upload-artifact@v2 | + +## Indeterminate behavior on self-hosted runners + +- dist + +## Unsupported + +- None diff --git a/docs/circle_ci/Orbs/Ruby/Default.md b/docs/circle_ci/Orbs/Ruby/Default.md new file mode 100644 index 00000000..8ee1dcad --- /dev/null +++ b/docs/circle_ci/Orbs/Ruby/Default.md @@ -0,0 +1,26 @@ +# CircleCI/Ruby Default Executor + +## CircleCI input + +```yaml +orbs: + ruby: circleci/ruby@x.y +jobs: + install-ruby-example: + executor: ruby/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +job: + install-ruby-example: + container: + image: ruby:2.7 +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Ruby/Install.md b/docs/circle_ci/Orbs/Ruby/Install.md new file mode 100644 index 00000000..88481669 --- /dev/null +++ b/docs/circle_ci/Orbs/Ruby/Install.md @@ -0,0 +1,29 @@ +# CircleCI/Ruby Install + +## CircleCI input + +```yaml +orbs: + node: circleci/ruby@x.y +jobs: + install-ruby-example: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - ruby/install: + version: 3.2.1 + - run: ruby --version +``` + +### Transformed Github Action + +```yaml +uses: ruby/setup-ruby@v1.138.0 +with: + ruby-version: 3.2.1 +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Ruby/InstallDeps.md b/docs/circle_ci/Orbs/Ruby/InstallDeps.md new file mode 100644 index 00000000..a279d2f8 --- /dev/null +++ b/docs/circle_ci/Orbs/Ruby/InstallDeps.md @@ -0,0 +1,41 @@ +# CircleCI/Ruby Install Deps + +## CircleCI input + +```yaml +orbs: + node: circleci/ruby@x.y +jobs: + install-ruby-example: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - ruby/install-deps: + with-cache: true + bundler-version: 1.2.3 + app-dir: my-working-dir +``` + +### Transformed Github Action + +```yaml +- run: bundle check || bundle install +``` + +The with-cache parameter is transformed by updating any existing setup-ruby steps with `bundler-cache: true`, or by adding a new setup-ruby step to the workflow with the correct inputs. + +```yaml +- uses: ruby/setup-ruby@v1.138.0 + with: + ruby-version: 2.6 + bundler-cache: true + bundler: 1.2.3 + working-directory: my-working-dir +- run: bundle check || bundle install +``` + +### Unsupported Options + +- Key +- Path/App_dir will be ignored if caching is set diff --git a/docs/circle_ci/Orbs/Ruby/RspecTest.md b/docs/circle_ci/Orbs/Ruby/RspecTest.md new file mode 100644 index 00000000..cf9a1485 --- /dev/null +++ b/docs/circle_ci/Orbs/Ruby/RspecTest.md @@ -0,0 +1,28 @@ +# CircleCI/Ruby Rspec Test + +## CircleCI input + +```yaml +orbs: + node: circleci/ruby@x.y +jobs: + rspec-ruby-example: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - ruby/rspec-test: + out-path: "my/path" + label: "My test run" +``` + +### Transformed Github Action + +```yaml +- name: My test run + run: bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out my/path/results.xml --format progress +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Ruby/RubocopCheck.md b/docs/circle_ci/Orbs/Ruby/RubocopCheck.md new file mode 100644 index 00000000..183f681a --- /dev/null +++ b/docs/circle_ci/Orbs/Ruby/RubocopCheck.md @@ -0,0 +1,29 @@ +# CircleCI/Ruby Rubocop Check + +## CircleCI input + +```yaml +orbs: + node: circleci/ruby@x.y +jobs: + rspec-ruby-example: + docker: + - image: 'cimg/base:stable' + steps: + - checkout + - ruby/rubocop-check: + out-path: "my-out-path" + check-path: "my-check-path" + label: "My linting run" +``` + +### Transformed Github Action + +```yaml +- name: My linting run + run: bundle exec rubocop my-check-path --format progress +``` + +### Unsupported Options + +- out-path diff --git a/docs/circle_ci/Orbs/Ruby/index.md b/docs/circle_ci/Orbs/Ruby/index.md new file mode 100644 index 00000000..2ff5d507 --- /dev/null +++ b/docs/circle_ci/Orbs/Ruby/index.md @@ -0,0 +1,13 @@ +# [CircleCI Ruby](https://circleci.com/developer/orbs/orb/circleci/ruby) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------- | +| [Default](Default.md) | container | +| [Install](Install.md) | ruby/setup-ruby@v1.138.0 | +| [InstallDeps](InstallDeps.md) | run, ruby/setup-ruby@v1.138.0 | +| [RspecTest](RspecTest.md) | run | +| [RubocopCheck](RubocopCheck.md) | run | + +## Unsupported + +- None diff --git a/docs/circle_ci/Orbs/Slack/Notify.md b/docs/circle_ci/Orbs/Slack/Notify.md new file mode 100644 index 00000000..a5e44579 --- /dev/null +++ b/docs/circle_ci/Orbs/Slack/Notify.md @@ -0,0 +1,112 @@ +# CircleCI/Slack Notify + +## CircleCI input + +```yaml +orbs: + slack: circleci/slack@x.y +jobs: + slack-example: + docker: + - image: 'cimg/base:stable' + steps: + - slack/notify: + branch_pattern: ^feature-.+$ + channel: my-channel + event: fail + ignore_errors: true + tag_pattern: ^tag-.+$ + +``` + +### Transformed Github Action +#### Composite Action Feature: enabled +workflow usage +```yaml +steps: +- uses: ./.github/actions/circleci_slack_notify + continue-on-error: true + if: failure() + with: + slack_webhook: "${{ secrets.SLACK_WEBHOOK }}" + slack_channel: my-channel + branch_pattern: "^feature-.+$" + tag_pattern: "^tag-.+$" +``` + +action.yml +```yaml +name: circleci_slack_notify +inputs: + slack_webhook: + required: true + slack_channel: + required: true + branch_pattern: + required: false + default: ".+" + tag_pattern: + required: false + default: ".+" +runs: + using: composite + steps: + - id: branch_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.BRANCH_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + BRANCH_PATTERN: "${{ inputs.branch_pattern }}" + - id: tag_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.TAG_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + TAG_PATTERN: "${{ inputs.tag_pattern }}" + - uses: rtCamp/action-slack-notify@v2.2.0 + if: "${{ steps.branch_pattern.outputs.match == 'true' && steps.tag_pattern.outputs.match == 'true' }}" + env: + SLACK_WEBHOOK: "${{ inputs.slack_webhook }}" + SLACK_CHANNEL: "${{ inputs.slack_channel }}" +``` + +#### Composite Action Feature: disabled +```yaml +steps: +- id: branch_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.BRANCH_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + BRANCH_PATTERN: "^feature-.+$" +- id: tag_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.TAG_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + TAG_PATTERN: "^tag-.+$" +- uses: rtCamp/action-slack-notify@v2.2.0 + if: "${{ failure() && steps.branch_pattern.outputs.match == 'true' && steps.tag_pattern.outputs.match == 'true' }}" + env: + SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK }}" + SLACK_CHANNEL: my-channel + continue-on-error: true +``` +### Unsupported Options + +- custom +- mentions +- template +- debug \ No newline at end of file diff --git a/docs/circle_ci/Orbs/Slack/OnHold.md b/docs/circle_ci/Orbs/Slack/OnHold.md new file mode 100644 index 00000000..9194470c --- /dev/null +++ b/docs/circle_ci/Orbs/Slack/OnHold.md @@ -0,0 +1,107 @@ +# CircleCI/Slack On Hold + +## CircleCI input + +```yaml +orbs: + slack: circleci/slack@x.y + +workflows: + workflow: + jobs: + - slack/on-hold +``` + +### Transformed Github Action +#### Composite Action Feature: enabled +workflow usage +```yaml +- uses: ./.github/actions/circleci_slack_notify + continue-on-error: true + if: always() + with: + slack_webhook: "${{ secrets.SLACK_WEBHOOK }}" + slack_channel: "${{ env.SLACK_DEFAULT_CHANNEL }}" +environment: + name: circleci_slack_job_on_hold +``` + +action.yml +```yaml +name: circleci_slack_notify +inputs: + slack_webhook: + required: true + slack_channel: + required: true + branch_pattern: + required: false + default: ".+" + tag_pattern: + required: false + default: ".+" +runs: + using: composite + steps: + - id: branch_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.BRANCH_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + BRANCH_PATTERN: "${{ inputs.branch_pattern }}" + - id: tag_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.TAG_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + TAG_PATTERN: "${{ inputs.tag_pattern }}" + - uses: rtCamp/action-slack-notify@v2.2.0 + if: "${{ steps.branch_pattern.outputs.match == 'true' && steps.tag_pattern.outputs.match == 'true' }}" + env: + SLACK_WEBHOOK: "${{ inputs.slack_webhook }}" + SLACK_CHANNEL: "${{ inputs.slack_channel }}" +``` + +#### Composite Action Feature: disabled +```yaml +steps: +- id: branch_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.BRANCH_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + BRANCH_PATTERN: ".+" +- id: tag_pattern + shell: bash + run: |- + if [[ '${{ env.VALUE_TO_MATCH }}' =~ ${{ env.TAG_PATTERN }} ]]; then + echo ::set-output name=match::true + fi + env: + VALUE_TO_MATCH: "${{ github.ref }}" + TAG_PATTERN: ".+" +- uses: rtCamp/action-slack-notify@v2.2.0 + if: "${{ always() && steps.branch_pattern.outputs.match == 'true' && steps.tag_pattern.outputs.match == 'true' }}" + env: + SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK }}" + SLACK_CHANNEL: "${{ env.SLACK_DEFAULT_CHANNEL }}" + continue-on-error: true +environment: + name: circleci_slack_job_on_hold + +``` +### Unsupported Options + +- custom +- mentions +- template +- the "hold" feature will need to be manually configured by setting up an environment diff --git a/docs/circle_ci/Orbs/Slack/index.md b/docs/circle_ci/Orbs/Slack/index.md new file mode 100644 index 00000000..f53f5d21 --- /dev/null +++ b/docs/circle_ci/Orbs/Slack/index.md @@ -0,0 +1,10 @@ +# [CircleCI Slack](https://circleci.com/developer/orbs/orb/circleci/slack) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------- | +| [Notify](Notify.md) | rtCamp/action-slack-notify@v2.2.0 | +| [OnHold](OnHold.md) | rtCamp/action-slack-notify@v2.2.0, environment | + +## Unsupported + +- None diff --git a/docs/circle_ci/Orbs/Windows/Default.md b/docs/circle_ci/Orbs/Windows/Default.md new file mode 100644 index 00000000..8857e2ba --- /dev/null +++ b/docs/circle_ci/Orbs/Windows/Default.md @@ -0,0 +1,25 @@ +# CircleCI/Windows Default Executor + +## CircleCI input + +```yaml +orbs: + win: circleci/windows@x.y +jobs: + use-windows-example: + executor: win/default + steps: + - checkout +``` + +### Transformed Github Action + +```yaml +job: + use-windows-example: + runs-on: windows-2019 +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Orbs/Windows/index.md b/docs/circle_ci/Orbs/Windows/index.md new file mode 100644 index 00000000..fad87e7c --- /dev/null +++ b/docs/circle_ci/Orbs/Windows/index.md @@ -0,0 +1,9 @@ +# [CircleCI Windows](https://circleci.com/developer/orbs/orb/circleci/windows) + +| CircleCI | GitHub | +| :------------------------------------------------------------------ | :-------------------------------------------------- | +| [Default](Default.md) | runs-on | + +## Unsupported + +- None diff --git a/docs/circle_ci/Steps/AddSshKeys.md b/docs/circle_ci/Steps/AddSshKeys.md new file mode 100644 index 00000000..3a084c75 --- /dev/null +++ b/docs/circle_ci/Steps/AddSshKeys.md @@ -0,0 +1,27 @@ +# Add Ssh Keys + +## CircleCI input + +```yaml +steps: + - add_ssh_keys: + fingerprints: + - "b7:35:a6:4e:9b:0d:6d:d4:78:1e:9a:97:2a:66:6b:be" +``` + +### Transformed Github Action + +```yaml +# Ensure parameter if_key_exists is set correctly +- name: Install SSH key + uses: shimataro/ssh-key-action@v2.5.0 + with: + key: "${{ secrets.CIRCLE_CI_SSH_KEY }}" + name: circle_ci_id_rsa + known_hosts: "${{ secrets.CIRCLE_CI_KNOWN_HOSTS }}" + if_key_exists: fail +``` + +### Unsupported Options + +- fingerprints diff --git a/docs/circle_ci/Steps/AttachWorkspace.md b/docs/circle_ci/Steps/AttachWorkspace.md new file mode 100644 index 00000000..8f8144b1 --- /dev/null +++ b/docs/circle_ci/Steps/AttachWorkspace.md @@ -0,0 +1,21 @@ +# Attach Workspace + +## CircleCI input + +```yaml +steps: +- attach_workspace + at: my/path +``` + +### Transformed Github Action + +```yaml +- uses: actions/download-artifact@v2 + with: + path: my/path +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Steps/Checkout.md b/docs/circle_ci/Steps/Checkout.md new file mode 100644 index 00000000..9d5d44ec --- /dev/null +++ b/docs/circle_ci/Steps/Checkout.md @@ -0,0 +1,18 @@ +# Run + +## CircleCI input + +```yaml +steps: +- checkout +``` + +### Transformed Github Action + +```yaml +- uses: actions/checkout@v2 +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Steps/Deploy.md b/docs/circle_ci/Steps/Deploy.md new file mode 100644 index 00000000..708a9885 --- /dev/null +++ b/docs/circle_ci/Steps/Deploy.md @@ -0,0 +1,19 @@ +# Deploy + +## CircleCI input + +```yaml +steps: +- deploy: + command: echo hello world! +``` + +### Transformed Github Action + +```yaml +- run: echo hello world! +``` + +### Unsupported Options + +- The deploy step will behave the same way as the run step in CircleCI. The two exceptions listed in the documentation [here](https://circleci.com/docs/2.0/configuration-reference/?section=reference#deploy-deprecated) are not supported by Valet. diff --git a/docs/circle_ci/Steps/PersistToWorkspace.md b/docs/circle_ci/Steps/PersistToWorkspace.md new file mode 100644 index 00000000..263995c2 --- /dev/null +++ b/docs/circle_ci/Steps/PersistToWorkspace.md @@ -0,0 +1,26 @@ +# Persist To Workspace + +## CircleCI input + +```yaml +steps: +- persist_to_workspace + root: root + paths: + - foo/bar + - baz +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + with: + path: |- + root/foo/bar + root/baz +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Steps/RestoreCache.md b/docs/circle_ci/Steps/RestoreCache.md new file mode 100644 index 00000000..db4a868a --- /dev/null +++ b/docs/circle_ci/Steps/RestoreCache.md @@ -0,0 +1,24 @@ +# Restore Cache + +## CircleCI input + +```yaml +steps: + - restore_cache: + keys: v1-myapp-{{ arch }}-{{ checksum "project.clj" }} +``` + +### Transformed Github Action + +```yaml +- name: restore_cache + uses: actions/cache@v2 + with: + restore-keys: |- + my-example-key + my-other-key +``` + +### Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/circle_ci/Steps/Run.md b/docs/circle_ci/Steps/Run.md new file mode 100644 index 00000000..54f58e70 --- /dev/null +++ b/docs/circle_ci/Steps/Run.md @@ -0,0 +1,21 @@ +# Run + +## CircleCI input + +```yaml +run: + - command: make test + - when: always +``` + +### Transformed Github Action + +```yaml +- run: make test + if: always() +``` + +### Unsupported Options + +- background +- no_output_timeout diff --git a/docs/circle_ci/Steps/SaveCache.md b/docs/circle_ci/Steps/SaveCache.md new file mode 100644 index 00000000..ad03f26a --- /dev/null +++ b/docs/circle_ci/Steps/SaveCache.md @@ -0,0 +1,25 @@ +# Save Cache + +## CircleCI input + +```yaml +steps: + - save_cache: + key: v1-myapp-{{ arch }}-{{ checksum "project.clj" }} + paths: + - /home/ubuntu/.m2 +``` + +### Transformed Github Action + +```yaml +- uses: actions/cache@v2 + with: + path: /home/ubuntu/.m2 + key: v1-myapp-{{ arch }}-{{ checksum "project.clj" }} +``` + +### Unsupported Options + +- `actions/cache@v2` is not supported on GHES +- If a workflow contains both a save_cache and restore_cache step with the same key, they will be combined in the final Github workflow under the name restore_cache. diff --git a/docs/circle_ci/Steps/StoreArtifacts.md b/docs/circle_ci/Steps/StoreArtifacts.md new file mode 100644 index 00000000..c3dd38ab --- /dev/null +++ b/docs/circle_ci/Steps/StoreArtifacts.md @@ -0,0 +1,21 @@ +# Store Artifacts + +## CircleCI input + +```yaml +steps: +- store_artifacts + path: my-artifact +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + with: + path: my-artifact +``` + +### Unsupported Options + +- Destination diff --git a/docs/circle_ci/Steps/StoreTestResults.md b/docs/circle_ci/Steps/StoreTestResults.md new file mode 100644 index 00000000..d539979a --- /dev/null +++ b/docs/circle_ci/Steps/StoreTestResults.md @@ -0,0 +1,21 @@ +# Store Test Results + +## CircleCI input + +```yaml +steps: +- store_test_results + path: my-artifact +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + with: + path: my-artifact +``` + +### Unsupported Options + +- None diff --git a/docs/circle_ci/Steps/Unless.md b/docs/circle_ci/Steps/Unless.md new file mode 100644 index 00000000..9db21d6d --- /dev/null +++ b/docs/circle_ci/Steps/Unless.md @@ -0,0 +1,22 @@ +# Unless + +## CircleCI input + +```yaml +unless: + condition: + and: [true, true, false] + steps: + run: echo "my condition passed!" +``` + +### Transformed Github Action + +```yaml +- run: echo "my condition passed!" + if: "${{ !(true && true && false) }}" +``` + +### Unsupported Options + +- none diff --git a/docs/circle_ci/Steps/When.md b/docs/circle_ci/Steps/When.md new file mode 100644 index 00000000..61970b52 --- /dev/null +++ b/docs/circle_ci/Steps/When.md @@ -0,0 +1,22 @@ +# When + +## CircleCI input + +```yaml +when: + condition: + and: [true, true, false] + steps: + run: echo "my condition passed!" +``` + +### Transformed Github Action + +```yaml +- run: echo "my condition passed!" + if: true && true && false +``` + +### Unsupported Options + +- none diff --git a/docs/circle_ci/Triggers/Parameters.md b/docs/circle_ci/Triggers/Parameters.md new file mode 100644 index 00000000..54725471 --- /dev/null +++ b/docs/circle_ci/Triggers/Parameters.md @@ -0,0 +1,30 @@ +# Parameters + +## CircleCI input + +```yaml +parameters: + example-parameter: + type: string + default: "latest" + example-parameter-two: + type: string + description: "my example parameter" +``` + +### Transformed Github Action + +```yaml +workflow_dispatch: + inputs: + example-parameter: + required: false + default: latest + example-parameter-two: + required: true + description: "my example parameter" +``` + +### Unsupported Options + +- Type diff --git a/docs/circle_ci/Triggers/Schedule.md b/docs/circle_ci/Triggers/Schedule.md new file mode 100644 index 00000000..3576d58a --- /dev/null +++ b/docs/circle_ci/Triggers/Schedule.md @@ -0,0 +1,21 @@ +# Schedule + +## CircleCI input + +```yaml +triggers: # use the triggers key to indicate a scheduled build + - schedule: + cron: 51 3 * * * +``` + +### Transformed Github Action + +```yaml +on: + schedule: + - cron: "51 3 * * *" +``` + +### Unsupported Options + +- Branch filters diff --git a/docs/circle_ci/index.md b/docs/circle_ci/index.md new file mode 100644 index 00000000..fee3a7bb --- /dev/null +++ b/docs/circle_ci/index.md @@ -0,0 +1,57 @@ +# Concept Mappings + +| CircleCI | GitHub | +| :------------------------------------------------ | :--------------------------- | +| [AddSshKeys](Steps/AddSshKeys.md) | run | +| [AttachWorkspace](Steps/AttachWorkspace.md) | actions/download-artifact@v2 | +| [Checkout](Steps/Checkout.md) | actions/checkout@v2 | +| [Deploy](Executors/Deploy.md) | run | +| [Docker](Executors/Docker.md) | container | +| [Machine](Executors/Machine.md) | runs-on | +| [Macos](Executors/Macos.md) | runs-on | +| [PersistToWorkspace](Steps/PersistToWorkspace.md) | actions/upload-artifact@v2 | +| [Run](Steps/Run.md) | run | +| [Schedule](Triggers/Schedule.md) | on | +| [Store Test Results](Steps/StoreTestResults.md) | actions/upload-artifact@v2 | +| [Store Artifacts](Steps/StoreArtifacts.md) | actions/upload-artifact@v2 | +| [Unless](Steps/Unless.md) | if | +| [When](Steps/When.md) | if | + +Any jobs not listed above will not be mapped to an action and will be left as a comment in the converted workflow. + +## Unsupported + +The following steps do not have any equivalent in GitHub Actions: + +- setup_remote_docker + +The following job properties do not have any equivalent in GitHub Actions: + +- resource_class +- parallelism +- branches (deprecated in CircleCI) +- circleci_ip_ranges + +The following concepts are not supported by GitHub Actions Importer: + +- executor type parameters +- dynamic configuration pipelines (`setup` key) + +## Orb Mappings + +| CircleCI | GitHub | +| :--------------------------------------------- | :------------------------------------------------------ | +| [circleci/aws-cli](Orbs/AwsCli) | aws-actions/configure-aws-credentials@v1 | +| [circleci/aws-ecr](Orbs/AwsEcr) | aws-actions/amazon-ecr-login@v1.5.3 | +| [circleci/aws-ecs](Orbs/AwsEcs) | aws-actions/amazon-ecs-render-task-definition@v1.1.2 | +| [circleci/aws-s3](Orbs/AwsS3) | aws-actions/configure-aws-credentials@v1, run | +| [circleci/browser-tools](Orbs/BrowserTools) | - | +| [cypress-io/cypress](Orbs/Cypress) | cypress-io/github-action@v2, run | +| [circleci/docker](Orbs/Docker) | hadolint/hadolint-action@v1.6.0, run | +| [circleci/go](Orbs/Go) | actions/setup-go@v3, actions/cache@v3, run | +| [circleci/heroku](Orbs/Heroku) | run | +| [circleci/node](Orbs/Node) | actions/setup-node@v2, actions/cache@v2, run | +| [circleci/python](Orbs/Python) | actions/cache@v2, run | +| [circleci/ruby](Orbs/Ruby) | ruby/setup-ruby@v1.138.0, run | +| [circleci/slack](Orbs/Slack) | rtCamp/action-slack-notify@v2.2.0 | +| [circleci/windows](Orbs/Windows) | runs-on | diff --git a/docs/gitlab/AfterScript.md b/docs/gitlab/AfterScript.md new file mode 100644 index 00000000..9045d927 --- /dev/null +++ b/docs/gitlab/AfterScript.md @@ -0,0 +1,19 @@ +# after_script + +## GitLab input + +```yaml +before_script: + - echo "Execute this command after any `script:` commands." +``` + +### Transformed Github Action + +```yaml +- run: echo "Execute this command after any `script:` commands." + if: always() +``` + +### Unsupported Options + +None diff --git a/docs/gitlab/Artifacts.md b/docs/gitlab/Artifacts.md new file mode 100644 index 00000000..80278bac --- /dev/null +++ b/docs/gitlab/Artifacts.md @@ -0,0 +1,33 @@ +# artifacts + +## GitLab input + +```yaml +artifacts: + expire_in: 1 week + name: artifact-name + paths: + - binaries/ + exclude: + - binaries/**/*.o +``` + +### Transformed Github Action + +```yaml +- uses: actions/upload-artifact@v2 + if: success() + with: + name: "${{ github.job }}" + retention-days: 7 + path: |- + binaries/ + !binaries/**/*.o +``` + +### Unsupported Options + +- `expose_as` +- `public` +- `reports` +- `untracked` diff --git a/docs/gitlab/BeforeScript.md b/docs/gitlab/BeforeScript.md new file mode 100644 index 00000000..bb009257 --- /dev/null +++ b/docs/gitlab/BeforeScript.md @@ -0,0 +1,18 @@ +# before_script + +## GitLab input + +```yaml +before_script: + - echo "Execute this command before any `script:` commands." +``` + +### Transformed Github Action + +```yaml +- run: echo "Execute this command before any `script:` commands." +``` + +### Unsupported Options + +None diff --git a/docs/gitlab/Cache.md b/docs/gitlab/Cache.md new file mode 100644 index 00000000..a8c9969d --- /dev/null +++ b/docs/gitlab/Cache.md @@ -0,0 +1,31 @@ +# cache + +## GitLab input + +```yaml +cache: + key: + files: + - Gemfile.lock + - package.json + paths: + - vendor/ruby + - node_modules +``` + +### Transformed Github Action + +```yaml +- uses: actions/cache@v2 + with: + path: |- + vendor/ruby + node_modules + key: "${{ runner.os }}-${{ hashFiles('Gemfile.lock', 'package.json') }}" +``` + +### Unsupported Options + +- `untracked` +- `when` +- `actions/cache@v2` is not supported on GHES diff --git a/docs/gitlab/Checkout.md b/docs/gitlab/Checkout.md new file mode 100644 index 00000000..038e75d4 --- /dev/null +++ b/docs/gitlab/Checkout.md @@ -0,0 +1,104 @@ +# checkout + +## GitLab input + +- Checking out source code is done implicitly. +- In variables, you can set `GIT_STRATEGY: none` or `GIT_CHECKOUT: "false"` to skip checking out source code. +- Git submodules can be declared in variables: `GIT_SUBMODULE_STRATEGY: none, normal or recursive` +- In Settings, CI/CD, General pipelines you can set the Git shallow clone (`ci_default_git_depth`), which defaults to 50. + - In variables, fetch depth can be overridden by setting `GIT_DEPTH: "5"` +- Using Git LFS client you can configure Large File Storage(`lfs`), which defaults to `true`. + +```yaml + +checkout-always: + stage: build + script: + - echo "Job will include an actions/checkout@v2 with default Gitlab fields" +skip-checkout: + stage: build + variables: + GIT_STRATEGY: none + script: echo "Job will not include a checkout step" +git-submodule: + variables: + GIT_SUBMODULE_STRATEGY: recursive # or normal + stage: build + script: echo "Job will include a checkout step with submodules" +git-strategy-checkout: + variables: + GIT_STRATEGY: clone # or normal + GIT_CHECKOUT: "false" + stage: build + script: echo "Job will not include a checkout step" +git-checkout: + variables: + GIT_CHECKOUT: "false" + stage: build + script: echo "Job will not include" +git-depth: + variables: + GIT_DEPTH: "7" + stage: build + script: echo "Will override settings fetch depth" + +``` + +### Transformed Github Action + +```yaml + +checkout-always: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 50 + lfs: true + - run: echo "Job will include an actions/checkout@v2 with default Gitlab fields" +skip-checkout: + runs-on: ubuntu-latest + env: + GIT_STRATEGY: none + steps: + - run: echo "Job will not include a checkout step" +git-submodule: + runs-on: ubuntu-latest + env: + GIT_SUBMODULE_STRATEGY: recursive + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 50 + lfs: true + submodules: recursive + - run: echo "Job will include a checkout step with submodules" +git-strategy-checkout: + runs-on: ubuntu-latest + env: + GIT_STRATEGY: clone + GIT_CHECKOUT: 'false' + steps: + - run: echo "Job will not include a checkout step" +git-checkout: + runs-on: ubuntu-latest + env: + GIT_CHECKOUT: 'false' + steps: + - run: echo "Job will not include" +git-depth: + runs-on: ubuntu-latest + env: + GIT_DEPTH: '7' + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '7' + lfs: true + - run: echo "Will override settings fetch depth" +``` + +### Unsupported Options + +- GIT_CLEAN_FLAGS +- GIT_FETCH_EXTRA_FLAGS diff --git a/docs/gitlab/Dependencies.md b/docs/gitlab/Dependencies.md new file mode 100644 index 00000000..dda54f4b --- /dev/null +++ b/docs/gitlab/Dependencies.md @@ -0,0 +1,20 @@ +# dependencies + +## GitLab input + +```yaml +dependencies: + - build:osx +``` + +### Transformed Github Action + +```yaml +- uses: actions/download-artifact@v2 + with: + name: build:osx +``` + +### Unsupported Options + +None diff --git a/docs/gitlab/Environment.md b/docs/gitlab/Environment.md new file mode 100644 index 00000000..9bf2e7c1 --- /dev/null +++ b/docs/gitlab/Environment.md @@ -0,0 +1,40 @@ +# environment + +## GitLab input + +```yaml +environment: deploy_environment +``` + +```yaml +environment: + name: production_env + url: https://prod.example.com + # Unsupported + action: stop + on_stop: stop_review_app + auto_stop_in: 1 day + deployment_tier: production + kubernetes: + namespace: production +``` + +### Transformed Github Action + +```yaml +environment: deploy_environment +``` + +```yaml +environment: + name: production_env + url: https://prod.example.com +``` + +### Unsupported Options + +- on_stop +- action +- auto_stop_in +- kubernetes +- deployment_tier diff --git a/docs/gitlab/Image.md b/docs/gitlab/Image.md new file mode 100644 index 00000000..f8b7f6db --- /dev/null +++ b/docs/gitlab/Image.md @@ -0,0 +1,30 @@ +# image + +## GitLab input + +```yaml +# String configuration +image: ruby:latest + +# Multiple parameter configuration +image: + name: postgres + entrypoint: ["docker-entrypoint.sh", "-b"] +``` + +### Transformed Github Action + +```yaml +# String output +container: + image: ruby:latest + +# Multiple parameter output +container: + image: postgres + options: "--entrypoint docker-entrypoint.sh" +``` + +### Unsupported Options + +- entrypoint (Unable to convert entrypoints with arguments) \ No newline at end of file diff --git a/docs/gitlab/Pages.md b/docs/gitlab/Pages.md new file mode 100644 index 00000000..8a318bb9 --- /dev/null +++ b/docs/gitlab/Pages.md @@ -0,0 +1,27 @@ +# pages + +## GitLab input + +```yaml +pages: + stage: deploy + script: + - echo 'Nothing to do...' + artifacts: + paths: + - public + expire_in: 1 day +``` + +### Transformed Github Action + +```yaml +- uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + branch: gh-pages + folder: public +``` + +### Unsupported Options + +None diff --git a/docs/gitlab/Release.md b/docs/gitlab/Release.md new file mode 100644 index 00000000..31f323a0 --- /dev/null +++ b/docs/gitlab/Release.md @@ -0,0 +1,43 @@ +# release + +## GitLab input + +```yaml +release_job: + ... + release: + name: 'Release $CI_COMMIT_TAG' + description: 'Created using the release-cli $EXTRA_DESCRIPTION' + tag_name: '$CI_COMMIT_TAG' + ref: '$CI_COMMIT_TAG' + milestones: + - 'm1' + - 'm2' + - 'm3' + released_at: '2020-07-15T08:00:00Z' + assets: + links: + - name: 'asset1' + url: 'https://example.com/assets/1' + - name: 'asset2' + url: 'https://example.com/assets/2' + filepath: '/pretty/url/1' + link_type: 'other' +``` + +### Transformed Github Action + +```yaml +- uses: softprops/action-gh-release@v0.1.15 + with: + tag_name: "${{ github.ref }}" + body: Created using the release-cli $EXTRA_DESCRIPTION + name: Release ${{ github.ref }} + target_commitish: "${{ github.ref }}" +``` + +### Unsupported Options + +- `milestones` +- `released_at` +- `assets` diff --git a/docs/gitlab/Script.md b/docs/gitlab/Script.md new file mode 100644 index 00000000..4fc7af31 --- /dev/null +++ b/docs/gitlab/Script.md @@ -0,0 +1,20 @@ +# script + +## GitLab input + +```yaml +script: + - uname -a + - bundle exec rspec +``` + +### Transformed Github Action + +```yaml +- run: unname -a +- run: bundle exec rspec +``` + +### Unsupported Options + +None diff --git a/docs/gitlab/Secrets.md b/docs/gitlab/Secrets.md new file mode 100644 index 00000000..8a3777e9 --- /dev/null +++ b/docs/gitlab/Secrets.md @@ -0,0 +1,34 @@ +# secrets + +## GitLab input + +```yaml +secrets: + DATABASE_PASSWORD: + vault: + engine: + name: kv-v2 + path: ops + path: production/db + field: password + ADMIN_PASSWORD: + vault: production/db/admin_password +``` + +### Transformed Github Action + +```yaml +- uses: hashicorp/vault-action@v2.5.0 + env: + VAULT_URL: UPDATE_THIS_VALUE + with: + url: "${{ env.VAULT_URL }}" + token: "${{ secrets.VaultToken }}" + secrets: |- + ops/data/production/db password | DATABASE_PASSWORD ; + kv-v2/data/production/db admin_password | ADMIN_PASSWORD +``` + +### Unsupported Options + +- file: true diff --git a/docs/gitlab/Services.md b/docs/gitlab/Services.md new file mode 100644 index 00000000..eb013d3b --- /dev/null +++ b/docs/gitlab/Services.md @@ -0,0 +1,31 @@ +# services + +## GitLab input + +```yaml +# Services can be configured at the top level, in defaults, or at the job level +services: + - ruby:latest + - postgres + - name: redis:6.0 + alias: redis-alias + entrypoint: ["docker-entrypoint.sh", "-b"] + command: [start] +``` + +### Transformed Github Action + +```yaml +services: + ruby:latest: + image: ruby:latest + postgres: + image: postgres + redis-alias: + image: redis:6.0 + options: "--entrypoint docker-entrypoint.sh redis:6.0 start" +``` + +### Unsupported Options + +- entrypoint (Unable to convert entrypoints with arguments) \ No newline at end of file diff --git a/docs/gitlab/Tags.md b/docs/gitlab/Tags.md new file mode 100644 index 00000000..1a9e25f6 --- /dev/null +++ b/docs/gitlab/Tags.md @@ -0,0 +1,28 @@ +# tags + +## GitLab input + +```yaml +tags: + - windows # osx and linux map to macos-latest and ubuntu-latest + +tags: + - postgres + - development +``` + +### Transformed Github Action + +```yaml +runs-on: + - windows-latest + +runs-on: + - self-hosted + - postgres + - development +``` + +### Unsupported Options + +- None \ No newline at end of file diff --git a/docs/gitlab/Timeout.md b/docs/gitlab/Timeout.md new file mode 100644 index 00000000..b978edfa --- /dev/null +++ b/docs/gitlab/Timeout.md @@ -0,0 +1,39 @@ +# timeout + +## GitLab input + +- Timeout can be configured in either general pipeline settings or in the pipeline yaml. +- Pipeline timeout overrides the general configuration `build_timeout`. + + +```yaml +timeout: 1 hundred 20 seconds +``` + +```ruby +# If configuration timeout is set to 6 hours or equivalent no timeout field will be added +{ build_timeout: 21600 } +``` + +```ruby +# If configuration timeout is set to any other time besides 6 hours or equivalent a timeout field will be added +{ build_timeout: 360 } +``` + +### Transformed Github Action + +```yaml +timeout-minutes: 2 +``` + +```yaml +# None +``` + +```yaml +timeout-minutes: 6 +``` + +### Unsupported Options + +- None diff --git a/docs/gitlab/index.md b/docs/gitlab/index.md new file mode 100644 index 00000000..db4bb68e --- /dev/null +++ b/docs/gitlab/index.md @@ -0,0 +1,24 @@ +# Concept Mappings + +| GitLab | GitHub | +| :------------------------------ | :----------------------------------------- | +| [AfterScript](AfterScript.md) | run | +| [Artifacts](Artifacts.md) | actions/upload-artifact@v2 | +| [BeforeScript](BeforeScript.md) | run | +| [Cache](Cache.md) | actions/cache@v2 | +| [Checkout](Checkout.md) | actions/checkout@v2 | +| [Dependencies](Dependencies.md) | actions/download-artifact@v2 | +| [Environment](Environment.md) | environment | +| [Image](Image.md) | container | +| [Pages](Pages.md) | JamesIves/github-pages-deploy-action@v4.4.1| +| [Release](Release.md) | softprops/action-gh-release@v0.1.15 | +| [Script](Script.md) | run | +| [Secrets](Secrets.md) | hashicorp/vault-action@v2.5.0 | +| [Services](Services.md) | services | +| [Tags](Tags.md) | runs-on | +| [Timeout](Timeout.md) | timeout-minutes | + +The following constructs do not have an equivalent in GitHub Actions: + +- coverage +- dast_configuration diff --git a/docs/jenkins/Agent.md b/docs/jenkins/Agent.md new file mode 100644 index 00000000..6903a658 --- /dev/null +++ b/docs/jenkins/Agent.md @@ -0,0 +1,83 @@ +# Agent + +## Designer pipeline + +### Jenkins input + +Label: +```xml + + node-label + +``` + +### Transformed Github Action + +```yaml +jobs: + build: + runs-on: node-label +``` + +### Supported Agent types +- label agent + +### Unsupported Agent types + +- any agent +- none agent +- [docker](Docker.md) agent +- [node](Node.md) agent +- dockerfile agent +- kubernetes agent + +## Jenkinsfile pipeline + +### Jenkins input + +Top level agent: +```groovy +agent { + label 'my-defined-label' +} + +stages { + stage('Example Build') { + .... + } +} +``` + +or Stage level agent: +```groovy +stages { + stage('Example Build') { + agent { + label 'my-defined-label' + } + .... + } +} +``` + +### Transformed Github Action + +```yaml +jobs: + Example-Build: + name: Example Build + runs-on: [self-hosted, my-defined-label] +``` + +### Supported Agent types +- any agent +- none agent +- label agent + - And conditionals +- [docker](Docker.md) agent +- [node](Node.md) agent + +### Unsupported Agent types + +- dockerfile agent +- kubernetes agent diff --git a/docs/jenkins/AndroidEmulator.md b/docs/jenkins/AndroidEmulator.md new file mode 100644 index 00000000..91bfb812 --- /dev/null +++ b/docs/jenkins/AndroidEmulator.md @@ -0,0 +1,43 @@ +# Android Emulator + +## Designer pipeline + +### Jenkins input + +```xml + + 4.1 + 240 + armeabi-v7a + 64M + true + 10 + -netfast -netspeed full -port 5556 + +``` + +### Transformed Github Action + +```yaml +- name: run tests on android emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 16 + arch: armeabi-v7a + sdcard-path-or-size: 64M + emulator-options: "-netfast -netspeed full -port 5556 -wipe-data" +``` + +### Unsupported Options + +- screenDensity +- screenResolution +- deviceDefinition +- deviceLocale +- avdNameSuffix +- hardwareProperties +- ShowWindow +- UseSnapshots +- deleteAfterBuild +- startupDelay +- startupTimeout diff --git a/docs/jenkins/AnsiblePlaybook.md b/docs/jenkins/AnsiblePlaybook.md new file mode 100644 index 00000000..8abd8b6a --- /dev/null +++ b/docs/jenkins/AnsiblePlaybook.md @@ -0,0 +1,75 @@ +# Ansible Playbook + +## Designer pipeline + +```xml + + playbook/path + + inventory/path + dynamic_inventory + + limit + tag1,tag2 + tag3,tag4 + task_to_start + + abc-123 + true + become_user + true + sudo_user + 5 + true + true + false + additional_parameter + false + + + key1 + val1 + + + key2 + val2 + + + +``` + +### Transformed Github Action + +```yaml +name: run ansible playbook +shell: bash +run: ansible-playbook playbook playbook/path -i inventory/path -s -U sudo_user -b --become-user become_user -l limit -t tag1,tag2 --skipped-tags tag3,tag4 --start-at-task task_to_start -f 5 -e "key1='val1' key2='val2'" +env: + ANSIBLE_HOST_KEY_CHECKING: true + ANSIBLE_FORCE_COLOR: true + PYTHONUNBUFFERED: true +``` + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + steps { + ansiblePlaybook(credentialsId: 'private_key', inventory: 'inventories/a/hosts', playbook: 'my_playbook.yml') + } + } +``` + +### Transformed Github Action + +```yaml +- name: run ansible playbook + shell: bash + run: ansible-playbook playbook my_playbook.yml -i inventories/a/hosts +``` + +### Unsupported Options + +- Ensure the `ansible-playbook` ssh credentials are present on the runner. diff --git a/docs/jenkins/Ant.md b/docs/jenkins/Ant.md new file mode 100644 index 00000000..1ad16c49 --- /dev/null +++ b/docs/jenkins/Ant.md @@ -0,0 +1,68 @@ +# Ant + +## Designer pipeline + +### Jenkins input + +```xml + + target + -Xms1024m +-Xms1024m + my-build-file + properties + +``` + +### Transformed Github Action + +```yaml + - name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' + settings-path: "${{ github.workspace }}" + - name: run ant + run: Ant -D teamcity.build.customer=${customer} -D teamcity.build.debug=false -buildfile ${PROJECT_NAME}/build.xml clean make + env: + ANT_OPTS: '-Xms1024m -Xmx1024m' +``` + +### Unsupported Options + +- Ant Version +- JDK Version + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps{ + withAnt(installation: 'ant_latest') { + sh label: '', script: '/usr/local/sandeep/hybris/bin/platform/apache-ant/bin/ant -version' + sh "ant -f 'config/build.xml' jenkinsFinalTest -Dtest-file-name='${libFolder}/${f.name}'" + } +} +``` + +### Transformed Github Action + +```yaml + steps: + - name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' + settings-path: "${{ github.workspace }}" + - name: sh + shell: bash + run: "/usr/local/sandeep/hybris/bin/platform/apache-ant/bin/ant -version" + - name: sh + run: '"ant -f ''config/build.xml'' jenkinsFinalTest -Dtest-file-name=''${libFolder}/${f.name''"' +``` + +### Unsupported Options + +- Ant Version +- JDK Version diff --git a/docs/jenkins/AntExecBuilder.md b/docs/jenkins/AntExecBuilder.md new file mode 100644 index 00000000..a4c04f26 --- /dev/null +++ b/docs/jenkins/AntExecBuilder.md @@ -0,0 +1,50 @@ +# AntExec Builder + +## Designer pipeline + +### Jenkins input + +```xml + + <echo>foo</echo> + <echo>bar</echo> + some_script.xml + bar=baz + -Xms2G -Xmx2G + false + false + true + false + +``` + +### Transformed Github Action + +```yaml +- name: Run Ant Exec command + env: + ANT_OPTS: "-Xms2G -Xmx2G" + shell: bash + run: |- + cat > some_script.xml < + + + + + foo + + bar + + EOF + cat > some_script.xml.properties < + archive/path/ + exclude/path/ + true + true + true + true + true + true + +``` + +### Transformed Github Action + +```yaml + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + if-no-files-found: ignore + path: |- + archive/path/ + !exclude/path/ + !**/*~ + !**/#*# + !**/.#* + !**/%*% + !**/._* + !**/CVS + !**/CVS/** + !**/.cvsignore + !**/SCCS + !**/SCCS/** + !**/vssver.scc + !**/.svn + !**/.svn/** + !**/.DS_Store + !**/.git + !**/.git/** + !**/.gitattributes + !**/.gitignore + !**/.gitmodules + !**/.hg + !**/.hg/** + !**/.hgignore + !**/.hgsub + !**/.hgsubstate + !**/.hgtags + !**/.bzr + !**/.bzr/** + !**/.bzrignore + if: success() +``` + +### Supported Options + +- Artifact paths (artifact) +- Exclude paths (excludes) +- Allow empty archive (allowEmptyArchive) +- Run if successful run only (onlyIfSuccessful) +- Default ant exclude paths (defaultExcludes) + +### Unsupported Options + +- Case sensitive (caseSensitive) +- Fingerprint (fingerprint) +- Follow system links (followSymlinks) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: false, allowEmptyArchive: false, caseSensitive: false, defaultExcludes: false, excludes: false, onlyIfSuccessful: false + archiveArtifacts 'build/libs/**/*.jar' + } +``` + +### Transformed Github Action + +```yaml + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + if-no-files-found: ignore + path: |- + archive/path/ + !exclude/path/ + !**/*~ + !**/#*# + !**/.#* + !**/%*% + !**/._* + !**/CVS + !**/CVS/** + !**/.cvsignore + !**/SCCS + !**/SCCS/** + !**/vssver.scc + !**/.svn + !**/.svn/** + !**/.DS_Store + !**/.git + !**/.git/** + !**/.gitattributes + !**/.gitignore + !**/.gitmodules + !**/.hg + !**/.hg/** + !**/.hgignore + !**/.hgsub + !**/.hgsubstate + !**/.hgtags + !**/.bzr + !**/.bzr/** + !**/.bzrignore + if: success() +``` + +### Unsupported Options + +- Case sensitive (caseSensitive) +- Fingerprint (fingerprint) diff --git a/docs/jenkins/ArtifactDeploy.md b/docs/jenkins/ArtifactDeploy.md new file mode 100644 index 00000000..590dc2d0 --- /dev/null +++ b/docs/jenkins/ArtifactDeploy.md @@ -0,0 +1,47 @@ +# Artifact Deployer + +## Designer pipeline + +### Jenkins input + +```xml +{ + "plugin"=>"artifactdeployer@1.2", + "entries"=>[ + { + "org.jenkinsci.plugins.artifactdeployer.ArtifactDeployerEntry"=>{ + "includes"=>"*/*.*", + "basedir"=>nil, + "excludes"=>nil, + "remote"=>"/nfs/build/deploy/${BUILD_ID}", + "flatten"=>"false", + "deleteRemote"=>"false", + "deleteRemoteArtifacts"=>"false", + "failNoFilesDeploy"=>"false" + } + } + ], + "deployEvenBuildFail"=>"false" + } +``` + +### Transformed Github Action + +```yaml + - name: Artifacts Deploy + uses: actions/upload-artifact@v2 + with: + path: "${{ github.workspace }}" + if: always() +``` + +### Unsupported Options + +- remote +- flatten +- deleteRemote +- deleteRemoteArtifacts + +### Retention Period + +Artifacts are retained for 90 days by default. We can specify a shorter retention period using the retention-days input: and the retention period value must be between 1 and 90 inclusive. diff --git a/docs/jenkins/AzureKeyVault.md b/docs/jenkins/AzureKeyVault.md new file mode 100644 index 00000000..25a5e120 --- /dev/null +++ b/docs/jenkins/AzureKeyVault.md @@ -0,0 +1,42 @@ +# AzureKeyVault + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +options { + azureKeyVault([[envVariable: 'MY_SECRET', name: 'my-secret', secretType: 'Secret']]) +} +steps { + echo 'Found $MY_SECRET' +} +``` + +### Transformed Github Action + +```yaml +- uses: Azure/login@v1 + with: + creds: "${{ secrets.AZURE_CREDENTIALS }}" +- name: Get secrets from Azure Key Vault + shell: bash + run: |- + for secret_name in my-secret; do + secret_value=$(az keyvault secret show --vault-name "chaseTestVault" --name $secret_name --query value -o tsv) + echo "::add-mask::$secret_value" + echo "$secret_name=$secret_value" >> $GITHUB_ENV + done +- name: checkout + uses: actions/checkout@v2 +- name: echo message + run: echo Found $MY_SECRET +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/Batch.md b/docs/jenkins/Batch.md new file mode 100644 index 00000000..a746e83d --- /dev/null +++ b/docs/jenkins/Batch.md @@ -0,0 +1,57 @@ +# Batch Builder + +## Designer pipeline + +### Jenkins input + +```xml + + + echo "hello world!" + + + test + true + RESET + + + 3 + + +``` + +### Transformed Github Action + +```yaml +name: run batch command +run: echo "hello world!" +shell: cmd +``` + +### Unsupported Options + +- Environment filters (configuredLocalRules) +- ERRORLEVEL to set build unstable (unstableReturn) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + bat 'set' +} +``` + +### Transformed Github Action + +```yaml +steps: +- name: bat + shell: cmd + run: set +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/BuildTimeout.md b/docs/jenkins/BuildTimeout.md new file mode 100644 index 00000000..22e93ad5 --- /dev/null +++ b/docs/jenkins/BuildTimeout.md @@ -0,0 +1,39 @@ +# Build Timeout + +## Jenkins input + +```xml + + + + 30 + + timeoutvar + + + + + test + + + + +``` + +## Transformed Github Action + +```yaml +jobs: + build: + timeout-minutes: 30 +``` + +## Unsupported Options + +- Strategies: + - Deadline + - Elastic + - Likely Stuck + - No Activity +- Time-out variable +- Time-out actions \ No newline at end of file diff --git a/docs/jenkins/Checkout.md b/docs/jenkins/Checkout.md new file mode 100644 index 00000000..76b6839c --- /dev/null +++ b/docs/jenkins/Checkout.md @@ -0,0 +1,91 @@ +# Checkout + +## Designer pipeline + +### Jenkins input + +```xml + + 2 + + + https://github.com/github/jenkout-fake-repo + jenkout-bot + + + https://github.com/valet-testing-unit/sage + jenkout-bot + + + + + */main + + + false + + + +``` + +### Transformed Github Action + +```yaml +- name: checkout + uses: actions/checkout@v2 +``` + +### Unsupported Options + +- configVersion +- doGenerateSubmoduleConfigurations +- submoduleCfg +- extensions + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + checkout( + changelog: true, + poll: false, + scm: [ + $class: 'GitSCM', + branches: [[name: '${CID_COMMIT}']], + browser: [ + $class: 'GitLab', + repoUrl: 'http://github.com/zoo/fastsloth', + version: "8.8" + ], + doGenerateSubmoduleConfigurations: false, + extensions: [], + gitTool: 'git-default', + submoduleCfg: [], + userRemoteConfigs: [[name: 'origin', url: 'http://github.com/zoo/fastsloth.git', refspec: '+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/pull/*']] + ] + ); +} +``` + +### Transformed Github Action + +```yaml +- name: checkout + uses: actions/checkout@v2 + with: + repository: 'zoo/fast-sloth' +``` + +### Unsupported Options + +- changeLog +- poll +- branches (value not reported) +- doGenerateSubmoduleConfigurations (value not reported) +- extensions (value not reported) +- gitTool (value not reported) +- submoduleCfg (value not reported) +- userRemoteConfigs (only `url` is supported) +- browser (value not reported) diff --git a/docs/jenkins/ConditionalBuilder.md b/docs/jenkins/ConditionalBuilder.md new file mode 100644 index 00000000..18efbdb0 --- /dev/null +++ b/docs/jenkins/ConditionalBuilder.md @@ -0,0 +1,86 @@ +# Conditional Builder + +## Designer pipeline + +### Jenkins input + +```xml + + + + + 2 + 3 + + + + + echo "hello, world!" + + + + +``` + +### Transformed Github Action + +```yaml +name: run command +shell: bash +run: "echo "hello, world!" +if: always() +``` + +### Unsupported Options + +The following run conditions are not supported: + +- File exists +- Files match +- Numerical comparison +- Regular expression match +- Time +- Day of week +- Build cause +- Execution node +- Legacy boolean condition (deprecated) + +The following options are not supported + +- On evaluation failure + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +stage('Example Deploy') { + when { + branch 'production' + } + steps { + echo 'Deploying' + } +} +``` + +### Transformed Github Action + +```yaml +jobs: + example-deploy: + if: github.ref == 'production' + runs-on: ubuntu-latest + steps: +``` + +### Unsupported Options + +- changelog +- changeset +- expression +- not +- allOf +- anyOf +- triggeredBy +- environment diff --git a/docs/jenkins/CopyArtifact.md b/docs/jenkins/CopyArtifact.md new file mode 100644 index 00000000..130c8ad9 --- /dev/null +++ b/docs/jenkins/CopyArtifact.md @@ -0,0 +1,104 @@ +# Copy Artifact + +## Designer pipeline + +### Jenkins input + +```xml + + github/artifact + **/dir2/** + moved + + + true + +``` + +### Transformed Github Action + +```yaml +- name: download artifact + uses: dawidd6/action-download-artifact@v2.26.0 + with: + github_token: "${{ secrets.GITHUB_TOKEN }}" + workflow: "${{ env.WORKFLOW_NAME }}" + workflow_conclusion: "${{ env.CONCLUSION }}" + name: "${{ env.ARTIFACT_NAME }}" + path: "${{ env.TARGET_PATH }}" + repo: "${{ env.REPO }}" + env: + WORKFLOW_NAME: UPDATE_ME + CONCLUSION: completed,success + TARGET_PATH: moved + ARTIFACT_NAME: UPDATE_ME + REPO: "${{github.repository}}" + continue-on-error: false +``` + +### Unsupported Options +- Stable build only +- Artifacts to copy (Does not support globbing patterns) +- Artifacts not to copy +- Parameter filters +- Flatten directories +- Fingerprint Artifacts +- Which build: + - Latest saved build (marked "keep forever") + - Upstream build that triggered this job + - Build triggered by current MultiJob build + - Downstream build of + - Last build with artifacts + - Specified by permalink + - Copy from WORKSPACE of latest completed build + - Specified by a build parameter + - Result variable suffix + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + copyArtifacts filter: '**/dir1/**', fingerprintArtifacts: true, optional: true, projectName: 'github/test-artifact', selector: lastSuccessful(), target: 'moved' +} +``` + +### Transformed Github Action + +```yaml +- name: download artifact + uses: dawidd6/action-download-artifact@v2.26.0 + with: + github_token: "${{ secrets.GITHUB_TOKEN }}" + workflow: "${{ env.WORKFLOW_NAME }}" + workflow_conclusion: "${{ env.CONCLUSION }}" + name: "${{ env.ARTIFACT_NAME }}" + path: "${{ env.TARGET_PATH }}" + repo: "${{ env.REPO }}" + env: + WORKFLOW_NAME: UPDATE_ME + CONCLUSION: completed,success + TARGET_PATH: moved + ARTIFACT_NAME: UPDATE_ME + REPO: "${{github.repository}}" + continue-on-error: true +``` + +### Unsupported Options +- excludes +- filter +- fingerprintArtifact +- flatten +- parameters +- resultVariableSuffix +- following selectors + - downstream + - lastWithArtifacts + - $class: 'MultiJobBuildSelector' + - buildParameter + - permalink + - $class: 'PromotedBuildSelector' + - latestSavedBuild + - upstream + - workspace diff --git a/docs/jenkins/Credentials.md b/docs/jenkins/Credentials.md new file mode 100644 index 00000000..636cbd40 --- /dev/null +++ b/docs/jenkins/Credentials.md @@ -0,0 +1,94 @@ +# Credentials + +## Designer pipeline + +### Jenkins input + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${test} + test + + + +``` + +### Transformed Github Action + +```yaml +env: + test: ${test} +``` + +### Unsupported Options + +- Certificate (org.jenkinsci.plugins.credentialsbinding.impl.CertificateMultiBinding) +- Secret ZIP File (org.jenkinsci.plugins.credentialsbinding.impl.ZipFileBinding) +- Secret File (org.jenkinsci.plugins.credentialsbinding.impl.FileBinding) +- Kubeconfig File (com.microsoft.jenkins.kubernetes.credentials.KubeconfigFileCredentialsBinding) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +withCredentials([ + usernamePassword( + credentialsId: 'ssshhh', + passwordVariable: 'PASSWORD', + usernameVariable: 'USER_NAME')]) { + echo "Hi ${USER_NAME} your password is ${PASSWORD}" +} +``` + +### Transformed Github Action + +```yaml +- name: echo message + run: echo "Hi ${{ env.USER_NAME }}" + env: + PASSWORD: "${{ secrets.ssshhh_PASSWORD }}" + USER_NAME: "${{ secrets.ssshhh_USER_NAME }}" +``` + +### Unsupported Bindings +- certificate +- file +- zip +- KeychainPasswordAndPathBinding +- kubeconfigFile +- ConjurSecretApplianceCredentials +- conjurSecretCredential +- conjurSecretUsername +- conjurSecretUsernameSSHKey \ No newline at end of file diff --git a/docs/jenkins/CucumberBuilder.md b/docs/jenkins/CucumberBuilder.md new file mode 100644 index 00000000..7da18c4f --- /dev/null +++ b/docs/jenkins/CucumberBuilder.md @@ -0,0 +1,130 @@ +# Cucumber Builder + +## Designer pipeline + +### Jenkins input + +```xml + +**/*.json + + + +-1 +-1 +-1 +-1 +-1 +-1 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +false +0 +ALPHABETICAL +false +false +false +false +false + + +``` + +### Transformed Github Action + +```yaml + - name: Cucumber report + uses: deblockt/cucumber-report-annotations-action@v1.11 + with: + access-token: "${{ secrets.GITHUB_TOKEN }}" + path: "**/cucumber-report.json" +``` + +### Unsupported Options + +- failedStepsNumber +- skippedStepsNumber +- pendingStepsNumber +- undefinedStepsNumber +- skipEmptyJSONFiles +- pendingStepsNumber +- undefinedStepsNumber +- failedScenariosNumber +- failedFeaturesNumber +- failedStepsPercentage +- skippedStepsPercentage +- pendingStepsPercentage +- undefinedStepsPercentage +- failedScenariosPercentage +- failedFeaturesPercentage +- stopBuildOnFailedReport +- sortingMethod +- mergeFeaturesById +- mergeFeaturesWithRetest +- hideEmptyHooks +- skipEmptyJSONFiles +- expandAllSteps + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +pipeline { + agent any + stages { + stage('testing pipeline'){ + steps{ + cucumber buildStatus: 'UNSTABLE', + reportTitle: 'My report', + fileIncludePattern: '**/*.json', + trendsLimit: 10, + classifications: [ + [ + 'key': 'Browser', + 'value': 'Firefox' + ] + ] + } + } + } +} +``` +### Transformed Github Action + +```yaml + - name: Cucumber + uses: deblockt/cucumber-report-annotations-action@v1.11 + with: + access-token: "${{ secrets.GITHUB_TOKEN }}" + path: "**/cucumber-report.json" +``` + +### Unsupported Options + +- failedStepsNumber +- skippedStepsNumber +- pendingStepsNumber +- undefinedStepsNumber +- skipEmptyJSONFiles +- pendingStepsNumber +- undefinedStepsNumber +- failedScenariosNumber +- failedFeaturesNumber +- failedStepsPercentage +- skippedStepsPercentage +- pendingStepsPercentage +- undefinedStepsPercentage +- failedScenariosPercentage +- failedFeaturesPercentage +- stopBuildOnFailedReport +- sortingMethod +- mergeFeaturesById +- mergeFeaturesWithRetest +- hideEmptyHooks +- skipEmptyJSONFiles +- expandAllSteps diff --git a/docs/jenkins/CustomToolInstallWrapper.md b/docs/jenkins/CustomToolInstallWrapper.md new file mode 100644 index 00000000..3c0321a5 --- /dev/null +++ b/docs/jenkins/CustomToolInstallWrapper.md @@ -0,0 +1,38 @@ +# Custom Tool Install Wrapper + +## Designer pipeline + +### Jenkins input + +```xml + + + + NodeJS + + + + false + + false + +``` + +### Transformed Github Action + +N/A + +### Manual Tasks + +- Any referenced tool will be listed as manual steps to be installed in the migration pull request + +### Unsupported Options + +The following run conditions are not supported: + +- Don't install tools at the master job +- Convert #ToolName_HOME variables to the upper-case + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. \ No newline at end of file diff --git a/docs/jenkins/DeleteDir.md b/docs/jenkins/DeleteDir.md new file mode 100644 index 00000000..130adf76 --- /dev/null +++ b/docs/jenkins/DeleteDir.md @@ -0,0 +1,42 @@ +# Delete Directory + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +// Deletes current directory recursively. +steps { + deleteDir() +} +// Wrapping deleteDir in a dir step deletes the specified directory. +steps { + dir("/root") { + deleteDir() + } +} + +``` + +### Transformed Github Action + +```yaml +- name: delete directory + shell: bash + run: rm -rf "`pwd`" +``` + +```yaml +- name: delete directory + shell: bash + run: rm -rf "`pwd`" + working-directory: "/root" +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/DeployToContainer.md b/docs/jenkins/DeployToContainer.md new file mode 100644 index 00000000..7559da51 --- /dev/null +++ b/docs/jenkins/DeployToContainer.md @@ -0,0 +1,47 @@ +# Deploy to container + +## Designer pipeline + +### Jenkins input + +```xml +{ + "plugin" => "deploy@1.16", + "adapters" => [ + { + "hudson.plugins.deploy.tomcat.Tomcat8xAdapter" => { + "credentialsId" => "*/*.*", + "url" => "nil", + "path" => "nil" + } + }, + { + "hudson.plugins.deploy.tomcat.Tomcat8xAdapter" => { + "credentialsId" => "*/*.*", + "url" => "nil", + "path" => "nil" + } + } + ], + "war" => "*/*.war", + "onFailure" => "false" + } +``` + +### Transformed Github Action + +```yaml +- name: run command + shell: bash + run: |- + mvn cargo:undeploy + mvn clean + mvn install + mvn cargo:deploy + if: always() + +``` + +### Unsupported Options + +- onFailure diff --git a/docs/jenkins/Dir.md b/docs/jenkins/Dir.md new file mode 100644 index 00000000..50858adb --- /dev/null +++ b/docs/jenkins/Dir.md @@ -0,0 +1,32 @@ +# Dir + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + dir('doc/config') { + sh "ant clear build" + } + } +``` + +### Transformed Github Action + +```yaml +jobs: + job-name: + - name: sh + shell: bash + run: ant clear build + working-directory: "doc/config" +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/Docker.md b/docs/jenkins/Docker.md new file mode 100644 index 00000000..cd576e9e --- /dev/null +++ b/docs/jenkins/Docker.md @@ -0,0 +1,89 @@ +# Docker + +## Designer pipeline + +```xml + + + + +``` + +### Transformed Github Action + +```yaml +container: + image: my-image +``` + +### Unsupported Options + +- Docker cloud +- Labels +- Name +- Registry authentication +- Container settings +- Instance capacity +- Remote file system root +- Usage +- Idle timeout +- Connect method +- Stop timeout +- Remove volumes +- Pull strategy +- Pull timeout +- Node properties + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +agent { + docker { + image 'maven:3-alpine' + label 'my-defined-label' + args '-v /tmp:/tmp' + registryUrl 'https://myregistry.com/' + registryCredentialsId 'myPredefinedCredentialsInJenkins' + } +} +``` + +### Transformed Github Action + +```yaml +job: + container: + image: maven:3-alpine +``` + +### Unsupported Options + +- label +- args +- registryUrl +- registryCredentialsId diff --git a/docs/jenkins/DockerBuildPublish.md b/docs/jenkins/DockerBuildPublish.md new file mode 100644 index 00000000..859db0a3 --- /dev/null +++ b/docs/jenkins/DockerBuildPublish.md @@ -0,0 +1,51 @@ +# Docker Build and Publish + +## Designer pipeline + +### Jenkins input + +```xml + + + + https://index.docker.io/v1/ + + example/hello-world + false + false + . + false + true + v1.1 + false + true + false + https_proxy="http://some.proxy:port" + false + +``` + +### Transformed Github Action + +```yaml +- name: checkout + uses: actions/checkout@v2 +- name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" + logout: true + registry: index.docker.io +- name: Build Docker Image + run: docker build '.' https_proxy="http://some.proxy:port" -t index.docker.io/example/hello-world:v1.1 -t index.docker.io/example/hello-world:latest +- name: Push Docker Image + run: docker push index.docker.io/example/hello-world:v1.1 +- name: Push Docker Image + run: docker push index.docker.io/example/hello-world:latest +``` +### Unsupported Options + +- createFingerprint +- forceTag +- skipDecorate diff --git a/docs/jenkins/DockerBuildStep.md b/docs/jenkins/DockerBuildStep.md new file mode 100644 index 00000000..09c9f85c --- /dev/null +++ b/docs/jenkins/DockerBuildStep.md @@ -0,0 +1,433 @@ +# Docker Build Step + +## "Create/build image" Designer pipeline + +### Jenkins input + +```xml + + + $WORKSPACE/docker + project:$BUILD_NUMBER + Dockerfile + true + true + true + http_proxy=http://1.2.3.4:4321;foo=bar + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker build/create image + shell: bash + run: docker build --build-arg http_proxy=http://1.2.3.4:4321 --build-arg foo=bar --pull --no-cache --rm -t project:$BUILD_NUMBER -f $WORKSPACE/docker/Dockerfile +``` + +### Unsupported Options + +None + +## "Pull image" Designer pipeline + +### Jenkins input + +```xml + + + + redis + 6 + registry.hub.docker.com + + +``` + +### Transformed Github Action + +```yaml +- uses: docker/login-action@v2.1.0 + with: + registry: registry.hub.docker.com + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" +- name: Run docker pull image + run: docker pull registry.hub.docker.com/redis:6 +``` + +### Unsupported Options + +None + +## "Push image" Designer pipeline + +### Jenkins input + +```xml + + + + my/redis + latest + registry.hub.docker.com + + +``` + +### Transformed Github Action + +```yaml +- uses: docker/login-action@v2.1.0 + with: + registry: registry.hub.docker.com + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" +- name: Run docker push image + run: docker push registry.hub.docker.com/my/redis:latest +``` + +### Unsupported Options + +None + +## "Tag image" Designer pipeline + +### Jenkins input + +```xml + + + redis:6 + my/redis + latest + true + false + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker tag image + run: docker tag redis:6 my/redis:latest +``` + +### Unsupported Options + +- withForce + +## "Create container" Designer pipeline + +### Jenkins input + +```xml + + + ubuntu:latest + /bin/bash + my-host + sleepy-jenkins + foo=bar bar=baz + container1:anothercontainer, container2:some-db + 9000/tcp + 50 + 1024m + 8.8.8.8,1.1.1.1 + phonehome.example.com:127.0.0.1,myhost:127.0.01 + host + false + 80 8080 80:8080 10.0.47.11:80 8080/tcp 10.0.47.11:80:8080/udp + data /data rw /hostpath /containerpath ro + true + true + + +``` + +### Transformed Github Action + +```yaml + - name: Run docker create container + run: |- + docker create \ + --hostname my-host \ + --name sleepy-jenkins \ + --cpu-shares 50 \ + --memory-limit 1024m \ + --network host \ + --privileged \ + --always-restart \ + -e foo=bar \ + -e bar=baz \ + --link container1:anothercontainer \ + --link container2:some-db \ + --expose 9000/tcp \ + --dns 8.8.8.8 \ + --dns 1.1.1.1 \ + --add-host phonehome.example.com:127.0.0.1 \ + --add-host myhost:127.0.01 \ + -p 80:8080 \ + -p 80:8080 \ + -p 10.0.47.11:80:8080/tcp \ + -p 10.0.47.11:80:8080/udp \ + -v data:/data:rw \ + -v /hostpath:/containerpath:ro \ + ubuntu:latest \ + "/bin/bash" +``` + +### Unsupported Options + +None + +## "Save image" Designer pipeline + +### Jenkins input + +```xml + + busybox + latest + /tmp + busybox.tar + false + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker save image + run: docker save -o /tmp/busybox.tar busybox:latest +- uses: actions/upload-artifact@v2 + with: + path: "/tmp/busybox.tar" +``` + +### Unsupported Options + +None + +## "Commit container" Designer pipeline + +### Jenkins input + +```xml + + + a6757a514067 + registry:5000/repo + ubuntu:latest + ping -c 4 8.8.8.8 + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker commit + run: docker commit --change='CMD ping -c 4 8.8.8.8' a6757a514067 registry:5000/repo/ubuntu:latest +``` + +### Unsupported Options + +None + +## "Stop all containers" Designer pipeline + +### Jenkins input + +```xml + + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker stop all containers + shell: bash + run: docker stop $(docker ps -q) +``` + +### Unsupported Options + +None + +## "Stop container(s)" Designer pipeline + +### Jenkins input + +```xml + + + 6d4a94ec49b0 + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker stop containers by id + run: docker stop 6d4a94ec49b0 +``` + +### Unsupported Options + +None + +## "Stop container(s) by image ID" Designer pipeline + +### Jenkins input + +```xml + + + 2cfd4a4587bc + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker stop containers by image id + shell: bash + run: docker stop $(docker ps -q -f ancestor=2cfd4a4587bc) +``` + +### Unsupported Options + +None + +## "Kill container(s)" Designer pipeline + +### Jenkins input + +```xml + + + 6d4a94ec49b0 + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker kill containers by id + run: docker kill 6d4a94ec49b0 +``` + +### Unsupported Options + +None + +## "Restart container(s)" Designer pipeline + +### Jenkins input + +```xml + + 6d4a94ec49b0 + 0 + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker restart containers by id + run: docker restart 6d4a94ec49b0 +``` + +### Unsupported Options + +None + +## "Start container(s)" Designer pipeline + +### Jenkins input + +```xml + + + 6d4a94ec49b0 + + + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker start containers by id + run: docker start 6d4a94ec49b0 +``` + +### Unsupported Options + +- containerIdsLogging +- waitPorts + +## "Start container(s) by image ID" Designer pipeline + +### Jenkins input + +```xml + + + 5992a3bf97a3 + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker start containers by image id + shell: bash + run: docker start $(docker ps -q -f ancestor=5992a3bf97a3) +``` + +### Unsupported Options + +None + +## "Create and start exec instance in container(s)" Designer pipeline + +### Jenkins input + +```xml + + 6d4a94ec49b0,a6757a514067 + ping -c 4 8.8.8.8 + + +``` + +### Transformed Github Action + +```yaml +- name: Run docker exec create and start + run: |- + docker exec 6d4a94ec49b0 ping -c 4 8.8.8.8 + docker exec a6757a514067 ping -c 4 8.8.8.8 +``` + +### Unsupported Options + +None + +## Jenkinsfile pipeline + +This plugin is not mapped to a GitHub Actions equivalent for a Jenkinsfile pipeline. diff --git a/docs/jenkins/DoxygenBuilder.md b/docs/jenkins/DoxygenBuilder.md new file mode 100644 index 00000000..42a389a5 --- /dev/null +++ b/docs/jenkins/DoxygenBuilder.md @@ -0,0 +1,34 @@ +# Doxygen Builder + +## Designer pipeline + +### Jenkins input + +```xml + + "doxy-path/files/anotherfolder/one another" + + true + false + +``` + +### Transformed Github Action + +```yaml +name: "Doxygen" +uses: mattnotmitt/doxygen-action@v1.9.5 +with: + working-directory: 'submodule/' + doxyfile-path: 'docs/Doxygen' + enable-latex: true # Only if enable-latex is true +continue-on-error: true +``` + +### Unsupported Options + +- If warnings set the build to Unstable + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/Echo.md b/docs/jenkins/Echo.md new file mode 100644 index 00000000..c5ea078a --- /dev/null +++ b/docs/jenkins/Echo.md @@ -0,0 +1,28 @@ +# Echo + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + echo "this is an echo" + } +``` + +### Transformed Github Action + +```yaml +jobs: + job-name: + - name: echo message + run: echo "This is a message" +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/EnvInjectBuilder.md b/docs/jenkins/EnvInjectBuilder.md new file mode 100644 index 00000000..e6d91fed --- /dev/null +++ b/docs/jenkins/EnvInjectBuilder.md @@ -0,0 +1,252 @@ +# Environment Injector + +## Designer pipeline + +### Jenkins input for + +_EnvInjectBuilder_ +```xml + + + inject.properties + # this is a comment MY_USER=matz MY_HOME:/home/usr/matz + + +``` + +_EnvInjectBuildWrapper_ +```xml + + + envs.properties + ! This is a comment MY_NAME: matz IS_GITHUB=true + my_script + #!/usr/bin/python print("Doing something") print("very important") + + + false + + false + + +``` + +_EnvInjectJobProperty_ +```xml + + + my_prop.properties + MY_NAME:matz + my_script + echo "preparing the environment" + + + false + + false + + true + true + true + false + +``` + +### Transformed Github Action for + +_EnvInjectBuilder_ +```yaml +- name: create env properties file + shell: bash + run: |- + cat > ${{ github.run_id }}.properties <<'EOL' + # this is a comment + MY_USER=matz + MY_HOME:/home/usr/matz + EOL +- name: inject property file envs + uses: actions/github-script@v6.4.0 + env: + PROPERTIES_FILES: "${{ github.run_id }}.properties,inject.properties" + with: + script: |- + const fs = require("fs") + const files = process.env.PROPERTIES_FILES.split(",") + files.forEach(file => { + let envs = {} + fs.readFile(file, 'utf8', (err, data) => { + const lines = data + // joins multiline properties + .replace(/\\\n( )*/g, '') + .split('\n') + // removes comments and empty lines + .filter(line => line && !line.startsWith("#") && !line.startsWith("!")) + lines.forEach(line => { + match = line.match(/(?\w+)\s*?[=:]\s*?(?\S.+)/).groups + envs[match["key"]] = match["value"] + }) + for (let [key, value] of Object.entries(envs)) { + if (value.startsWith("$")) { + const env_name = value.substring(1) + if (env_name in process.env) { + value = process.env[env_name] + } else if (env_name in envs) { + value = envs[env_name] + } + } + core.exportVariable(key, value); + } + }) + }); +- name: clean up temp files + shell: bash + run: rm -f ${{ github.run_id }}.properties +``` + +_EnvInjectBuildWrapper_ +```yaml +- name: run groovy script + shell: groovy {0} + run: println "Groovy!!" +- name: create env properties file + shell: bash + run: |- + cat > ${{ github.run_id }}.properties <<'EOL' + ! This is a comment + MY_NAME: matz + IS_GITHUB=true + EOL +- name: inject property file envs + uses: actions/github-script@v6.4.0 + env: + PROPERTIES_FILES: "${{ github.run_id }}.properties,envs.properties" + with: + script: |- + const fs = require("fs") + const files = process.env.PROPERTIES_FILES.split(",") + files.forEach(file => { + let envs = {} + fs.readFile(file, 'utf8', (err, data) => { + const lines = data + // joins multiline properties + .replace(/\\\n( )*/g, '') + .split('\n') + // removes comments and empty lines + .filter(line => line && !line.startsWith("#") && !line.startsWith("!")) + lines.forEach(line => { + match = line.match(/(?\w+)\s*?[=:]\s*?(?\S.+)/).groups + envs[match["key"]] = match["value"] + }) + for (let [key, value] of Object.entries(envs)) { + if (value.startsWith("$")) { + const env_name = value.substring(1) + if (env_name in process.env) { + value = process.env[env_name] + } else if (env_name in envs) { + value = envs[env_name] + } + } + core.exportVariable(key, value); + } + }) + }); +- name: run script + shell: bash + run: |- + cat > ./${{ github.run_id }}_script <<'EOL' + #!/usr/bin/python + print("Doing something") + print("very important") + EOL + chmod +x ./${{ github.run_id }}_script + ./${{ github.run_id }}_script +- name: run script file + shell: bash + run: "./my_script" +- name: clean up temp files + shell: bash + run: |- + rm -f ${{ github.run_id }}.properties + rm -f ./${{ github.run_id }}_script +``` + +_EnvInjectJobProperty_ +```yaml +- name: run groovy script + shell: groovy {0} + run: println "Almost done" +- name: create env properties file + shell: bash + run: |- + cat > ${{ github.run_id }}.properties <<'EOL' + MY_NAME:matz + EOL +- name: inject property file envs + uses: actions/github-script@v6.4.0 + env: + PROPERTIES_FILES: "${{ github.run_id }}.properties,my_prop.properties" + with: + script: |- + const fs = require("fs") + const files = process.env.PROPERTIES_FILES.split(",") + files.forEach(file => { + let envs = {} + fs.readFile(file, 'utf8', (err, data) => { + const lines = data + // joins multiline properties + .replace(/\\\n( )*/g, '') + .split('\n') + // removes comments and empty lines + .filter(line => line && !line.startsWith("#") && !line.startsWith("!")) + lines.forEach(line => { + match = line.match(/(?\w+)\s*?[=:]\s*?(?\S.+)/).groups + envs[match["key"]] = match["value"] + }) + for (let [key, value] of Object.entries(envs)) { + if (value.startsWith("$")) { + const env_name = value.substring(1) + if (env_name in process.env) { + value = process.env[env_name] + } else if (env_name in envs) { + value = envs[env_name] + } + } + core.exportVariable(key, value); + } + }) + }); +- name: run script + shell: bash + run: |- + cat > ./${{ github.run_id }}_script <<'EOL' + echo "preparing the environment" + EOL + chmod +x ./${{ github.run_id }}_script + ./${{ github.run_id }}_script +- name: run script file + shell: bash + run: "./my_script" +- name: clean up temp files + shell: bash + run: |- + rm -f ${{ github.run_id }}.properties + rm -f ./${{ github.run_id }}_script +``` + +### Unsupported Options + +_EnvInjectBuilder_ +- None + +_EnvInjectBuildWrapper_ +- Additional classpath + +_EnvInjectJobProperty_ +- Keep Jenkins Environment Variables +- Keep Jenkins Build Variables +- Override Build Parameters +- Additional classpath +- Load script and properties files from the master + +## Jenkinsfile pipeline +This plugin is not supported in pipelines. \ No newline at end of file diff --git a/docs/jenkins/Example.md b/docs/jenkins/Example.md new file mode 100644 index 00000000..a5d7e82a --- /dev/null +++ b/docs/jenkins/Example.md @@ -0,0 +1,26 @@ +# EXAMPLE + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + echo "this is an echo" + } +``` + +### Transformed Github Action + +```yaml +- name: echo message + run: echo "This is a message" +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/FileOperations.md b/docs/jenkins/FileOperations.md new file mode 100644 index 00000000..3abdb2cc --- /dev/null +++ b/docs/jenkins/FileOperations.md @@ -0,0 +1,348 @@ +# File Operations + +## Designer pipeline + +### Jenkins input + +```xml + + + + + created.txt + testing=true name=foo num=1 + + + **/**.txt + **/**.js + ./new + true + false + + + + + new + test/more_new + + + foo/goo/zoo + + + foo/goo/zoo/test.txt + testing is fun... + + + **/old/** + **/keep/** + + + created.txt + foo/goo/zoo/test.txt + + + foo/goo/zoo/test.txt + foo/goo/zoo/test2.txt + + + foo/goo + foo/goo2 + + + test/more_new + + + + + mkdir -p playground touch playground/my_file.txt tar zcf playground.tar playground + + + + + + playground.tar + new + true + + + foo/goo2 + my_zip/dir1 + + + my_zip/dir1/goo2.zip + output + + + **/**.txt + + + + + +``` + +### Transformed Github Action + +```yaml +steps: +- name: checkout + uses: actions/checkout@v2 +- name: create file + shell: bash + run: |- + cat > created.txt <<'EOL' + testing=true + name=foo + num=1 + EOL +- name: copy files + uses: actions/github-script@v6.4.0 + env: + TARGET_LOCATION: "./new" + FILE_PATTERNS: "**/**.txt,!**/**.js" + FLATTEN: 'true' + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.TARGET_LOCATION) + const patterns = process.env.FILE_PATTERNS + const flatten = process.env.FLATTEN === 'true' + const globber = await glob.create(patterns.replace(/,/g, "\n")) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + const filename = flatten ? path.basename(file) : file.substring(process.cwd().length) + const dest = path.join(target, filename) + await io.mkdirP(path.dirname(dest)) + await io.cp(file, dest) + } +- name: copy folder + shell: bash + run: |- + mkdir -p test/more_new + cp -r new/* test/more_new +- name: create folder + shell: bash + run: mkdir -p foo/goo/zoo +- name: create file + shell: bash + run: |- + mkdir -p foo/goo/zoo + cat > foo/goo/zoo/test.txt <<'EOL' + testing is fun... + EOL +- name: delete files + uses: actions/github-script@v6.4.0 + env: + FILE_PATTERNS: "**/old/**,!**/keep/**" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const patterns = process.env.FILE_PATTERNS + const globber = await glob.create(patterns.replace(/,/g, "\n")) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await io.rmRF(file) + } +- name: join file + shell: bash + run: cat created.txt >> foo/goo/zoo/test.txt +- name: rename/move file + shell: bash + run: mv foo/goo/zoo/test.txt foo/goo/zoo/test2.txt +- name: rename/move folder + shell: bash + run: mv foo/goo foo/goo2 +- name: delete folder + shell: bash + run: rm -rf test/more_new +- name: run command + shell: bash + run: |- + mkdir -p playground + touch playground/my_file.txt + tar zcf playground.tar playground +- name: untar archive + shell: bash + run: |- + mkdir -p new + tar zxf playground.tar -C new +- name: zip folder + shell: bash + run: 7z a my_zip/dir1/goo2.zip ./foo/goo2/* +- name: unzip folder + shell: bash + run: unzip -d output my_zip/dir1/goo2.zip +# # 'sp.sd.fileoperations.FileTransformOperation' was not transformed because there is no suitable equivalent in GitHub Actions +``` + +### Unsupported Operations +- File Transform +- File Properties To Json + +### Unsupported Operations Options +- File Copy Operation + - renameFiles + - sourceCaptureExpression + - targetNameExpression + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + sh ''' + mkdir -p playground + touch playground/my_file.txt + tar cf playground.tar playground + ''' + fileOperations([ + fileCreateOperation(fileName: 'created.txt', fileContent: "Hello World!" ), + folderCreateOperation(folderPath: 'new'), + fileCopyOperation(excludes: '**/**.js', flattenFiles: false, includes: '**/*.txt', targetLocation: './new'), + folderCopyOperation(sourceFolderPath: "new", destinationFolderPath: "test/more_new"), + folderCreateOperation(folderPath: "foo/goo/zoo"), + fileCreateOperation(fileName: 'foo/goo/zoo/test.txt', fileContent: "testing is fun..." ), + folderCreateOperation(folderPath: "old"), + fileCreateOperation(fileName: 'old/created.txt', fileContent: "Hello World!" ), + fileDeleteOperation(includes: "**/old/**", excludes: "**/keep/**"), + fileRenameOperation(source: "foo/goo/zoo/test.txt", destination: "foo/goo/zoo/test2.txt"), + folderDeleteOperation(folderPath: 'test/more_new'), + folderRenameOperation(source: "foo/goo", destination: "foo/goo2"), + folderDeleteOperation(folderPath: 'test/more_new'), + fileUnTarOperation(filePath: 'playground.tar', targetLocation: "new" ), + fileZipOperation(folderPath: "foo/goo2", outputFolderPath: "my_zip/dir1" ), + fileUnZipOperation(filePath: "my_zip/dir1/goo2.zip", targetLocation: "output" ), + fileTransformOperation(includes: "", excludes: ""), + fileDownloadOperation( + url: "https://httpbin.org/image", + userName: "", + password: "", + targetLocation: ".", + targetFileName: "image.webp" + ) + ]) +} +``` + +### Transformed Github Action + +```yaml +steps: +- name: checkout + uses: actions/checkout@v2 +- name: sh + shell: bash + run: |- + mkdir -p playground + touch playground/my_file.txt + tar cf playground.tar playground +- name: create file + shell: bash + run: |- + cat > created.txt <<'EOL' + Hello World! + EOL +- name: create folder + shell: bash + run: mkdir -p new +- name: copy files + uses: actions/github-script@v6.4.0 + env: + TARGET_LOCATION: "./new" + FILE_PATTERNS: "**/*.txt,!**/**.js" + FLATTEN: false + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.TARGET_LOCATION) + const patterns = process.env.FILE_PATTERNS + const flatten = process.env.FLATTEN === 'true' + const globber = await glob.create(patterns.replace(/,/g, "\n")) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + const filename = flatten ? path.basename(file) : file.substring(process.cwd().length) + const dest = path.join(target, filename) + await io.mkdirP(path.dirname(dest)) + await io.cp(file, dest) + } +- name: copy folder + shell: bash + run: |- + mkdir -p test/more_new + cp -r new/* test/more_new +- name: create folder + shell: bash + run: mkdir -p foo/goo/zoo +- name: create file + shell: bash + run: |- + mkdir -p foo/goo/zoo + cat > foo/goo/zoo/test.txt <<'EOL' + testing is fun... + EOL +- name: create folder + shell: bash + run: mkdir -p old +- name: create file + shell: bash + run: |- + mkdir -p old + cat > old/created.txt <<'EOL' + Hello World! + EOL +- name: delete files + uses: actions/github-script@v6.4.0 + env: + FILE_PATTERNS: "**/old/**,!**/keep/**" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const patterns = process.env.FILE_PATTERNS + const globber = await glob.create(patterns.replace(/,/g, "\n")) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await io.rmRF(file) + } +- name: rename/move file + shell: bash + run: mv foo/goo/zoo/test.txt foo/goo/zoo/test2.txt +- name: delete folder + shell: bash + run: rm -rf test/more_new +- name: rename/move folder + shell: bash + run: mv foo/goo foo/goo2 +- name: delete folder + shell: bash + run: rm -rf test/more_new +- name: untar archive + shell: bash + run: |- + mkdir -p new + tar xf playground.tar -C new +- name: zip folder + shell: bash + run: 7z a my_zip/dir1/goo2.zip ./foo/goo2 +- name: unzip folder + shell: bash + run: unzip -d output my_zip/dir1/goo2.zip +# # 'fileTransformOperation' was not transformed because there is no suitable equivalent in GitHub Actions +- name: download file + shell: bash + run: curl https://httpbin.org/image --output ./image.webp +``` + +### Unsupported Operations +- fileTransformOperation +- filePropertiesToJsonOperation + +### Unsupported Operations Options +- fileCopyOperation + - renameFiles + - sourceCaptureExpression + - targetNameExpression \ No newline at end of file diff --git a/docs/jenkins/GHPullRequestTrigger.md b/docs/jenkins/GHPullRequestTrigger.md new file mode 100644 index 00000000..82047b8b --- /dev/null +++ b/docs/jenkins/GHPullRequestTrigger.md @@ -0,0 +1,85 @@ +# GitHub Pull Request Trigger + +## Designer pipeline + +### Jenkins input + +```xml + + H/5 * * * * + 3 + + false + + H/5 * * * * + + false + false + true + + false + false + + + /main + + + + + /bad + + + 0d0af9bb-ddec-4f5f-8428-1f02c4b119e7 + + .*\\[skip\\W+ci\\].* + + dont-trigger-this + + + + + + + + + + false + + + +``` + +### Transformed Github Action + +```yaml + pull_request: + branches: + - "/main" + - "!/bad" +``` + +### Unsupported Options +- Admin list +- Use github hooks for build triggering +- Allow members of whitelisted organizations as admins +- List of organizations. Their members will be whitelisted +- Crontab line +- Build description template +- Only use trigger phrase for build triggering +- Build every pull request automatically without asking (Dangerous!). +- White list +- Close failed pull request automatically? +- Display build errors on downstream builds? +- Trigger phrase +- Skip build phrase +- Blacklist commit authors +- List of GitHub labels for which the build should not be triggered. +- List of GitHub labels for which the build should only be triggered. (Leave blank for 'any') +- Cancel build on update +- Build status messages +- Comment file +- Update commit status during build + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/GHPushTrigger.md b/docs/jenkins/GHPushTrigger.md new file mode 100644 index 00000000..dda6f7cb --- /dev/null +++ b/docs/jenkins/GHPushTrigger.md @@ -0,0 +1,80 @@ +# GitHub Push Request Trigger + +## Designer pipeline + +### Jenkins input + +```xml + + 2 + + + https://github.com/github/jenkout-fake-repo/ + jenkout-bot + + + + + */main + + + */alt-branch + + + false + + + + +... + + + + + + + +``` + +### Transformed Github Action + +```yaml +on: + push: + branches: + - main + - alt-branch +``` + +### Unsupported Options + +- Lightweight checkout +- Repositories +- Repository browser +- Additional Behaviours (all) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +triggers { + githubPush() +} +``` + +### Transformed Github Action + +```yaml +on: + push: + branches: + - main +``` + +### Unsupported Options + +- Lightweight checkout +- Repositories +- Repository browser +- Additional Behaviours (all) diff --git a/docs/jenkins/Git.md b/docs/jenkins/Git.md new file mode 100644 index 00000000..7d9d3755 --- /dev/null +++ b/docs/jenkins/Git.md @@ -0,0 +1,29 @@ +# Git Builder + +## Designer pipeline + +This plugin is not mapped to a GitHub Actions equivalent for a Designer pipeline. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + git url:'https://github.com/jenkinsci/git-plugin' +} +``` + +### Transformed Github Action + +```yaml +name: checkout +uses: actions/checkout@v2 +``` + +### Unsupported Options + +* branch +* changelog +* credentialsId +* poll diff --git a/docs/jenkins/GitPublisher.md b/docs/jenkins/GitPublisher.md new file mode 100644 index 00000000..e95d9ce6 --- /dev/null +++ b/docs/jenkins/GitPublisher.md @@ -0,0 +1,70 @@ +# Designer pipeline + +## Jenkins input + +```xml + + + 2 + false + true + false + + + origin + 0.0.1 + This is a tag message. + true + false + + + + + origin + main + true + + + + + origin + I'm a note + master + false + + + origin + Here's another note. + master + true + + + + +``` + +## Transformed GitHub Action + +```yaml +- name: pushing git resources + shell: bash + run: |- + git fetch --tags + git tag -a -f -m "This is a tag message. " 0.0.1 + git push origin 0.0.1 + git push origin + git notes --ref=master append -m "I'm a note" + git push origin refs/notes/* + git notes --ref=master add -m "Here's another note." + git push origin refs/notes/* + if: success() +``` + +## Unsupported options + +- `pushMerge` +- `branchesToPush` + +## Jenkinsfile pipeline + +Jenkinsfile pipelines do not support the GitPublisher plugin. diff --git a/docs/jenkins/Gitlab.md b/docs/jenkins/Gitlab.md new file mode 100644 index 00000000..30de198b --- /dev/null +++ b/docs/jenkins/Gitlab.md @@ -0,0 +1,143 @@ +# GitLab + +## Designer pipeline + +### Jenkins input + +```xml + + + true + true + false + false + false + false + never + true + Jenkins please retry a build + true + true + true + NameBasedFilter + main, dev + + + + {AQAAABAAAAAQvxz/08QYKCD0/NqNcMbCyQSU+EG4gjPVLomKmvOzFyI=} + + false + + + + + +``` +### Transformed Github Action + +```yaml +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + - dev +jobs: + build: + runs-on: + - ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 +# # 'com.dabsquared.gitlabjenkins.publisher.GitLabAcceptMergeRequestPublisher' was not transformed because there is no suitable equivalent in GitHub Actions +``` + +### Unsupported Options +- Rebuild open Merge Requests +- Approved Merge Requests (EE-only) +- Comments +- Comment (regex) for triggering a build +- Enable ci-skip +- Ignore WIP Merge Requests +- Set build description to build cause (eg. Merge request or Git Push) +- Build on successful pipeline events +- Pending build name for pipeline +- Cancel pending merge request builds on update +- Filter branches by regex +- Filter merge request by label + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +pipeline { + agent any + post { + failure { + updateGitlabCommitStatus name: 'build', state: 'failed' + } + success { + updateGitlabCommitStatus name: 'build', state: 'success' + } + } + options { + gitLabConnection('your-gitlab-connection-name') + } + triggers { + gitlab( + triggerOnPush: true, + triggerOnMergeRequest: true, triggerOpenMergeRequestOnPush: "never", + triggerOnNoteRequest: false, + noteRegex: "Jenkins please retry a build", + skipWorkInProgressMergeRequest: true, + ciSkip: false, + setBuildDescription: true, + addNoteOnMergeRequest: true, + addCiMessage: true, + addVoteOnMergeRequest: true, + acceptMergeRequestOnSuccess: false, + branchFilterType: "All", + includeBranchesSpec: "release/qat", + excludeBranchesSpec: "", + pendingBuildName: "Jenkins", + cancelPendingBuildsOnUpdate: false, + secretToken: "abcdefghijklmnopqrstuvwxyz0123456789ABCDEF") + } + stages { + stage("build") { + steps { + echo "hello world" + } + } + } +} +``` + +### Transformed Github Action + +```yaml +on: + push: + pull_request: +jobs: + build: +``` + +### Unsupported Options +- triggerOnNoteRequest +- noteRegex +- skipWorkInProgressMergeRequest +- ciSkip +- setBuildDescription +- addNoteOnMergeRequest +- addCiMessage +- addVoteOnMergeRequest +- acceptMergeRequestOnSuccess +- cancelPendingBuildsOnUpdate +- gitlabBuilds +- acceptGitLabMR +- addGitLabMRComment \ No newline at end of file diff --git a/docs/jenkins/Gradle.md b/docs/jenkins/Gradle.md new file mode 100644 index 00000000..6827e543 --- /dev/null +++ b/docs/jenkins/Gradle.md @@ -0,0 +1,46 @@ +# Gradle + +## Designer pipeline + +### Jenkins input + +```xml + + --build-cache --console=plain + clean install + ${WORKSPACE}/something + something.build + (Default) + true + true + true + . + system=1 system2=1 + false + project=1 project2=1 xyz=${xyz} + false + +``` + +### Transformed Github Action + +```yaml +- name: checkout + uses: actions/checkout@v2 +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' + settings-path: "${{ env.{ github.workspace }}}" +- name: Run Gradle command + shell: bash + working_directory: "${{ github.workspace }}/something" + run: |- + export GRADLE_USER_HOME=${{ env.GITHUB_WORKSPACE }} + chmod +x ./gradlew + ./gradlew -Dsystem=1 -Dsystem2=1 -Pproject=1 -Pproject2=1 -Pxyz=${{ env.xyz }} --build-cache -- console=plain clean install -b something.build + +### Unsupported Options + +- passAllAsSystemProperties +- passAllAsProjectProperties diff --git a/docs/jenkins/HtmlPublisher.md b/docs/jenkins/HtmlPublisher.md new file mode 100644 index 00000000..0488a4fe --- /dev/null +++ b/docs/jenkins/HtmlPublisher.md @@ -0,0 +1,85 @@ +# HTML Publisher + +## Designer pipeline + +### Jenkins input + +```xml + + + + HTML Report + my/html/path + index.html + false + My Results + false + false + **/*.html,**/*.css + true + + + +``` + +### Transformed Github Action + +```yaml +name: Upload Artifacts +uses: actions/upload-artifact@v2 +with: + name: HTML Report + path: |- + my/html/path/**/*.html + my/html/path/**/*.css +``` + +### Unsupported Options + +- Index Pages +- Index page titles +- Keep past HTML reports +- Always link to last build +- Escape underscores in report title + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +stage('Example Deploy') { + steps { + publishHTML (target: [ + allowMissing: false, + alwaysLinkToLastBuild: false, + keepAll: true, + reportDir: 'my/html/path', + reportFiles: 'index.html', + reportName: "HTML Report", + includes: "**/*.html" + ]) + } +} +``` + +### Transformed Github Action + +```yaml +jobs: + Example-Deploy: + name: Example Deploy + steps: + name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: HTML Report + path: my/html/path/**/*.html +``` + +### Unsupported Options + +- Index Pages +- Index page titles +- Keep past HTML reports +- Always link to last build +- Escape underscores in report title diff --git a/docs/jenkins/HttpRequest.md b/docs/jenkins/HttpRequest.md new file mode 100644 index 00000000..ad77ef41 --- /dev/null +++ b/docs/jenkins/HttpRequest.md @@ -0,0 +1,100 @@ +# Http Request + +## Designer pipeline + +### Jenkins input + +```xml + + https://jenkout.westus2.cloudapp.azure.com/job/freestyle-goat/ + true + GET + + false + 100:399 + + NOT_SET + NOT_SET + + 0 + false + false + + + + + false + false + + +``` + +### Transformed Github Action + +```yaml +name: "http request" +uses: "CamiloGarciaLaRotta/watermelon-http-client@v1.6" +with: + method: "GET" + url: "https://jenkout.westus2.cloudapp.azure.com/job/freestyle-goat/" + data: "data" + headers: "{ 'Content-Type': 'application/json','Accept': 'text/plain','Authorization': 'bearer ${{ secrets.BOT_TOKEN }}' }" +env: + HTTPS_PROXY: my_proxy +``` + +### Unsupported Options + +- ignoreSslErrors +- passBuildParameters +- validResponseCodes (unless it is [200:300]) +- outputFile +- timeout +- consoleLogResponseBody +- quiet +- uploadFile +- multipartName +- wrapAsMultipart +- useSystemProperties + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +stage('Example Deploy') { + steps { + httpRequest('http://www.example.com') { + httpMode('POST') + } + } +} +``` + +### Transformed Github Action + +```yaml +jobs: + Example-Deploy: + name: Example Deploy + steps: + - uses: CamiloGarciaLaRotta/watermelon-http-client@v1.7 + with: + url: http://www.example.com + method: POST +``` + +### Unsupported Options + +- consoleLogResponseBody +- ignoreSslErrors +- multipartName +- outputFile +- quiet +- responseHandle +- timeout +- uploadFile +- useSystemProperties +- validResponseCodes +- validResponseContent +- wrapAsMultipart diff --git a/docs/jenkins/Input.md b/docs/jenkins/Input.md new file mode 100644 index 00000000..788cb211 --- /dev/null +++ b/docs/jenkins/Input.md @@ -0,0 +1,32 @@ +# Input + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + input message: 'What should we do?', ok: 'Ok', parameters: [choice(choices: ['Deploy', 'Build', 'Test'], description: 'Pick what to do', name: 'TO_DO')] +} +``` + +### Transformed Github Action + +```yaml +jobs: + ci: + environment: + name: approval_required + runs-on: ubuntu-latest +``` + +### Unsupported Options + +- parameters +- message +- id +- ok diff --git a/docs/jenkins/JUnit.md b/docs/jenkins/JUnit.md new file mode 100644 index 00000000..5d7b323a --- /dev/null +++ b/docs/jenkins/JUnit.md @@ -0,0 +1,55 @@ +# JUnit + +## Designer pipeline + +### Jenkins input + +```xml + + test-results/**/*.xml + true + 1.0 + true + +``` + +### Transformed Github Action + +```yaml +- name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2.4.1 + if: always() + with: + files: test-results/**/*.xml +``` + +### Unsupported Options + +- healthScaleFactor +- keepLongStdio +- allowEmptyResults +- AggregatedTestResultPublisher + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + junit 'test-results.xml' + } +``` + +### Transformed Github Action + +```yaml +- name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2.4.1 + if: always() + with: + files: test-results.xml +``` + +### Unsupported Options + +- skipPublishingChecks diff --git a/docs/jenkins/JsLint.md b/docs/jenkins/JsLint.md new file mode 100644 index 00000000..3d30020c --- /dev/null +++ b/docs/jenkins/JsLint.md @@ -0,0 +1,32 @@ +# JsLint Builder + +## Designer pipeline + +### Jenkins input + +```xml + + **/*.js + library.js + + -Dpredef=foo,bar,baz + +``` + +### Transformed Github Action + +```yaml +- name: Install jslint + run: npm install -g jslint +- name: Run jslint + run: jslint **/*.js -Dpredef=foo,bar,baz +``` + +### Unsupported Options + +- Exclude pattern +- Log file + +## Jenkinsfile pipeline + +- This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/MSBuildBuilder.md b/docs/jenkins/MSBuildBuilder.md new file mode 100644 index 00000000..b3a2f6ff --- /dev/null +++ b/docs/jenkins/MSBuildBuilder.md @@ -0,0 +1,37 @@ +# MsBuild Builder + +## Designer pipeline + +### Jenkins input + +```xml + + (Default) + AwesomeSauce.csproj + p:Configuration=PRODUCTION + false + false + false + false + +``` + +### Transformed Github Action + +```yaml +- name: Install msbuild + uses: microsoft/setup-msbuild +- name: Run msbuild + shell: cmd + run: msbuild AwesomeSauce.csproj p:Configuration=PRODUCTION +``` + +### Unsupported Options + +- Pass build variables as properties +- If warnings set the build to Unstable +- Do not use chcp command + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/MSBuildSQRunnerBegin.md b/docs/jenkins/MSBuildSQRunnerBegin.md new file mode 100644 index 00000000..579ab71e --- /dev/null +++ b/docs/jenkins/MSBuildSQRunnerBegin.md @@ -0,0 +1,59 @@ +# MSBuild SQ Runner Begin + +## Designer pipeline + +### Jenkins input + +```xml + + event calendar-conference-service + Event Calendar Conference Service STAGING + 2.15 + /d:sonar.verbose="true" /d:sonar.cs.opencover.reportsPaths='"/path/to/coverage.xml","/path/to/coverage.2.xml"' /d:sonar.coverage.exclusions='"**/*.cs","**/*.md"' + +``` + +### Transformed Github Action + +```yaml +jobs: + build: + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Install SonarCloud scanner + if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' + shell: pwsh + run: |- + New-Item -Path ./.sonar/scanner -ItemType Directory + dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + - name: Begin SonarCloud Scan + shell: pwsh + env: + SONAR_TOKEN: "${{ secrets.SONAR_SONARQUBE_DEV_TEST_COM_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: |- + .\.sonar\scanner\dotnet-sonarscanner begin /k:"test_key"/` + /n:'Important Service STAGING'/` + /v:'2.15'/` + /d:sonar.login=${{ env.SONAR_TOKEN }}/` + /d:sonar.verbose="true"/` + /d:sonar.cs.opencover.reportsPaths='"/path/to/coverage.xml","/path/to/coverage.2.xml"'/` + /d:sonar.coverage.exclusions='"**/*.cs","**/*.md"' + - name: End SonarCloud Scan + shell: pwsh + env: + SONAR_TOKEN: "${{ secrets.SONAR_SONARQUBE_DEV_TEST_COM_TOKEN }}" + run: "./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login=${{ env.SONAR_TOKEN }}" +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/MSBuildSQRunnerEnd.md b/docs/jenkins/MSBuildSQRunnerEnd.md new file mode 100644 index 00000000..b8ee5e6e --- /dev/null +++ b/docs/jenkins/MSBuildSQRunnerEnd.md @@ -0,0 +1,54 @@ +# MSBuild SQ Runner End + +## Designer pipeline + +### Jenkins input + +```xml + +``` + +### Transformed Github Action + +```yaml +jobs: + build: + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Install SonarCloud scanner + if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' + shell: pwsh + run: |- + New-Item -Path ./.sonar/scanner -ItemType Directory + dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + - name: Begin SonarCloud Scan + shell: pwsh + env: + SONAR_TOKEN: "${{ secrets.SONAR_SONARQUBE_DEV_TEST_COM_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: |- + .\.sonar\scanner\dotnet-sonarscanner begin /k:"test_key"/ + /n:'Important Service STAGING'/ + /v:'2.15'/ + /d:sonar.login=${{ env.SONAR_TOKEN }}/ + /d:sonar.verbose="true"/ + /d:sonar.cs.opencover.reportsPaths='"/path/to/coverage.xml","/path/to/coverage.2.xml"'/ + /d:sonar.coverage.exclusions='"**/*.cs","**/*.md"' + - name: End SonarCloud Scan + shell: pwsh + env: + SONAR_TOKEN: "${{ secrets.SONAR_SONARQUBE_DEV_TEST_COM_TOKEN }}" + run: "./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login=${{ env.SONAR_TOKEN }}" +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/Maven.md b/docs/jenkins/Maven.md new file mode 100644 index 00000000..0a423292 --- /dev/null +++ b/docs/jenkins/Maven.md @@ -0,0 +1,91 @@ +# Maven + +## Designer pipeline + +### Jenkins input + +```xml + + my_goal + -X5020=true + pom.xml + # this is a property +property1=value + true + + + true + +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' + settings-path: "${{ github.workspace }}" +- name: Run maven + env: + MAVEN_OPTS: "=X5020=true" + run: mvn -f pom.xml -Dproperty1=value my_goal +``` + +### Unsupported Options + +- Inject build variable +- Use private Maven repository +- Global Settings (only supports `Global settings file on filesystem`) +- Settings File (Only supports `Settings in filesystem`) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy + +steps { +// Option 1: tools section not needed + withMaven( + maven: 'maven-3', + mavenLocalRepo: '.repository', + mavenSettingsConfig: 'my-maven-settings' + ) { + + sh "mvn -DskipTests clean site install" + // bat "mvn -DskipTests clean site install" + } +// Alternate Option: parameters not needed +withMaven { + sh "mvn -DskipTests clean site install" + // bat "mvn -DskipTests clean site install" + } +} + +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' + settings-path: "${{ github.workspace }}" +- name: Run maven + run: mvn clean verify +``` + +### Unsupported Options + +- mavenSettingsConfig +- mavenLocalRepo +- tempBinDir +- JDK +- mavenOpts +- globalMavenSettingsConfig +- globalMavenSettingsFilePath +- maven +- mavenSettingsConfig +- mavenSettingsFilePath diff --git a/docs/jenkins/MsTestBuilder.md b/docs/jenkins/MsTestBuilder.md new file mode 100644 index 00000000..739820fb --- /dev/null +++ b/docs/jenkins/MsTestBuilder.md @@ -0,0 +1,33 @@ +# MSTest Builder + +## Jenkins input + +```xml + + (Default) + \testcontainer\n\\otherTestPath\n"path with a\\white space" + Priority1&SpeedTest + Result-File-Name-Field + /nologo /noisolation + true + +``` + +### Transformed Github Action + +```yaml +- name: Install msbuild + uses: microsoft/setup-msbuild@v1.3.1 +- name: run mstest + shell: cmd + continue-on-error: true #optional + run: msbuild /resultsfile: /testcontainer: /category: +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/NUnit.md b/docs/jenkins/NUnit.md new file mode 100644 index 00000000..90815ebe --- /dev/null +++ b/docs/jenkins/NUnit.md @@ -0,0 +1,43 @@ +# NUnit + +## Designer pipeline + +### Jenkins input + +```xml + + TestResults.xml + false + false + false + 1.0 + false + false + +``` + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy + steps { + nunit testResultsPattern: 'TestResult.xml' + } +``` +### Transformed Github Action + +```yaml +- name: Publish NUnit test results + uses: EnricoMi/publish-unit-test-result-action@v2.4.1 + if: always() + with: + files: TestResult.xml +``` +### Unsupported Options + +- failIfNoResults +- healthScaleFactor +- debug +- keepJUnitReports +- skipJUnitArchiver diff --git a/docs/jenkins/NantBuilder.md b/docs/jenkins/NantBuilder.md new file mode 100644 index 00000000..82556729 --- /dev/null +++ b/docs/jenkins/NantBuilder.md @@ -0,0 +1,30 @@ +# Nant Builder + +## Designer pipeline + +### Jenkins input + +```xml + + build + path\to\config.xml.build + (Default) + property1=value1 property2=value2 + +``` + +### Transformed Github Action + +```yaml +name: Run NAnt +shell: cmd +run: NAnt -D:property1=value1 -D:property2=value2 -buildfile:path\to\config.xml.build build +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/Node.md b/docs/jenkins/Node.md new file mode 100644 index 00000000..cbb0489b --- /dev/null +++ b/docs/jenkins/Node.md @@ -0,0 +1,29 @@ +# Node + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +agent { + node { + label 'my-defined-label' + customWorkspace '/some/other/path' + } +} +``` + +### Transformed Github Action + +```yaml +run: + working-directory: "/some/other/path" +``` + +### Unsupported Options + +- label diff --git a/docs/jenkins/NodeJSBuildWrapper.md b/docs/jenkins/NodeJSBuildWrapper.md new file mode 100644 index 00000000..a7592e0c --- /dev/null +++ b/docs/jenkins/NodeJSBuildWrapper.md @@ -0,0 +1,26 @@ +# Node JS Build Wrapper + +## Designer pipeline + +### Jenkins input + +```xml + + + node + + + +``` + +### Transformed Github Action + +None. A manual task will be surfaced to ensure `NodeJs` is available on the runner. + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not mapped to a GitHub Actions equivalent for a Jenkinsfile pipeline. diff --git a/docs/jenkins/NodeJsCommandInterpreter.md b/docs/jenkins/NodeJsCommandInterpreter.md new file mode 100644 index 00000000..22b2ba69 --- /dev/null +++ b/docs/jenkins/NodeJsCommandInterpreter.md @@ -0,0 +1,62 @@ +# NodeJsCommandInterpreter + +## Designer pipeline + +### Jenkins input + +```xml + + + +false + + + + + + + +true +false +false +false + +false + + +function hello(){ console.log("Hello") } hello() + +node + + + + + + +node + + + + +``` + +### Transformed Github Action + +```yaml + uses: actions/setup-node@v2 + - name: Run Node Command + shell: node {0} + run: | + function hello(){ + console.log("Hello") + } + hello() +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. \ No newline at end of file diff --git a/docs/jenkins/ParameterDefinitionsProperty.md b/docs/jenkins/ParameterDefinitionsProperty.md new file mode 100644 index 00000000..d2a878e4 --- /dev/null +++ b/docs/jenkins/ParameterDefinitionsProperty.md @@ -0,0 +1,199 @@ +# Parameter Definitions Property + +## Designer pipeline + +### Jenkins input + +```xml + + + WORST_GAME_OF_THRONES_CHARACTER + + jorah.mormont + false + + + sha1 + "The git ref (branch, tag, commit) to build" + develop + false + + + + + false + + + + + + + + + + {AQAAABAAAAAQK7zHOsUkJq5e8bQo3PFrjNmprZXh2MVtOiAWNPRptwk=} + + false + + + + + + + + + + + + + + + com.cloudbees.plugins.credentials.common.StandardCredentials + false + + + + + false + false + 5 + , + + + + + + + + + c21432c5-9ff3-406b-884a-83ae0d8a6825 + PT_TAG + + * + .* + NONE + + NONE + false + 5 + + + + + + + + + + + + false + false + + + + + + false + + + + + {AQAAABAAAAAQ0HyV0HXfAOQgA6btGfX3/a8iIJiNqQH9kiY7xVotwTU=} + + + + + + ALL + + + + + + false + + + Version 1 + This is the first version + NodeJS + + + +``` + +### Transformed Github Action + +```yaml +on: + workflow_dispatch: + inputs: + WORST_GAME_OF_THRONES_CHARACTER: + required: false + default: jorah.mormont +``` + +### Unsupported Options + +- Boolean Parameter +- Build Selector for Copy Artifact +- CVS Symbolic Name Parameter +- Choice Parameter +- Credentials Parameter +- Extended Choice Parameter +- File Parameter +- Git Parameter +- Jira Issue Parameter +- Jira Version Parameter +- Multi-line String Parameter +- Password Parameter +- Run Parameter +- String Parameter +- Tool Version + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +parameters { + string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?') + + text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person') + + booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value') + + choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something') + + password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password') +} +``` + +### Transformed Github Action + +```yaml +on: + workflow_dispatch: + inputs: + PERSON: + required: false + description: Who should I say hello to? + default: Mr Jenkins +``` + +### Unsupported Options + +- Boolean Parameter +- Build Selector for Copy Artifact +- CVS Symbolic Name Parameter +- Choice Parameter +- Credentials Parameter +- Extended Choice Parameter +- File Parameter +- Git Parameter +- Jira Issue Parameter +- Jira Version Parameter +- Multi-line String Parameter +- Password Parameter +- Run Parameter +- Tool Version diff --git a/docs/jenkins/ParameterizedTriggerBuilder.md b/docs/jenkins/ParameterizedTriggerBuilder.md new file mode 100644 index 00000000..f881c874 --- /dev/null +++ b/docs/jenkins/ParameterizedTriggerBuilder.md @@ -0,0 +1,169 @@ +# Parameterized Trigger + +## Designer pipeline + +### Jenkins input + +```xml + + + + + + + + arg1 + true + + + arg2 + false + + + + + + + some/path to/file.txt, and/another.txt + false + false + false + false + + + false + + + label=="${TARGET}" + + + KEY1=true KEY2=hi + false + + + false + + + freestyle-hedgehog + ALWAYS + false + false + + + FAILURE + 2 + RED + true + + + UNSTABLE + 1 + YELLOW + true + + + FAILURE + 2 + RED + true + + + false + + + + + + + SKIP + + + + SKIP + + + + + 1 + + FAIL + + + +``` + +### Transformed Github Action + +```yaml +name: Trigger workflow +uses: octokit/request-action@v2.x +with: + route: POST /repos/:repository/actions/workflows/:workflow_id/dispatches + repository: "${{ github.repository }}" + workflow_id: freestyle-hedgehog.yml + ref: "${{ github.ref }}" + inputs: |- + arg1: "true" + arg2: "false" + KEY1: "true" + KEY2: "hi" +env: + GITHUB_TOKEN: "${{ secrets.WORKFLOW_TRIGGER_TOKEN }}" +``` + +### Unsupported Options + +- Block until the triggered projects finish their builds (when `true`) + +Parameters: + +- Build on the same node +- Current Build Parameters +- Parameters from properties files +- Pass-through Git Commit that was built +- Restrict matrix execution to a subset +- Subversion revision + +Parameter Factories + +- For every matching file, invoke one build +- For every property fie, invoke one build +- Invoke i=0..N builds + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + build job: 'freestyle-hedgehog', + parameters: [ + booleanParam(name: 'arg1', value: true), + string(name: 'arg2', value: "hi") + ], + propagate: false, + quietPeriod: 1 +} +``` + +### Transformed Github Action + +```yaml +name: Trigger workflow +uses: octokit/request-action@v2.x +with: + route: POST /repos/:repository/actions/workflows/:workflow_id/dispatches + repository: "${{ github.repository }}" + workflow_id: freestyle-hedgehog.yml + ref: "${{ github.ref }}" +env: + GITHUB_TOKEN: "${{ secrets.WORKFLOW_TRIGGER_TOKEN }}" +``` + +### Unsupported Options + +- wait +- propagate +- quietPeriod +- parameters + diff --git a/docs/jenkins/Post.md b/docs/jenkins/Post.md new file mode 100644 index 00000000..0dbb3ae3 --- /dev/null +++ b/docs/jenkins/Post.md @@ -0,0 +1,119 @@ +# Post build actions + +## Designer pipeline + +This plugin is implemented as `Post Build Actions` + +## Jenkinsfile pipeline + +### Jenkins input + +#### Stages + +```groovy +stage ('build') { + steps { + .... + } + + post { + cleanup { + echo "cleanup is executed last" + } + aborted { + echo "aborted" + } + always { + echo "always" + } + unstable { + powershell "write-host aborted" + } + failure { + bat "echo failure" + } + unsuccessful { + sh "echo unsuccessful" + } + } +} + +#### Pipeline + +```groovy +pipeline { + stages { + stage ('build') { + ... + } + } + post { + always { + echo 'I will always run' + } + } +} +``` + +### Transformed Github Action + +#### Stages + +If `post` is inside a stage the content inside conditional blocks will be appended to the stage steps with appropriate conditions. + +```yaml +jobs: + build: + steps: + ... + - name: snapshot post build job status + run: echo "::set-output name=aborted=${{ job.status == 'cancelled' }}" + id: __post_build + - name: powershell + shell: powershell + run: write-host aborted + if: steps.__post_build.outputs.aborted == 'true' + .... + - name: echo message + run: echo always + if: always() + - name: echo message + run: echo cleanup is executed last + if: always() +``` + +#### Pipelines + +If `post` is inside a pipeline then a `Post-Build` job is added (if a pipeline agent is defined it will be respected) and the steps will be executed on that job. + +This job will always be executed regardless of the status of the workflow. A failure of a post step may make the worfklow to fail. + +```yaml +jobs: + build: + steps: + ... + Post-Build: + if: always() + needs: + - build + steps: + - name: snapshot post build workflow status + run: |- + echo "::set-output name=aborted=${{ contains(needs.*.result,'cancelled') }}" + id: __post_build + - name: echo message + run: echo I will run if worfklow was aborted + if: steps.__post_build.outputs.aborted == 'true' + - name: echo message + run: echo I will always run + if: always() +``` + +### Unsupported Options + +- Conditions: + - notBuilt + - regression + - fixed + - changed diff --git a/docs/jenkins/PostBuildScript.md b/docs/jenkins/PostBuildScript.md new file mode 100644 index 00000000..3eacc0e1 --- /dev/null +++ b/docs/jenkins/PostBuildScript.md @@ -0,0 +1,169 @@ +# Post Build Script + +## Designer pipeline + +### Jenkins input + +```xml + + + + # Create generic script + cat > my_script << 'EOL' + #!/usr/bin/python + print("** Running my script on failure..") + EOL + chmod +x my_script + # Create groovy script + cat > my_groovy.groovy << 'EOL' + println "** Running my groovy script on success!" + EOL + + + + + + + + + + + FAILURE + + BOTH + ./my_script + GENERIC + false + + + + SUCCESS + + BOTH + my_groovy.groovy + GROOVY + false + + + + + + SUCCESS + + BOTH + println "** This is my added groovy script" println "which runs on success!" + false + + + + + + SUCCESS + + BOTH + + + print("** Running python script in post build step!") + + + + console.log("Nooodddeee!") + + node + + + + false + + + + ABORTED + + BOTH + + + echo "I am a shell build step that runs on cancel!!" + + + + false + + + + NOT_BUILT + + BOTH + + + echo "I don't run because 'NOT _BUILT' is not supported" + + + + false + + + false + + + + +``` + +### Transformed Github Action + +```yaml + - name: run command + shell: bash + run: |- + # Create generic script + cat > my_script << 'EOL' + #!/usr/bin/python + print("** Running my script on failure..") + EOL + chmod +x my_script + # Create groovey script + cat > my_groovy.groovy << 'EOL' + println "** Running my groovy script on success!" + EOL + - name: run script file + shell: bash + run: "./my_script" + if: "${{ failure() }}" + - name: run script file + shell: bash + run: groovy ./my_groovy.groovy + if: "${{ success() }}" + - name: run groovy script + shell: groovy {0} + run: |- + println "** This is my added groovy script" + println "which runs on success!" + if: "${{ success() }}" + - name: run command + shell: python + run: print("** Running python script in post build step!") + if: "${{ success() }}" + - uses: actions/setup-node@v2 + if: "${{ success() }}" + - name: Run Node Command + shell: node {0} + run: console.log("Nooodddeee!") + if: "${{ success() }}" + - name: run command + shell: bash + run: echo "I am a shell build step that runs on cancel!!" + if: "${{ cancelled() }}" +# # org.jenkinsci.plugins.postbuildscript.model.PostBuildStep was not transformed because there is no suitable equivalent for a job status of 'NOT_BUILT' in GitHub Actions +# - name: run command +# shell: bash +# run: echo "I don't run because 'NOT _BUILT' is not supported" +# if: NOT_BUILT +``` + +### Unsupported Options + +- Execution is limited to +- Stop processing, if any build step fails + +## Jenkinsfile pipeline +This plugin is not supported in Designer pipelines. \ No newline at end of file diff --git a/docs/jenkins/PostBuildTask.md b/docs/jenkins/PostBuildTask.md new file mode 100644 index 00000000..597aca90 --- /dev/null +++ b/docs/jenkins/PostBuildTask.md @@ -0,0 +1,45 @@ +# Post Build Task + +## Designer pipeline + +### Jenkins input + +```xml + + + + + + IOException + AND + + + BUILD FAILED + AND + + + false + true + + + + +``` + +### Transformed Github Action + +```yaml +name: Post Build Task +shell: bash +run: script.sh +if: always() +``` + +### Unsupported Options + +- logText +- EscalateStatus + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/Powershell.md b/docs/jenkins/Powershell.md new file mode 100644 index 00000000..f0a78ad7 --- /dev/null +++ b/docs/jenkins/Powershell.md @@ -0,0 +1,76 @@ +# Powershell + +## Designer pipeline + +### Jenkins input + +```xml + + Set-Content -Path "C:\temp\$($env:Filename).txt" -Value $env:Message + + true + true + +``` + +### Transformed Github Action + +```yaml +name: "powershell", +run: "Set-Content -Path \"C:\\temp\\$($env:Filename).txt\" -Value $env:Message", +shell: "powershell" +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + powershell(script:"echo 'param world'", label:"test-label", returnStdout: false) + powershell 'echo "Hello World"' + powershell ''' + echo "Multiline shell steps works too" + Remove-Item 'pyFolder' -Recurse + mkdir pyFolder + ls + $items = @('one','two','three') + foreach ($item in $items) + { + echo $item + } + ''' +} +``` + +### Transformed Github Action + +```yaml +# Single/Inline +name: powershell +shell: powershell +run: echo "Hello World" + +# Multi-line +name: powershell +shell: powershell +run: |2 + +echo "Multiline shell steps works too" +Remove-Item 'pyFolder' -Recurse +mkdir pyFolder +ls +$items = @('one','two','three') +foreach ($item in $items) +{ + echo $item +} +``` + +### Unsupported Options + +- returnStatus diff --git a/docs/jenkins/PreBuildCleanup.md b/docs/jenkins/PreBuildCleanup.md new file mode 100644 index 00000000..e89656a7 --- /dev/null +++ b/docs/jenkins/PreBuildCleanup.md @@ -0,0 +1,59 @@ +# PreBuild Cleanup + +## Designer pipeline + +### Jenkins input + +```xml + + + + + **/*.rb + INCLUDE + + + **/*.ts + EXCLUDE + + + true + + + false + + +``` + +### Transformed Github Action + +```yaml +name: clean workspace +shell: bash +run: rm -rf ${{ github.workspace }}/* +``` + +```yaml +name: clean workspace +shell: ruby {0} +run: |- + require "fileutils" + Dir.chdir(ENV["GITHUB_WORKSPACE"]) do + paths = Dir.glob(["**/*.rb"]) + paths -= Dir.glob(["**/*.ts"]) + paths.each do |path| + File.delete(path) if File.file?(path) + FileUtils.rm_rf(path) if File.directory?(path) + end + end +``` + +### Unsupported Options + +- Check parameter (cleanupParameter) +- External Deletion Command (externalDelete) +- Disable deferred wipeout (disableDeferredWipeout) + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. \ No newline at end of file diff --git a/docs/jenkins/PublishOverCIFS.md b/docs/jenkins/PublishOverCIFS.md new file mode 100644 index 00000000..e12a1ac2 --- /dev/null +++ b/docs/jenkins/PublishOverCIFS.md @@ -0,0 +1,117 @@ +# Publish Over CIFS + +## Designer pipeline + +### Jenkins input + +#### Builder +```xml + + + CIFS: + + + + jd + false + + + + **/*.txt + **/test/** + + false + false + false + true + false + [, ]+ + + + false + false + + + false + false + false + + + false + + +``` + +#### Publisher (Post Build) +```xml + + CIFS: + + + + jd + false + + + foo + **/*.txt + + + false + false + false + true + false + [, ]+ + + + false + false + + + false + false + false + + + false + +``` + +### Transformed Github Action for Builder + +```yaml +- name: transfer files over CIFS + run: |- + sudo mkdir -p /mnt/cifs_share + sudo mount -t cifs -o username=${{ env.JD_USER }},password=${{ secrets.JD_PASSWORD }} //${{ env.JD_HOST }}/${{ env.JD_SHARE_DIR }} /mnt/cifs_share + sudo rsync -a --prune-empty-dirs --exclude='**/test/**' --include='**/*.txt' --include='*/' --exclude='*' ./ /mnt/cifs_share/ + sudo umount /mnt/cifs_share + env: + JD_SHARE_DIR: UPDATE_ME + JD_HOST: UPDATE_ME + JD_USER: UPDATE_ME +``` + +### Transformed Github Action for Publisher + +```yaml +- name: transfer files over CIFS + run: |- + sudo mkdir -p /mnt/cifs_share + sudo mount -t cifs -o username=${{ env.JD_USER }},password=${{ secrets.JD_PASSWORD }} //${{ env.JD_HOST }}/${{ env.JD_SHARE_DIR }} /mnt/cifs_share + sudo mkdir -p /mnt/cifs_share/foo + sudo rsync -a --prune-empty-dirs --include='**/*.txt' --include='*/' --exclude='*' ./ /mnt/cifs_share/foo + sudo umount /mnt/cifs_share + env: + JD_SHARE_DIR: UPDATE_ME + JD_HOST: UPDATE_ME + JD_USER: UPDATE_ME + if: always() +``` + +### Unsupported Options +- Pattern separator +- Flatten files +- Remote directory is a date format +- Clean remote diff --git a/docs/jenkins/PublishOverFTP.md b/docs/jenkins/PublishOverFTP.md new file mode 100644 index 00000000..90afe185 --- /dev/null +++ b/docs/jenkins/PublishOverFTP.md @@ -0,0 +1,136 @@ +# Publish Over FTP + +## Designer pipeline + +### Jenkins input + +#### Builder +```xml + + + FTP: + + + + FTP_Server + false + + + new + **/**.txt + + + false + false + false + true + false + [, ]+ + false + + + false + false + + + false + false + false + + + + +``` + +#### Publisher (Post Build) +```xml + + FTP: + + + + FTP_Server + false + + + + **/**.txt + **/**.json + + false + false + false + false + false + [, ]+ + false + + + false + false + + + false + false + false + + + +``` + +### Transformed Github Action + +```yaml +steps: + - name: setup ftp transfer file + uses: actions/github-script@v6.4.0 + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const patterns = "**/**.txt" + const globber = await glob.create(patterns.replace(",", "\n")) + const files = [] + const dirs = [] + const ignore_dirs = ['./', '.\\'] + const isAsciiMode = "true" + for await (let file of globber.globGenerator()) { + file = path.relative(process.cwd(), file) + if ((await fs.lstat(file)).isDirectory()) continue + path.dirname(file).split(path.sep).reduce((prevPath, folder) => { + const currentPath = path.join(prevPath, folder, path.sep); + if (!ignore_dirs.includes(currentPath)) { + dirs.push("mkdir " + currentPath); + } + return currentPath; + }, ''); + files.push("put " + file) + } + uniq_dirs = [...new Set(dirs)]; + uniq_dirs.sort((a, b) => { + return a.length - b.length; + }); + var ftp_commands = [ + "open ${{ secrets.FTP_SERVER_HOST }} ${{ env.FTP_PORT }}", + "user ${{ secrets.FTP_SERVER_USER }} ${{ secrets.FTP_SERVER_PASSWORD }}", + "mkdir new", + "cd new" + ] + if (isAsciiMode === "false") { + ftp_commands.push("binary") + } + ftp_commands = ftp_commands.concat(uniq_dirs.concat(files)) + fs.writeFile("FTP_SERVER_transfer.txt", ftp_commands.join("\n"), (err) => { }) + env: + FTP_PORT: 21 + - name: run file transfers + run: ftp -pvn < FTP_SERVER_transfer.txt && rm FTP_SERVER_transfer.txt +``` + +### Unsupported Options +- Remove prefix +- Pattern separator +- Make empty dirs +- Flatten files +- Remote directory is a date format +- Clean remote diff --git a/docs/jenkins/PublishOverSSH.md b/docs/jenkins/PublishOverSSH.md new file mode 100644 index 00000000..a6ab4b05 --- /dev/null +++ b/docs/jenkins/PublishOverSSH.md @@ -0,0 +1,144 @@ +# Publish Over SSH + +## Designer pipeline + +### Jenkins input + +#### Builder +```xml + + + SSH: + + + + Server1 + true + + + goo/foo + *.txt,new/test/*.json + + + true + false + false + true + false + [, ]+ + echo "Hi from Jenkins $(date)" > remote_server.txt + + 120000 + false + false + false + + + false + false + + + false + false + false + + + + +``` + +#### Publisher (Post Build) +```xml + + SSH: + + + + Server1 + false + + + goo/foo + *.txt,new/test/*.json + + + false + false + false + true + false + [, ]+ + echo "Hi from Jenkins $(date)" > remote_server.txt echo "Hello Again!" + + 120000 + false + false + false + + + false + false + + + false + false + false + + + +``` +### Transformed Github Action + +```yaml + steps: + - name: checkout + uses: actions/checkout@v2 + # Ensure parameter if_key_exists is set correctly + - name: Install SSH key + uses: shimataro/ssh-key-action@v2.5.0 + with: + key: "${{ secrets.SERVER1_SSH_KEY }}" + name: id_rsa-server1 + known_hosts: "${{ secrets.SERVER1_KNOWN_HOSTS }}" + if_key_exists: fail + config: | + Host SERVER1 + HostName ${{ secrets.SERVER1_HOST_NAME }} + User ${{ secrets.SERVER1_USER }} + IdentityFile ~/.ssh/id_rsa-server1 + - name: setup file tranfer file + uses: actions/github-script@v6.4.0 + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const patterns = "*.txt,new/test/*.json" + const globber = await glob.create(patterns.replace(",", "\n")) + const files = [] + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + files.push(path.relative(process.cwd(), file)) + } + fs.writeFile("server1-transfer.txt", files.join("\n"), (err) => {}) + - name: run file transfers + run: |- + ssh SERVER1 'mkdir -p goo/foo' + tar -cvf server1-transfer.tar --files-from server1-transfer.txt + scp server1-transfer.tar SERVER1: + ssh SERVER1 'tar -xvf server1-transfer.tar -C goo/foo && rm server1-transfer.tar' + - name: run commands over ssh + run: ssh SERVER1 'echo "Hi from Jenkins $(date)" > remote_server.txt' + + +``` +### Unsupported Options + +- Remove prefix +- Pattern separator +- Make empty dirs +- Flatten files +- Clean remote +- Remote directory is a date format +- Exec in pty +- Exec using Agent Forwarding +- Exec timeout (ms) \ No newline at end of file diff --git a/docs/jenkins/Python.md b/docs/jenkins/Python.md new file mode 100644 index 00000000..fdd244ac --- /dev/null +++ b/docs/jenkins/Python.md @@ -0,0 +1,33 @@ +# Python + +## Designer pipeline + +### Jenkins input + +```xml + + # Script to join two strings\nstring1 = "GitHub " string2 = "Valet"\njoined_string = string1 + string2 print(joined_string) + + +``` + +### Transformed Github Action + +```yaml +name: run command +shell: python +run: |- + # Script to join two strings + string1 = "GitHub " + string2 = "Valet" + joined_string = string1 + string2 + print(joined_string) +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/ReverseBuildTrigger.md b/docs/jenkins/ReverseBuildTrigger.md new file mode 100644 index 00000000..b3b50050 --- /dev/null +++ b/docs/jenkins/ReverseBuildTrigger.md @@ -0,0 +1,40 @@ +# Reverse Build Trigger + +## Designer pipeline + +Visible on the UI as `Build after other projects are built` + +### Jenkins input + +```xml + + + freestyle leopard, freestyle-aardvark + + SUCCESS + 0 + BLUE + true + + +``` + +### Transformed Github Action + +```yaml +on: + workflow_run: + workflows: + - freestyle leopard + - freestyle-aardvark + types: + - completed +``` + +### Unsupported Options + +- threshold (when `Trigger even if the build is unstable`) + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/S3.md b/docs/jenkins/S3.md new file mode 100644 index 00000000..0a4e4a10 --- /dev/null +++ b/docs/jenkins/S3.md @@ -0,0 +1,57 @@ +# S3 Publisher + +## Designer pipeline + +### Jenkins input + +```xml + +rabi-valet/${JOB_NAME}-${BUILD_NUMBER} +**/* + +STANDARD +us-east-1 +false +false +false +false +false +false +false +false + +``` + +### Transformed Github Action + +```yaml + steps: + - name: checkout + uses: actions/checkout@v2 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" + AWS_REGION: us-east-1 + - id: upload_artifacts_to_s3_bucket + run: aws s3 cp **/* s3://bucket-name/${{ github.JOB_NAME }}/${{ github.BUILD_NUMBER }} --recursive + if: true + +``` + +### Unsupported Options + +- noUploadOnFailure +- managedArtifacts +- useServerSideEncryption +- uploadFromSlave +- managedArtifacts +- flatten +- gzipFiles +- keepForever +- showDirectlyInBrowser + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. \ No newline at end of file diff --git a/docs/jenkins/SCMTrigger.md b/docs/jenkins/SCMTrigger.md new file mode 100644 index 00000000..7569a252 --- /dev/null +++ b/docs/jenkins/SCMTrigger.md @@ -0,0 +1,44 @@ +# SCM Trigger + +## Designer pipeline + +### Jenkins input + +```xml + + H/15 * * * * + false + +``` + +### Transformed Github Action + +```yaml +on: + schedule: + - cron: "*/15 * * * *" +``` + +### Unsupported Options + +- None + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +triggers { pollSCM 'H */4 * * 1-5' } +``` + +### Transformed Github Action + +```yaml +on: + schedule: + - cron: 4 */4 * * 1-5 +``` + +### Unsupported Options + +- TimeZone diff --git a/docs/jenkins/SCPPublish.md b/docs/jenkins/SCPPublish.md new file mode 100644 index 00000000..01c5a414 --- /dev/null +++ b/docs/jenkins/SCPPublish.md @@ -0,0 +1,61 @@ +# SCP Publish + +## Designer pipeline + +### Jenkins input + +```xml + + + 127.0.0.1 + + + /results + **/**.txt + false + + + + +``` + +### Transformed Github Action + +```yaml + name: Install SSH key + uses: shimataro/ssh-key-action@v2.5.0 + with: + key: "${{ secrets.SCP_127_0_0_1_SSH_KEY }}" + name: id_rsa-SCP_127_0_0_1 + known_hosts: "${{ secrets.SCP_127_0_0_1_KNOWN_HOSTS }}" + if_key_exists: fail + config: | + Host 127.0.0.1 + HostName 127.0.0.1 + User ${{ secrets.SCP_127_0_0_1_USER }} + IdentityFile ~/.ssh/id_rsa-SCP_127_0_0_1 + name: setup file transfer file + uses: actions/github-script@v6.4.0 + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const patterns = "**/**.txt" + const globber = await glob.create(patterns.replace(",", "\n")) + const files = [] + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + files.push(path.relative(process.cwd(), file)) + } + fs.writeFile("scp_transfer.txt", files.join("\n"), (err) => {}) + name: run file transfers + run: |- + ssh 127.0.0.1 'mkdir -p /results' + tar -cvf scp_transfer.tar --files-from scp_transfer.txt + scp scp_transfer.tar 127.0.0.1: + ssh 127.0.0.1 'tar -xvf scp_transfer.tar -C /results && rm scp_transfer.tar' +``` +### Unsupported Options + +- Keeps Hierarchy (currrently always keeps folder structure) + diff --git a/docs/jenkins/SecretBuildWrapper.md b/docs/jenkins/SecretBuildWrapper.md new file mode 100644 index 00000000..c5f12c90 --- /dev/null +++ b/docs/jenkins/SecretBuildWrapper.md @@ -0,0 +1,103 @@ +# SecretBuildWrapper + +## Designer pipeline + +### Jenkins input + +```xml + + + + + TEST_KEYSTORE + TEST_PASS + TEST_ALIAS + + + + DOCKER_CERT_PATH + + + + KUBECONFIG_CONTENT + + + + KUBECONFIG + + + + AZURE_SUBSCRIPTION_ID + AZURE_CLIENT_ID + AZURE_CLIENT_SECRET + AZURE_TENANT_ID + + + + AZURE_STORAGE_ACCOUNT_NAME + AZURE_STORAGE_ACCOUNT_KEY + AZURE_BLOB_ENDPOINT_URL + + + + TEST_KEY + TEST_USERNAME + TEST_PARAPHRASE + + + ec6e2a8e-709a-4c29-b1fe-ec008ea27da0 + TEST_ZIP_FILE + + + ec6e2a8e-709a-4c29-b1fe-ec008ea27da0 + TEST_FILE + + + + TEST_TEXT + + + 6aae0c55-addb-47f0-a8ee-2b78985db2aa + TEST_USERNAME_PASSWORD + + + + +``` + +### Transformed Github Action + +```yaml +env: + TEST_TEXT: "${TEST_PARAM}" +``` + +### Unsupported Options + +- Certificate +- SSH User private Key +- Zecret ZIP File +- Secret File +- Username and password (conjoined) +- Username and password (separated) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +environment { + color = "blue" +} +``` + +### Transformed Github Action + +```yaml +env: + color: blue +``` + +### Unsupported Options + +- Groovy expressions diff --git a/docs/jenkins/Shell.md b/docs/jenkins/Shell.md new file mode 100644 index 00000000..0cb81828 --- /dev/null +++ b/docs/jenkins/Shell.md @@ -0,0 +1,49 @@ +# Shell Builder + +## Designer pipeline + +### Jenkins input + +```xml + + echo "hello world" + + +``` + +### Transformed Github Action + +```yaml +name: run command +shell: bash +run: echo "hello world" +``` + +### Unsupported Options + +The following options are not supported: + +- Exit code to set build unstable +- Environment filters + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + sh 'echo "hello world"' +} +``` + +### Transformed Github Action + +```yaml +name: run command +shell: bash +run: echo "hello world" +``` + +### Unsupported Options + +- None \ No newline at end of file diff --git a/docs/jenkins/SingleConditionalBuilder.md b/docs/jenkins/SingleConditionalBuilder.md new file mode 100644 index 00000000..23354c17 --- /dev/null +++ b/docs/jenkins/SingleConditionalBuilder.md @@ -0,0 +1,54 @@ +# Single Conditional Builder + +## Designer pipeline + +### Jenkins input + +```xml + + + + echo "hello world" + + + RETAIN + true + RESET + + + 23 + + + +``` + +### Transformed Github Action + +```yaml +name: run command +shell: bash +run: "echo "hello, world!" +if: always() +``` + +### Unsupported Options + +The following run conditions are not supported: + +- File exists +- Files match +- Numerical comparison +- Regular expression match +- Time +- Day of week +- Build cause +- Execution node +- Legacy boolean condition (deprecated) + +The following options are not supported + +- On evaluation failure + +## Jenkinsile pipleines + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/Slack.md b/docs/jenkins/Slack.md new file mode 100644 index 00000000..2a426d9b --- /dev/null +++ b/docs/jenkins/Slack.md @@ -0,0 +1,90 @@ +# Slack Notification + +## Designer pipeline + +```xml + + https://myinstance.com + + + + false + #channel + + :shipit: + jenkins-integration + true + true + true + + + + true + false + false + false + + + true + artifacts/ + + true + Default Custom Message + Custom Success Message + Custom Cancelled Message + + + Custom Failure Message + +``` + +### Partially Supported Options +The following options are only supported if you use the deprecated [Incoming Webhooks](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks) Slack App instead of the recommended approach of enabling webhooks in a custom Slack App. + +- room +- iconEmoji +- username + +### Unsupported Options + +- teamDomain +- authToken +- tokenCredentialId +- notifyNotBuilt +- notifyUnstable +- notifyRegression +- includeTestSummary +- includeFailedTests +- commitInfoChoice +- customMessageNotBuilt +- customMessageUnstable + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy + slackSend channel: '#general', + color: COLOR_MAP[currentBuild.currentResult], + message: "Hello World!!" +``` + +### Transformed Github Action + +```yaml +- name: Slack Notification + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: "${{ secrets.SLACK_WEBHOOK }}" + SLACK_CHANNEL: "#general" + SLACK_MESSAGE: Hello World!! + +### Unsupported Options + +- SLACK_MSG_AUTHOR +- SLACK_ICON +- SLACK_ICON_EMOJI +- SLACK_COLOR +- SLACK_TITLE +- SLACK_FOOTER +- MSG_MINIMAL diff --git a/docs/jenkins/SonarRunnerBuilder.md b/docs/jenkins/SonarRunnerBuilder.md new file mode 100644 index 00000000..35cb8c20 --- /dev/null +++ b/docs/jenkins/SonarRunnerBuilder.md @@ -0,0 +1,41 @@ +# Sonar Runner Builder + +## Designer pipeline + +### Jenkins input + +```xml + + nil + "sonar.projectKey=\nsonar.projectName=happykoalas\nsonar.projectVersion=1.0\nsonar.sources=src\n" + nil + "-X" + (Inherit From Job) + "sonar-devdept" + test + +``` + +### Transformed Github Action + +```yaml +name: SonarCloud Scan +uses: sonarsource/sonarcloud-github-action@v1.8 +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUDTOKEN }} +with: + projectBaseDir: ${{ github.workspace }} + args: +``` + +### Unsupported Options + +- JVM Options +- JDK +- SonarQube Scanner (transformed into a secret to be configured and manual task is added to the PR) +- Task to run + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/Ssh.md b/docs/jenkins/Ssh.md new file mode 100644 index 00000000..039bd9af --- /dev/null +++ b/docs/jenkins/Ssh.md @@ -0,0 +1,46 @@ +# SSH + +## Designer pipeline + +### Jenkins input + +```xml + + + user@127.0.0.1:22 + echo "before build script" + echo "after build script" + true + + +``` + +### Transformed Github Action + +```yaml +steps: +# Ensure parameter if_key_exists is set correctly +- name: Install SSH key + uses: shimataro/ssh-key-action@v2.5.0 + with: + key: "${{ secrets.127_0_0_1_SSH_KEY }}" + name: id_rsa + known_hosts: "${{ secrets.127_0_0_1_KNOWN_HOSTS }}" + if_key_exists: fail +- name: checkout + uses: actions/checkout@v2 +- name: run script over ssh + run: |- + ssh -T user@127.0.0.1 -p 22 <<'EOL' + echo "before build script" + EOL +- name: run script over ssh + run: |- + ssh -T user@127.0.0.1 -p 22 <<'EOL' + echo "after build script" + EOL +``` + +### Unsupported Options + +- Hide command from console output \ No newline at end of file diff --git a/docs/jenkins/Stash.md b/docs/jenkins/Stash.md new file mode 100644 index 00000000..4696cd26 --- /dev/null +++ b/docs/jenkins/Stash.md @@ -0,0 +1,38 @@ +# Stash + +## Designer pipeline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + stash name:'Perimeter', includes: 'path/output/bin/, path/output/test-results', excludes:'path/**/*.tmp' +} +``` + +### Transformed Github Action + +```yaml +name: stash +uses: actions/upload-artifact@v2 +with: + name: Perimeter + path: | + path/output/bin/ + path/output/test-results + !path/**/*.tmp + if-no-files-found: "fail" +``` + +### Unsupported Options + +- None + +### Notes + +By default Jenkins pipeline will fail if the path to stash is empty Unless `allowEmpty` is set to `true`, while Actions will just throw a warning. +To preserve this behavior, if `allowEmpty` is not added to the Jenkinsfile, we add `if-no-files-found: "fail"` to the Actions workflow diff --git a/docs/jenkins/TeamPrPushTrigger.md b/docs/jenkins/TeamPrPushTrigger.md new file mode 100644 index 00000000..dc43d006 --- /dev/null +++ b/docs/jenkins/TeamPrPushTrigger.md @@ -0,0 +1,29 @@ +# Team PR Push Trigger + +## Designer pipeline + +### Jenkins input + +```xml + + + Jenkins PR build + */master + +``` + +### Transformed Github Action + +```yaml +pull_request: + branches: + - master +``` + +### Unsupported Options + +- Job Context + +## Jenkinsfile pipeline + +This plugin is not supported in Jenkinsfile pipelines. diff --git a/docs/jenkins/TeamPushTrigger.md b/docs/jenkins/TeamPushTrigger.md new file mode 100644 index 00000000..1e47a37a --- /dev/null +++ b/docs/jenkins/TeamPushTrigger.md @@ -0,0 +1,51 @@ +# Team Push Trigger (Azure DevOps) + +## Designer pipeline + +### Jenkins input + +```xml + + 2 + + + https://{VSTS account}.visualstudio.com/DefaultCollection/_git/{team project} + jenkout-bot + + + + + */main + + + false + + + + +... + + + + + Jenkins build + + + var1 = envvar1 +var2 = envvar2 + false + false + false + + inline + provider "azurerm" { +subscription_id = "ABC" +client_id = "123" +client_secret = "secret0123" +tenant_id = "tenant123" +} + +variable "location" { default = "US West" } + +resource "azurerm_resource_group" "test" { +name = "HelloWorld" +location = "${var.location}" +} + INLINE + + Terraform01 + +``` + +### Transformed Github Action + +```yaml +- uses: hashicorp/setup-terraform@v1 + with: + terraform_version: "${{env.TERRAFORM_VERSION}}" +- name: emit terraform inline script + working_directory: "./" + shell: bash + run: |- + cat >$RUNNER_TEMP/terraform.tf <<'EOL' + provider "azurerm" { + subscription_id = "ABC" + client_id = "123" + client_secret = "secret0123" + tenant_id = "tenant123" + } + variable "location" { default = "US West" } + resource "azurerm_resource_group" "test" { + name = "HelloWorld" + location = "${var.location}" + } + EOL +- name: emit terraform variables + working_directory: "./" + shell: bash + run: |- + cat >$RUNNER_TEMP/variables.tfvars <<'EOL' + var1 = envvar1 + var2 = envvar2 + EOL +- name: execute terraform commands + working_directory: "./" + run: |- + terraform init + terraform apply -var-file=variables.tfvars +``` + +### Unsupported Options + +- None + +### Notes + +GitHub action performs as a build wrapper for the subsequent workflow steps. The transformation requires setting up the environmental variable to specify the Terraform version used by the workflow. diff --git a/docs/jenkins/ThrottleConcurrent.md b/docs/jenkins/ThrottleConcurrent.md new file mode 100644 index 00000000..d23bae09 --- /dev/null +++ b/docs/jenkins/ThrottleConcurrent.md @@ -0,0 +1,77 @@ +# Throttle Concurrent Builds + +## Designer pipeline + +### Jenkins input + +```xml + + 1 + 2 + + cat1 + + true + project + false + + +``` + +### Transformed Github Action + +```yaml +concurrency: + # Note: 'concurrency' may not be supported on GitHub Server instances + group: "${{ github.workflow }}" +``` + +### Unsupported Options + +The following options are not supported: + +- Maximum Total Concurrent Builds +- Maximum Concurrent Builds Per Node +- Prevent multiple jobs with identical parameters from running concurrently + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +pipeline { + agent any + + options { + throttleJobProperty( + categories: ['cat1', 'cat2'], + throttleEnabled: true, + throttleOption: 'category' + ) + } + + stages { + stage('sleep') { + steps { + sh "sleep 100" + echo "Done" + } + } + } +} +``` + +### Transformed Github Action + +```yaml +concurrency: + # Note: 'concurrency' may not be supported on GitHub Server instances + group: cat1-cat2 +``` + +### Unsupported Options + +The following options are not supported: +- maxConcurrentTotal +- maxConcurrentPerNode + diff --git a/docs/jenkins/Timeout.md b/docs/jenkins/Timeout.md new file mode 100644 index 00000000..b8e607a4 --- /dev/null +++ b/docs/jenkins/Timeout.md @@ -0,0 +1,44 @@ +# Timeout + +## Designer pipleline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +options { + timeout(time: 1, unit: 'HOURS') +} +``` + +### Transformed Github Action + +```yaml +job: + timeout-minutes: 60 +``` + +### Jenkins input + +```groovy +steps { + timeout(time: 3, unit: 'MINUTES') { + echo 'Hello World!' + } +} +``` + +### Transformed Github Action + +```yaml +- name: echo message + run: echo Hello World! + timeout-minutes: 3 +``` + +### Unsupported Options + +`timeout` is not supported when set at the pipeline level of a Jenkinsfile diff --git a/docs/jenkins/TimerTrigger.md b/docs/jenkins/TimerTrigger.md new file mode 100644 index 00000000..6779b699 --- /dev/null +++ b/docs/jenkins/TimerTrigger.md @@ -0,0 +1,47 @@ +# Timer Trigger + +## Designer pipeline + +### Jenkins input + +```xml + + + H 13 * * * + + +``` + +### Transformed Github Action + +```yaml +on: + schedule: + - cron: 3 13 * * * +``` + +### Unsupported Options + +- TimeZone + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +triggers { + cron('H */4 * * 1-5') +} +``` + +### Transformed Github Action + +```yaml +on: + schedule: + - cron: 4 */4 * * 1-5 +``` + +### Unsupported Options + +- TimeZone diff --git a/docs/jenkins/Unstash.md b/docs/jenkins/Unstash.md new file mode 100644 index 00000000..bc3e3e6f --- /dev/null +++ b/docs/jenkins/Unstash.md @@ -0,0 +1,28 @@ +# Unstash + +## Designer pipleline + +This plugin is not supported in Designer pipelines. + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + unstash name:'MyStashedFiles' +} +``` + +### Transformed Github Action + +```yaml +name: unstash +uses: actions/download-artifact@v2 +with: + name: MyStashedFiles +``` + +### Unsupported Options + +- None diff --git a/docs/jenkins/VirtualEnvBuilder.md b/docs/jenkins/VirtualEnvBuilder.md new file mode 100644 index 00000000..d4c58061 --- /dev/null +++ b/docs/jenkins/VirtualEnvBuilder.md @@ -0,0 +1,84 @@ +# Virtual Env Builder + +## Designer pipeline + +### Jenkins input + +```xml + + DemoVersion + + false + false + shell + python setup.py install + false + +``` + +### Transformed Github Action + +```yaml +- name: set up python + uses: actions/setup-python@v2 + with: + python-version: DemoVersion +- name: run python script + shell: bash + run: python setup.py install +``` + +### Unsupported Options +- home +- clear +- systemSitePackages + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy + stage('build') { + steps { + virtualenv { + clear(true) + command("python setup.py install") + ignoreExitCode(true) + name("Demo environment") + nature("shell") + pythonName("python3") + systemSitePackages(true) + } + } + } +``` + +```groovy + stage('build') { + steps { + withPythonEnv('python3') { + sh 'python setup.py install' + } + } + } +``` + +### Transformed Github Action + +```yaml +- name: set up python + uses: actions/setup-python@v2 + with: + python-version: DemoVersion +- name: run python script + shell: bash + run: python setup.py install + +``` + +### Virtualenv Unsupported Options +- systemSitePackages +- clear + +### WithPythonEnv Unsupported Options +- None diff --git a/docs/jenkins/WorkspaceCleanup.md b/docs/jenkins/WorkspaceCleanup.md new file mode 100644 index 00000000..249a6322 --- /dev/null +++ b/docs/jenkins/WorkspaceCleanup.md @@ -0,0 +1,137 @@ +# Workspace Cleanup + +## Designer pipeline + +### Jenkins input + +```xml + + + + true + false + true + false + false + false + false + true + false + + false + + +``` + +```xml + + + + + exclude/pattern/ + EXCLUDE + + + include/pattern + INCLUDE + + + true + false + true + false + true + false + true + true + false + + false + + +``` + +### Transformed Github Action + +```yaml +- name: clean workspace + shell: bash + run: rm -rf ${{ github.workspace }} + continue-on-error: true + if: success() +``` + +```yaml +- name: clean workspace + shell: ruby {0} + run: |- + require "fileutils" + Dir.chdir(ENV["GITHUB_WORKSPACE"]) do + paths = Dir.glob(["include/pattern"]) + paths -= Dir.glob(["exclude/pattern/"]) + paths.each do |path| + File.delete(path) if File.file?(path) + FileUtils.rm_rf(path) if File.directory?(path) # if deleteDirs == true + end + end + continue-on-error: true + if: always() +``` + +### Unsupported Options + +- External deletion command (externalDelete) +- Disable deferred wipeout (disableDeferredWipeout) +- Clean when not build (cleanWhenNotBuilt) +- Cleanup matrix parent (cleanupMatrixParent) +- Skip when failed (skipWhenFailed) + +## Jenkinsfile pipeline + +### Jenkins input + +```groovy +steps { + cleanWs { // Clean after build + cleanWhenAborted(true) + cleanWhenFailure(true) + cleanWhenNotBuilt(false) + cleanWhenSuccess(true) + cleanWhenUnstable(true) + deleteDirs(true) + notFailBuild(true) + disableDeferredWipeout(false) + patterns { + pattern { + type('EXCLUDE') + pattern('.propsfile') + } + pattern { + type('INCLUDE') + pattern('.gitignore') + } + } + } +} +``` + +### Transformed Github Action + +```yaml +name: clean workspace +shell: ruby {0} +run: |- + require "fileutils" + Dir.chdir(ENV["GITHUB_WORKSPACE"]) do + paths = Dir.glob([".gitignore"]) + paths -= Dir.glob([".propsfile"]) + paths.each do |path| + File.delete(path) if File.file?(path) + FileUtils.rm_rf(path) if File.directory?(path) + end + end +``` + +### Unsupported Options + +- disableDeferredWipeout diff --git a/docs/jenkins/Xcode.md b/docs/jenkins/Xcode.md new file mode 100644 index 00000000..ebeea16f --- /dev/null +++ b/docs/jenkins/Xcode.md @@ -0,0 +1,501 @@ +# Xcode + +## Designer pipeline + +### Jenkins inputs +#### Xcode +```xml + + + false + false + Release + + + + + + + + ios-action-test + + tech_version + mark_version + true + development + true + false + + false + + + {AQAAABAAAAAQd8SEznPb3jmuLxdb31GBvs/Vz9hwpOehxdJu8czPbgg=} + team_gh + + false + my_ipa + results + false + false + + + false + automatic + + + pro_bundle_ID + pro_UUID + + + true + true + true + + app url here + image url here + full size url here + asset url + false + true + true + false + + false + + +``` + +#### Export IPA + +```xml + + + false + + + {AQAAABAAAAAQoqXOCjipOxFD6M+De6oJ9H8AHkhLXmC73mpoiPLLFEA=} + + test_schema + ${WORKSPACE} + + 1234 + myapp + artifacts + development + automatic + + + + + + + true + true + true + + true + + + + + + true + true + +``` + +#### Import Developer Profile + +```xml + + false + + + {AQAAABAAAAAQh3hpE2USsA3h3fuz/r6l3R803rx5m25Elf7tupXKI7Q=} + +``` + +#### Unlock macOS X Keychain + +```xml + + ios_keychain + + {AQAAABAAAAAQW/seUVsJtOqgX9xuwNHYJlQr+J0y60VcddZ8zMkvh/8=} + +``` +### Transformed Github Actions + +#### Xcode + +```yaml +name: xcode +on: + workflow_dispatch: +jobs: + build: + runs-on: + - macos-latest + steps: + - name: checkout + uses: actions/checkout@v2 + # If using a self-hosted runner, ensure the runner’s keychain is cleaned up at the end of the build + - name: Install the Apple certificate and provisioning profile + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + run: | + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles + - name: Xcode Build/Archive + run: "/usr/bin/xcodebuild -alltargets -scheme ios-action-test -configuration Release archive -archivePath ./build/Release-iphoneos/ios-action-test.xcarchive DEVELOPMENT_TEAM=${{ env.DEVELOPMENT_TEAM_ID }}" + env: + DEVELOPMENT_TEAM_ID: UPDATE_ME + - name: Xcode Pack, Build, and Sign .ipa + run: "/usr/bin/xcodebuild -exportArchive -archivePath ./build/Release-iphoneos/ios-action-test.xcarchive -exportPath ./build/Release-iphoneos/results -exportOptionsPlist ${{ env.ExportOptionsPlistPath }}" + env: + ExportOptionsPlistPath: UPDATE_ME + +``` + + +#### Export IPA + +```yaml +# If using a self-hosted runner, ensure the runner’s keychain is cleaned up at the end of the build +- name: Install the Apple certificate and provisioning profile + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + run: | + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles +- name: Xcode Pack, Build, and Sign .ipa + run: "/usr/bin/xcodebuild -exportArchive -archivePath ./test_schema.xcarchive -exportPath ./artifacts -exportOptionsPlist ${{ env.ExportOptionsPlistPath }}" + env: + ExportOptionsPlistPath: UPDATE_ME +``` + +#### Import Developer Profile + +```yaml +# If using a self-hosted runner, ensure the runner’s keychain is cleaned up at the end of the build +- name: Install the Apple certificate and provisioning profile + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + run: | + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles +``` + +#### Unlock macOS X Keychain + +```yaml +- name: Unlock Keychain + run: security unlock-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} $KEYCHAIN_PATH + env: + KEYCHAIN_PATH: UPDATE_ME +``` + +### Unsupported + +The following options are not supported: +- logfileOutputDirectory +- allowFailingBuildResults +- ipaName +- interpretTargetAsRegEx +- useLegacyBuildSystem +- cleanResultBundlePath +- noConsoleLog + +The following options are assumed to be set in plist file located at ExportOptionsPlistPath +- ipaExportMethod +- provisioningProfiles +- uploadBitcode +- uploadSymbols +- compileBitcode +- thinning +- appURL +- displayImageURL +- fullSizeImageURL +- assetPackManifestURL +- skipBuildStep +- stripSwiftSymbols +- copyProvisioningProfile + + +## Jenkinsfile pipeline + +### Jenkins input + +#### xcodeBuild +```groovy +steps { + xcodeBuild appURL: '', + assetPackManifestURL: '', + buildDir: '', + buildIpa: true, + bundleID: 'new_bundle_id', + bundleIDInfoPlistPath: './ios-action-test/Info.plist', + changeBundleID: false, + cfBundleShortVersionStringValue: 'mark_ver1', + cfBundleVersionValue: 'ver2', + provideApplicationVersion: true, + cleanBeforeBuild: false, + cleanResultBundlePath: false, + configuration: 'Release', + developmentTeamID: '123', + developmentTeamName: '', + displayImageURL: '', + fullSizeImageURL: '', + generateArchive: true, + ipaExportMethod: 'developement', + ipaName: '', + ipaOutputDirectory: 'output', + keychainId: '', + keychainPath: '', + logfileOutputDirectory: '', + provisioningProfiles: [[provisioningProfileAppId: '', provisioningProfileUUID: '']], + resultBundlePath: '', + sdk: '', + symRoot: '', + target: '', + thinning: '', + xcodeProjectFile: '', + xcodeProjectPath: '', + xcodeSchema: 'ios-action-test', + xcodeWorkspaceFile: '', + xcodebuildArguments: '' + } +``` +#### exportIpa +```groovy +step { + exportIpa appURL: '', + archiveDir: '${WORKSPACE}', + assetPackManifestURL: '', + compileBitcode: true, + developmentTeamID: '123', + developmentTeamName: '', + displayImageURL: '', + fullSizeImageURL: '', + ipaExportMethod: 'development', + ipaName: 'test_pattern', + ipaOutputDirectory: 'output', + keychainName: '', + keychainPath: '', + manualSigning: false, + packResourcesAsset: true, + provisioningProfiles: [[provisioningProfileAppId: '', provisioningProfileUUID: '']], + resourcesAssetURL: '', + thinning: '', + unlockKeychain: false, + uploadBitcode: true, + uploadSymbols: true, + xcodeProjectPath: '', + xcodeSchema: 'ios-action-test', + xcodeWorkspaceFile: '' +} +``` + +#### importDeveloperProfile +```groovy +stage('import_profile') { + steps { + importDeveloperProfile keychainId: 'my_keychain' + } +} +``` + +#### unlockMacOSKeychain +```groovy +stage('unlock_keychain') { + steps { + unlockMacOSKeychain keychainId: '', keychainPath: '/Users/jenkins/login.keychain.db' + } +} +``` + + +### Transformed Github Action + +#### xcodeBuild +```yaml +- name: Install the Apple certificate and provisioning profile + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + run: | + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles +- name: Xcode Build/Archive + run: |- + /usr/bin/agvtool new-version -all 'ver2' + /usr/bin/agvtool new-marketing-version 'mark_ver1' + /usr/bin/xcodebuild -alltargets -scheme ios-action-test -configuration Release archive -archivePath ./build/Release-iphoneos/ios-action-test.xcarchive DEVELOPMENT_TEAM=123 +- name: Xcode Pack, Build, and Sign .ipa + run: "/usr/bin/xcodebuild -exportArchive -archivePath ./build/Release-iphoneos/ios-action-test.xcarchive -exportPath ./build/Release-iphoneos/output -exportOptionsPlist ${{ env.ExportOptionsPlistPath }}" + env: + ExportOptionsPlistPath: UPDATE_ME +``` + +#### exportIpa + +```yaml +- name: Install the Apple certificate and provisioning profile + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + run: | + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles +- name: Xcode Pack, Build, and Sign .ipa + run: "/usr/bin/xcodebuild -exportArchive -archivePath ./ios-action-test.xcarchive -exportPath ./output -exportOptionsPlist ${{ env.ExportOptionsPlistPath }}" + env: + ExportOptionsPlistPath: UPDATE_ME +``` + +#### importDeveloperProfile + +```yaml +# If using a self-hosted runner, ensure the runner’s keychain is cleaned up at the end of the build +- name: Install the Apple certificate and provisioning profile + env: + BUILD_CERTIFICATE_BASE64: "${{ secrets.BUILD_CERTIFICATE_BASE64 }}" + P12_PASSWORD: "${{ secrets.P12_PASSWORD }}" + BUILD_PROVISION_PROFILE_BASE64: "${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}" + KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}" + run: | + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles +``` + +#### unlockMacOSKeychain + +```yaml +- name: Unlock Keychain + run: security unlock-keychain -p ${{ secrets.KEYCHAIN_PASSWOR}} $KEYCHAIN_PATH + env: + KEYCHAIN_PATH: "/Users/jenkins/login.keychain.db" +``` + + +### Unsupported Options +The following options are not supported: +- logfileOutputDirectory +- allowFailingBuildResults +- ipaName +- interpretTargetAsRegEx +- useLegacyBuildSystem +- cleanResultBundlePath +- noConsoleLog + +The following options are assumed to be set in plist file located at ExportOptionsPlistPath +- ipaExportMethod +- provisioningProfiles +- uploadBitcode +- uploadSymbols +- compileBitcode +- thinning +- appURL +- displayImageURL +- fullSizeImageURL +- assetPackManifestURL +- skipBuildStep +- stripSwiftSymbols +- copyProvisioningProfile \ No newline at end of file diff --git a/docs/jenkins/index.md b/docs/jenkins/index.md new file mode 100644 index 00000000..34205382 --- /dev/null +++ b/docs/jenkins/index.md @@ -0,0 +1,116 @@ +# Plugin Mappings + +Click [here](https://plugins.jenkins.io/) to view the full listing of Jenkins Plugins. + +| Jenkins | GitHub | +| :------------------------------------------------------------------ | :--------------------------------------------------------- | +| [Agent](Agent.md) | runs-on | +| [Android Emulator](AndroidEmulator.md) | reactivecircus/android-emulator-runner@v2 | +| [Ansible Playbook](AnsiblePlaybook.md) | run | +| [Ant](Ant.md) | run | +| [AntExec Builder](AntExecBuilder.md) | run | +| [Archive Artifacts](ArchiveArtifacts.md) | actions/upload-artifact@v2 | +| [Artifact Deployer](ArtifactDeploy.md) | actions/upload-artifact@v2 | +| [Azure KeyVault](AzureKeyVault.md) | Azure/login@v1, run | +| [Bat](Batch.md) | run | +| [Batch](Batch.md) | run | +| [Build](ParameterizedTrigger.md) | octokit/request-action@v2.x | +| [Build Timeout](BuildTimeout.md) | | +| [Checkout](Checkout.md) | actions/checkout@v2 | +| [Conditional Builder](ConditionalBuilder.md) | run if | +| [Copy Artifact](CopyArtifact.md) | dawidd6/action-download-artifact@v2.26.0 | +| [Credentials](Credentials.md) | | +| [Cron](TimerTrigger.md) | | +| [Cucumber Builder](CucumberBuilder.md) | deblockt/cucumber-report-annotations-action@v1.11 | +| [Custom tool install wrapper](CustomToolInstallWrapper.md) | | +| [DeleteDir](DeleteDir.md) | run | +| [DeploytoContainer](DeployToContainer.md) | run | +| [Dir](Dir.md) | run | +| [Docker](Docker.md) | image | +| [Docker Build Step](DockerBuildStep.md) | docker/login-action@v2.1.0, run | +| [Doxygen Builder](DoxygenBuilder.md) | mattnotmitt/doxygen-action@v1.9.5 | +| [Echo](Echo.md) | run | +| [Environment](SecretBuildWrapper.md) | | +| [Environment Injector](EnvironmentInjector.md) | run,actions/github-script@v6.4.0 | +| [File Operations](FileOperations.md) | run | +| [Git](Git.md) | actions/checkout@v2 | +| [GitPublisher](GitPublisher.md) | run | +| [GitHub Pull Request Trigger](GitHubPullRequestTrigger.md) | | +| [GitHub Push Trigger](GitHubPushTrigger.md) | | +| [Gitlab](Gitlab.md) | | +| [Gradle](Gradle.md) | actions/setup-java@v3.10.0, run | +| [HtmlPublisher](HtmlPublisher.md) | actions/upload-artifact@v2 | +| [HttpRequest](HttpRequest.md) | CamiloGarciaLaRotta/watermelon-http-client@v1.7 | +| [If](ConditionalBuilder.md) | run if | +| [Input](Input.md) | run | +| [JUnit](JUnit.md) | EnricoMi/publish-unit-test-result-action@v2.4.1 | +| [Maven](Maven.md) | run | +| [MS Build Builder](MSBuildBuilder.md) | microsoft/setup-msbuild@v1.3.1, run | +| [MS Build SQ Runner Begin](MSBuildSQRunnerBegin.md) | run | +| [MS Build SQ Runner End](MSBuildSQRunnerEnd.md) | run | +| [MS Test Builder](MsTestBuilder.md) | run | +| [NAnt Builder](NantBuilder.md) | run | +| [Node](Node.md) | run | +| [NUnit](NUnit.md) | EnricoMi/publish-unit-test-result-action@v2.4.1 | +| [Node JS Build Wrapper](NodeJsBuildWrapper.md) | | +| [Node JS Command Interpreter](NodeJsCommandInterpreter.md) | actions/setup-node@v2 | +| [Parameters Definitions Property](ParametersDefinitionsProperty.md) | | +| [Parameterized Trigger Builder](ParameterizedTriggerBuilder.md) | octokit/request-action@v2.x | +| [PollSCM](SCMTrigger.md) | | +| [PowerShell](Powershell.md) | run | +| [Post](Post.md) | | +| [Post Build Script](PostBuildScript.md) | run | +| [PreBuild Cleanup](PreBuildCleanup.md) | run | +| [Publish Over CIFS](PublishOverCIFS.md) | run | +| [Publish Over FTP](PublishOverFTP.md) | actions/github-script@v6.4.0, run | +| [Publish Over SSH](PublishOverSSH.md) | shimataro/ssh-key-action@v2.5.0, actions/github-script@v6.4.0, run | +| [Python](Python.md) | run | +| [Reverse Build Trigger](ReverseBuildTrigger.md) | workflows | +| [S3 Publisher](S3.md) | aws-actions/configure-aws-credentials@v1 | +| [SCM Trigger](SCMTrigger.md) | | +| [SCP Publish](SCPPublish.md) | shimataro/ssh-key-action@v2.5.0, actions/github-script@v6.4.0, run | +| [Secret Build Wrapper](SecretBuildWrapper.md) | | +| [Sh](Shell.md) | run | +| [Shell](Shell.md) | run | +| [Single Conditional Builder](SingleConditionalBuilder.md) | run if | +| [Slack](Slack.md) | rtCamp/action-slack-notify@v2.2.0 | +| [Sonar Runner Builder](SonarRunnerBuilder.md) | sonarsource/sonarcloud-github-action@v1.8 | +| [SSH](Ssh.md) | run, shimataro/ssh-key-action@v2.5.0 | +| [Stash](Stash.md) | actions/upload-artifact@v2 | +| [Team PR Push Trigger](TeamPrPushTrigger.md) | | +| [Team Push Trigger](TeamPushTrigger.md) | | +| [Terrform Build Wrapper](TerraformBuildWrapper.md) | hashicorp/setup-terraform@v1, run | +| [Timer Trigger](TimerTrigger.md) | | +| [Timeout](Timeout.md) | timeout-minutes | +| [Trottle Concurrent Builds](ThrottleConcurrent.md) | run | +| [Unstash](Unstash.md) | actions/download-artifact@v2 | +| [Virtual Env Builder](VirtualEnvBuilder.md) | setup-python@v2 | +| [With Python Env](VirtualEnvBuilder.md) | setup-python@v2 | +| [Workspace Cleanup](WorkspaceCleanup.md) | run | +| [Xcode](Xcode.md) | run | + +======= + +## Unsupported + +The following plugins do not have any equivalent in GitHub Actions: + +- AnsiColor +- BitBucket +- Build Name and Description Setter +- EmailExtension +- ExtendedEmailPublisher +- Fingerprint +- GithubCommitStatusSetter +- Lock +- Mail +- Mailer +- Office365Connector +- PerformancePublisher +- Retry +- [Test Results Aggregator](https://github.com/jenkinsci/test-results-aggregator-plugin) +- TimeStamper +- Warnings +- WarningsPublisher + +Any plugins not listed above will not be mapped to an action and will be left as a comment in the converted workflow. diff --git a/docs/travis_ci/AddOns.md b/docs/travis_ci/AddOns.md new file mode 100644 index 00000000..80ebd9f0 --- /dev/null +++ b/docs/travis_ci/AddOns.md @@ -0,0 +1,31 @@ +# AddOns + +- [Apt](AddOns/Apt.md) +- [Artifacts](AddOns/Artifacts.md) +- [Browserstack](AddOns/Browserstack.md) +- [Code Climate](AddOns/CodeClimate.md) +- [Homebrew](AddOns/Homebrew.md) +- [Snaps](AddOns/Snaps.md) +- [Postgresql](AddOns/Postgresql.md) +- [Srcclr](AddOns/Srcclr.md) +- [SshKnownHosts](AddOns/SshKnownHosts.md) + +Any addons not listed above will not be mapped to an action. + +## Unsupported + +Settings: + +- coverity +- sourceconnect +- sonarcloud + +Versions/Env: + +- chrome +- hostname +- hosts +- jwt +- firefox +- mariadb +- rethinkdb diff --git a/docs/travis_ci/AddOns/Apt.md b/docs/travis_ci/AddOns/Apt.md new file mode 100644 index 00000000..0d5f46d7 --- /dev/null +++ b/docs/travis_ci/AddOns/Apt.md @@ -0,0 +1,21 @@ +# Apt + +## Travis input + +```yaml +apt: + packages: + - cmake +``` + +### Transformed Github Action + +```yaml +- run: apt-get -y install cmake +``` + +### Unsupported Options + +- sources +- config +- dist diff --git a/docs/travis_ci/AddOns/Artifacts.md b/docs/travis_ci/AddOns/Artifacts.md new file mode 100644 index 00000000..b9df61a2 --- /dev/null +++ b/docs/travis_ci/AddOns/Artifacts.md @@ -0,0 +1,38 @@ +# Artifacts + +## Travis input + +```yaml +artifacts: + enabled: true + bucket: bucket + endpoint: string + paths: my/path +``` + +### Transformed Github Action + +```yaml +- uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" + if: true +- id: upload_artifacts_to_s3_bucket + run: aws s3 cp my/path s3://bucket/ --recursive + if: true +``` + +### Unsupported Options + +- endpoint +- key +- secret +- branch +- log_format +- debug +- concurrency +- max_size +- permissions +- working_dir +- cache_control diff --git a/docs/travis_ci/AddOns/Browserstack.md b/docs/travis_ci/AddOns/Browserstack.md new file mode 100644 index 00000000..df7cea06 --- /dev/null +++ b/docs/travis_ci/AddOns/Browserstack.md @@ -0,0 +1,36 @@ +# Browserstack + +## Travis input + +```yaml +browserstack: true +``` + +### Transformed Github Action + +```yaml +- uses: browserstack/github-actions/setup-env@v1.0.1 + with: + username: "${{ secrets.BROWSERSTACK_USERNAME }}" + access-key: "${{ secrets.BROWSERSTACK_ACCESS_KEY }}" +- uses: browserstack/github-actions/setup-local@v1.0.1 + with: + local-testing: start +- uses: browserstack/github-actions/setup-local@v1.0.1 + with: + local-testing: stop +``` + +### Unsupported Options + +- username +- access_key +- forecelocal +- only +- app_path +- proxyHost +- proxyPort +- proxyUser +- proxyPass + +NOTE: There may be additional setup for this action required. Please visit the [Browserstack Action](https://github.com/browserstack/github-actions/tree/master/setup-local) page to complete setup of the action. diff --git a/docs/travis_ci/AddOns/CodeClimate.md b/docs/travis_ci/AddOns/CodeClimate.md new file mode 100644 index 00000000..d66ec0d7 --- /dev/null +++ b/docs/travis_ci/AddOns/CodeClimate.md @@ -0,0 +1,21 @@ +# Code Climate + +## Travis input + +```yaml +code_climate: + repo_token: + secure: encrypted string +``` + +### Transformed Github Action + +```yaml +- run: |- + curl -L https://github.com/codeclimate/codeclimate/archive/master.tar.gz | tar xvz + cd codeclimate-* && sudo make install +``` + +### Unsupported Options + +- repo_token diff --git a/docs/travis_ci/AddOns/Homebrew.md b/docs/travis_ci/AddOns/Homebrew.md new file mode 100644 index 00000000..cf77a2ee --- /dev/null +++ b/docs/travis_ci/AddOns/Homebrew.md @@ -0,0 +1,20 @@ +# Homebrew + +## Travis input + +```yaml +homebrew: + packages: + - cmake +``` + +### Transformed Github Action + +```yaml +- run: |- + brew install cmake +``` + +### Unsupported Options + +- brewfile diff --git a/docs/travis_ci/AddOns/Postgresql.md b/docs/travis_ci/AddOns/Postgresql.md new file mode 100644 index 00000000..4f001255 --- /dev/null +++ b/docs/travis_ci/AddOns/Postgresql.md @@ -0,0 +1,20 @@ +# Postgresql + +## Travis input + +```yaml +addons: + postgresql: "11" +``` + +### Transformed Github Action + +```yaml +services: + postgresql: + image: postgres:11 +``` + +### Unsupported Options + +- None diff --git a/docs/travis_ci/AddOns/Snaps.md b/docs/travis_ci/AddOns/Snaps.md new file mode 100644 index 00000000..add2f81b --- /dev/null +++ b/docs/travis_ci/AddOns/Snaps.md @@ -0,0 +1,16 @@ +# Snaps + +## Travis input + +```yaml +snaps: +- name: foo + classic: true + channel: edge +``` + +### Transformed Github Action + +```yaml +- run: sudo snap install foo --classic --channel=edge +``` diff --git a/docs/travis_ci/AddOns/SonarCloud.md b/docs/travis_ci/AddOns/SonarCloud.md new file mode 100644 index 00000000..18622ce3 --- /dev/null +++ b/docs/travis_ci/AddOns/SonarCloud.md @@ -0,0 +1,176 @@ +# SonarCloud + +## Travis input - Other(for JS YS, Go, Python, PHP...) + +```yaml +addons: + sonarcloud: + organization: "mona_org" + token: + secure: "**************************" +script: + - sonar-scanner +``` + +### Transformed Github Action + +```yaml +- name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@v1.8 + env: + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + SONARCLOUD_URL: "${{ secrets.SONAR_URL }}" + with: + args: | + #WARNING: projectKey is a required field, ensure it is configured here or in your project file + -Dsonar.projectKey='<>'/` + -Dsonar.organization='MonaOrg'/` + -Dsonar.host.url='${{ secrets.SONAR_URL }}'/` + -Dsonar.login=${{ env.SONAR_TOKEN }}/` +``` + +## Travis input - C, C++, or ObjC + +```yaml +addons: + sonarcloud: + organization: "mona_org" + token: + secure: "**************************" +script: + - build-wrapper-linux-x86-64 --out-dir bw-output + - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output +``` + +### Transformed Github Action + +```yaml +- name: Download and set up build-wrapper + env: + BUILD_WRAPPER_DOWNLOAD_URL: "${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip" + run: |- + curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}/` + unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar//` + echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH/` +- name: Download and set up sonar-scanner + env: + SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip + SONAR_SCANNER_VERSION: 4.4.0.2170 + run: |- + mkdir -p $HOME/.sonar/` + curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}/` + unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar//` + echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH/` +- name: SonarCloud Scan + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + run: | + sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output/` + #WARNING: projectKey is a required field, ensure it is configured here or in your project file + -Dsonar.projectKey='<>'/` + -Dsonar.organization='MonaOrg'/` + -Dsonar.host.url='${{ secrets.SONAR_URL }}'/` + -Dsonar.login=${{ env.SONAR_TOKEN }}/` +``` + +## Travis input - Gradle + +```yaml +addons: + sonarcloud: + organization: "mona_org" + token: + secure: "**************************" +script: + - ./gradlew sonarqube +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' +- name: SonarCloud Scan + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + run: | + ./gradlew sonarqube/` + #WARNING: projectKey is a required field, ensure it is configured here or in your project file + -Dsonar.projectKey='<>'/` + -Dsonar.organization='MonaOrg'/` + -Dsonar.host.url='${{ secrets.SONAR_URL }}'/` + -Dsonar.login=${{ env.SONAR_TOKEN }}/` +``` + +## Travis input - Maven + +```yaml +addons: + sonarcloud: + organization: "mona_org" + token: + secure: "**************************" +script: + - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=important_project_jenkins +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' +- name: SonarCloud Scan + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + run: | + mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar/` + #WARNING: projectKey is a required field, ensure it is configured here or in your project file + -Dsonar.projectKey='<>'/` + -Dsonar.organization='MonaOrg'/` + -Dsonar.host.url='${{ secrets.SONAR_URL }}'/` + -Dsonar.login=${{ env.SONAR_TOKEN }}/` +``` + +## Travis input - DotNet + +```yaml +addons: + sonarcloud: + organization: "mona_org" + token: + secure: "**************************" +script: + - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=important_project_jenkins +``` + +### Transformed Github Action + +```yaml +- name: Set up JDK 1.11 + uses: actions/setup-java@v3.10.0 + with: + java-version: '1.11' +- name: SonarCloud Scan + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + run: | + mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar/` + #WARNING: projectKey is a required field, ensure it is configured here or in your project file + -Dsonar.projectKey='<>'/` + -Dsonar.organization='MonaOrg'/` + -Dsonar.host.url='${{ secrets.SONAR_URL }}'/` + -Dsonar.login=${{ env.SONAR_TOKEN }}/` +``` + +### Unsupported Options + +- DotNet projects diff --git a/docs/travis_ci/AddOns/Srcclr.md b/docs/travis_ci/AddOns/Srcclr.md new file mode 100644 index 00000000..591a0ad1 --- /dev/null +++ b/docs/travis_ci/AddOns/Srcclr.md @@ -0,0 +1,13 @@ +# Srcclr + +## Travis input + +```yaml +srcclr: true +``` + +### Transformed Github Action + +```yaml +- run: curl -sSL https://srcclr.com/install | sh +``` diff --git a/docs/travis_ci/AddOns/SshKnownHosts.md b/docs/travis_ci/AddOns/SshKnownHosts.md new file mode 100644 index 00000000..463c5295 --- /dev/null +++ b/docs/travis_ci/AddOns/SshKnownHosts.md @@ -0,0 +1,26 @@ +# SSH Known Hosts + +## Travis input + +```yaml +addons: + ssh_known_hosts: + - git.example.com + - 111.22.33.44 +``` + +### Transformed Github Action + +```yaml +jobs: + build: + runs-on: ubuntu-latest + steps: + - run: ssh-keyscan -H git.example.com >> ~/.ssh/known_hosts + - run: ssh-keyscan -H 111.22.33.44 >> ~/.ssh/known_hosts + - uses: actions/checkout@v1 +``` + +### Unsupported Options + +- None diff --git a/docs/travis_ci/AfterFailure.md b/docs/travis_ci/AfterFailure.md new file mode 100644 index 00000000..10705f2c --- /dev/null +++ b/docs/travis_ci/AfterFailure.md @@ -0,0 +1,21 @@ +# After Failure + +## Travis input + +```yaml +after_failure: + - npm run lint + - npm run build +``` + +### Transformed Github Action + +```yaml +- run: npm run lint + if: "${{ failure() }}" +``` + +### Supported Options + +The scripts transformer will transform some of the TravisCI default environment variables automatically. +See [Scripts.md](Scripts.md) for the supported environment variables. diff --git a/docs/travis_ci/AfterSuccess.md b/docs/travis_ci/AfterSuccess.md new file mode 100644 index 00000000..b6a0ac1e --- /dev/null +++ b/docs/travis_ci/AfterSuccess.md @@ -0,0 +1,20 @@ +# After Success + +## Travis input + +```yaml +after_success: + - echo "hello world!" +``` + +### Transformed Github Action + +```yaml +- run: echo "hello world!" + if: "${{ success() }}" +``` + +### Supported Options + +The scripts transformer will transform some of the TravisCI default environment variables automatically. +See [Scripts.md](Scripts.md) for the supported environment variables. diff --git a/docs/travis_ci/Cache.md b/docs/travis_ci/Cache.md new file mode 100644 index 00000000..eb45c1db --- /dev/null +++ b/docs/travis_ci/Cache.md @@ -0,0 +1,20 @@ +# Cache + +- [Bundler](Cache/Bundler.md) +- [Cargo](Cache/Cargo.md) +- [Ccache](Cache/Ccache.md) +- [Cocoapods](Cache/Cocoapods.md) +- [Directories](Cache/Directories.md) +- [Npm](Cache/Npm.md) +- [Packages](Cache/Packages.md) +- [Pip](Cache/Pip.md) +- [Yarn](Cache/Yarn.md) + +Any cache steps not listed above will not be mapped to an action. + +## Unsupported + +- branch +- edge +- timeout +- apt diff --git a/docs/travis_ci/Cache/Bundler.md b/docs/travis_ci/Cache/Bundler.md new file mode 100644 index 00000000..29c1acbd --- /dev/null +++ b/docs/travis_ci/Cache/Bundler.md @@ -0,0 +1,19 @@ +# Bundler + +## Travis input + +```yaml +cache: + bundler: true +``` + +## Transformed Github Action + +The bundler cache is transformed by updating any existing setup-ruby steps with `bundler_cache: true`, or by adding a new setup-ruby step to the workflow. + +```yaml +- uses: ruby/setup-ruby@v1.138.0 + with: + ruby-version: head + bundler-cache: true +``` diff --git a/docs/travis_ci/Cache/Cargo.md b/docs/travis_ci/Cache/Cargo.md new file mode 100644 index 00000000..6a7877a6 --- /dev/null +++ b/docs/travis_ci/Cache/Cargo.md @@ -0,0 +1,25 @@ +# Cargo + +## Travis input + +```yaml +cache: + cargo: true +``` + +## Transformed Github Action + +```yaml +- name: Set up cargo cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: "${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Ccache.md b/docs/travis_ci/Cache/Ccache.md new file mode 100644 index 00000000..0e33e88c --- /dev/null +++ b/docs/travis_ci/Cache/Ccache.md @@ -0,0 +1,23 @@ +# Ccache + +## Travis input + +```yaml +cache: + ccache: true +``` + +## Transformed Github Action + +```yaml +- name: Set up ccache cache + uses: actions/cache@v2 + with: + path: ".ccache" + key: "${ { runner.os } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }" + restore-keys: "${ { runner.os } }-ccache-" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Cocoapods.md b/docs/travis_ci/Cache/Cocoapods.md new file mode 100644 index 00000000..0cf41cfc --- /dev/null +++ b/docs/travis_ci/Cache/Cocoapods.md @@ -0,0 +1,23 @@ +# Cocoapods + +## Travis input + +```yaml +cache: + cocoapods: true +``` + +## Transformed Github Action + +```yaml +- name: Set up cocoapods cache + uses: actions/cache@v2 + with: + path: Pods + key: "${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}" + restore-keys: "${{ runner.os }}-pods-" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Directories.md b/docs/travis_ci/Cache/Directories.md new file mode 100644 index 00000000..44805cca --- /dev/null +++ b/docs/travis_ci/Cache/Directories.md @@ -0,0 +1,25 @@ +# Directories + +## Travis input + +```yaml +cache: + directories: + - "path" +``` + +## Transformed Github Action + +```yaml +- name: Set up cache + uses: actions/cache@v2 + with: + path: |- + $HOME/bin + path + key: "${{ runner.os }}-path }}" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Npm.md b/docs/travis_ci/Cache/Npm.md new file mode 100644 index 00000000..57903a88 --- /dev/null +++ b/docs/travis_ci/Cache/Npm.md @@ -0,0 +1,23 @@ +# Npm + +## Travis input + +```yaml +cache: + npm: true +``` + +## Transformed Github Action + +```yaml +- name: Set up npm cache + uses: actions/cache@v2 + with: + path: "~/.npm" + key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}" + restore-keys: "${{ runner.os }}-node-" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Packages.md b/docs/travis_ci/Cache/Packages.md new file mode 100644 index 00000000..dddeb1c8 --- /dev/null +++ b/docs/travis_ci/Cache/Packages.md @@ -0,0 +1,23 @@ +# Packages + +## Travis input + +```yaml +cache: + packages: true +``` + +## Transformed Github Action + +```yaml +- name: Set up R cache + uses: actions/cache@v2 + with: + path: "~/.local/share/renv" + key: "${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}" + restore-keys: "${{ runner.os }}-renv-" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Pip.md b/docs/travis_ci/Cache/Pip.md new file mode 100644 index 00000000..817a1b59 --- /dev/null +++ b/docs/travis_ci/Cache/Pip.md @@ -0,0 +1,23 @@ +# Pip + +## Travis input + +```yaml +cache: + pip: true +``` + +## Transformed Github Action + +```yaml +- name: Set up pip cache + uses: actions/cache@v2 + with: + path: "~/.cache/pip" + key: "${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}" + restore_keys: "${{ runner.os }}-pip-" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Cache/Yarn.md b/docs/travis_ci/Cache/Yarn.md new file mode 100644 index 00000000..44a1547b --- /dev/null +++ b/docs/travis_ci/Cache/Yarn.md @@ -0,0 +1,26 @@ +# Yarn + +## Travis input + +```yaml +cache: + yarn: true +``` + +## Transformed Github Action + +```yaml +- name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo '::set-output name=dir::$(yarn cache dir)' +- name: Set up yarn cache + 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-" +``` + +## Unsupported Options + +- `actions/cache@v2` is not supported on GHES diff --git a/docs/travis_ci/Conditions.md b/docs/travis_ci/Conditions.md new file mode 100644 index 00000000..fe1814d8 --- /dev/null +++ b/docs/travis_ci/Conditions.md @@ -0,0 +1,36 @@ +# Conditions + +## Travis input + +```yaml +if: "branch = master AND type = cron OR tag = bar" +``` + +## Transformed Github Action + +```yaml +if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' || github.ref == 'refs/tags/bar' }} +``` + +### Supported Options + +- These attributes: (type, repo, branch, tag, sender, head_branch, os) +- Individual terms +- Comparing values +- Comparing function calls to attributes +- Comparing function calls +- Attributes in lists +- Predicates +- Nested function calls +- Boolean operators +- Parenthesis +- We support all keywords being case-insensitive +- We recognize Travis aliases (eg. "! is an alias to NOT") +- Line continuation (multiline conditions) + +### Unsupported Options + +- Matching against regular expressions +- Function calls in lists +- Nested env function calls (eg. env(env(FOO))) +- These attributes: (commit_message, fork, head_repo, language, sudo, dist, group) diff --git a/docs/travis_ci/Dependencies.md b/docs/travis_ci/Dependencies.md new file mode 100644 index 00000000..a616e7a2 --- /dev/null +++ b/docs/travis_ci/Dependencies.md @@ -0,0 +1,36 @@ +# Dependencies + +- [Crystal](Dependencies/Crystal.md) +- [Dotnet](Dependencies/Dotnet.md) +- [Ghc](Dependencies/Ghc.md) +- [Jdk](Dependencies/Jdk.md) +- [Lein](Dependencies/Lein.md) +- [NodeJs](Dependencies/NodeJs.md) +- [Python](Dependencies/Python.md) +- [Rvm](Dependencies/Rvm.md) + +Any dependencies not listed above will not be mapped to an action. + +## Unsupported Options + +- compiler +- d +- dart +- dart_task +- elixir +- otp_release +- mono +- go +- haxe +- julia +- matlab +- nix +- perl +- php +- r +- gemfile +- rust +- scala +- solution +- smalltalk +- smalltalk_vm diff --git a/docs/travis_ci/Dependencies/Crystal.md b/docs/travis_ci/Dependencies/Crystal.md new file mode 100644 index 00000000..8a0da16a --- /dev/null +++ b/docs/travis_ci/Dependencies/Crystal.md @@ -0,0 +1,15 @@ +# Crystal + +## Travis input + +```yaml +crystal: latest +``` + +## Transformed Github Action + +```yaml +- uses: oprypin/install-crystal@v1.7.0 + with: + crystal: latest +``` diff --git a/docs/travis_ci/Dependencies/D.md b/docs/travis_ci/Dependencies/D.md new file mode 100644 index 00000000..ae8d42bb --- /dev/null +++ b/docs/travis_ci/Dependencies/D.md @@ -0,0 +1,15 @@ +# D + +## Travis input + +```yaml +d: dmd-2.089.1 +``` + +## Transformed Github Action + +```yaml +- uses: dlang-community/setup-dlang@v1.3.0 + with: + compiler: dmd-2.089.1 +``` diff --git a/docs/travis_ci/Dependencies/Dart.md b/docs/travis_ci/Dependencies/Dart.md new file mode 100644 index 00000000..2f9d6568 --- /dev/null +++ b/docs/travis_ci/Dependencies/Dart.md @@ -0,0 +1,16 @@ +# Dart + +## Travis input + +```yaml +dart: +- stable +``` + +## Transformed Github Action + +```yaml + uses: dart-lang/setup-dart@v1.3 + with: + sdk: stable +``` diff --git a/docs/travis_ci/Dependencies/Dotnet.md b/docs/travis_ci/Dependencies/Dotnet.md new file mode 100644 index 00000000..a57de88b --- /dev/null +++ b/docs/travis_ci/Dependencies/Dotnet.md @@ -0,0 +1,15 @@ +# Dotnet + +## Travis input + +```yaml +dotnet: 2.1.502 +``` + +## Transformed Github Action + +```yaml +- uses: actions/setup-dotnet@v3.0.3 + with: + dotnet-version: '3.1.x' +``` diff --git a/docs/travis_ci/Dependencies/Ghc.md b/docs/travis_ci/Dependencies/Ghc.md new file mode 100644 index 00000000..e77b83be --- /dev/null +++ b/docs/travis_ci/Dependencies/Ghc.md @@ -0,0 +1,15 @@ +# Ghc + +## Travis input + +```yaml +ghc: 8.6.4 +``` + +## Transformed Github Action + +```yaml +- uses: haskell/actions/setup@v2.3.3 + with: + ghc-version: '8.6.4' +``` diff --git a/docs/travis_ci/Dependencies/Go.md b/docs/travis_ci/Dependencies/Go.md new file mode 100644 index 00000000..a6fdfdf5 --- /dev/null +++ b/docs/travis_ci/Dependencies/Go.md @@ -0,0 +1,15 @@ +# Go + +## Travis input + +```yaml +go: 1.11.x +``` + +## Transformed Github Action + +```yaml +- uses: actions/setup-go@v3 + with: + go-version: 1.11.x +``` diff --git a/docs/travis_ci/Dependencies/Haxe.md b/docs/travis_ci/Dependencies/Haxe.md new file mode 100644 index 00000000..8a093404 --- /dev/null +++ b/docs/travis_ci/Dependencies/Haxe.md @@ -0,0 +1,16 @@ +# Haxe + +## Travis input + +```yaml +haxe: + - "3.2.1" +``` + +## Transformed Github Action + +```yaml +- uses: krdlab/setup-haxe@v1.4.0 + with: + haxe-version: '3.2.1' +``` diff --git a/docs/travis_ci/Dependencies/Jdk.md b/docs/travis_ci/Dependencies/Jdk.md new file mode 100644 index 00000000..713614c6 --- /dev/null +++ b/docs/travis_ci/Dependencies/Jdk.md @@ -0,0 +1,16 @@ +# JDK + +## Travis input + +```yaml +jdk: 8 +``` + +## Transformed Github Action + +```yaml +- uses: actions/setup-java@v3.10.0 + with: + distribution: zulu + java-version: 8 +``` diff --git a/docs/travis_ci/Dependencies/Julia.md b/docs/travis_ci/Dependencies/Julia.md new file mode 100644 index 00000000..d9a94f6d --- /dev/null +++ b/docs/travis_ci/Dependencies/Julia.md @@ -0,0 +1,15 @@ +# Julia + +## Travis input + +```yaml +julia: 1 +``` + +## Transformed Github Action + +```yaml +- uses: julia-actions/setup-julia@v1.9.0 + with: + version: '2.7' +``` diff --git a/docs/travis_ci/Dependencies/Lein.md b/docs/travis_ci/Dependencies/Lein.md new file mode 100644 index 00000000..f98f2a2e --- /dev/null +++ b/docs/travis_ci/Dependencies/Lein.md @@ -0,0 +1,15 @@ +# Lein + +## Travis input + +```yaml +lein: 2.1 +``` + +## Transformed Github Action + +```yaml +- uses: DeLaGuardo/setup-clojure@9.5 + with: + lein: 2.9.1 +``` diff --git a/docs/travis_ci/Dependencies/Matlab.md b/docs/travis_ci/Dependencies/Matlab.md new file mode 100644 index 00000000..9d961566 --- /dev/null +++ b/docs/travis_ci/Dependencies/Matlab.md @@ -0,0 +1,15 @@ +# Matlab + +## Travis input + +```yaml +matlab: latest +``` + +## Transformed Github Action + +```yaml +- uses: matlab-actions/setup-matlab@v1.2.3 + with: + release: latest +``` diff --git a/docs/travis_ci/Dependencies/Nix.md b/docs/travis_ci/Dependencies/Nix.md new file mode 100644 index 00000000..b1c13b16 --- /dev/null +++ b/docs/travis_ci/Dependencies/Nix.md @@ -0,0 +1,15 @@ +# Nix + +## Travis input + +```yaml +nix: 2.3.6 +``` + +## Transformed Github Action + +```yaml +- uses: cachix/install-nix-action@v19 + with: + install_url: https://nixos.org/releases/nix/nix-2.3.6/install +``` diff --git a/docs/travis_ci/Dependencies/NodeJs.md b/docs/travis_ci/Dependencies/NodeJs.md new file mode 100644 index 00000000..b8eda97d --- /dev/null +++ b/docs/travis_ci/Dependencies/NodeJs.md @@ -0,0 +1,21 @@ +# Node Js + +## Travis input + +```yaml +node_js: 7 +``` + +## Transformed Github Action + +```yaml +- uses: actions/setup-node@v2 + with: + cache: npm + node-version: '12' + +``` + +## Unsupported Options + +- string node_js versions diff --git a/docs/travis_ci/Dependencies/PandocVersion.md b/docs/travis_ci/Dependencies/PandocVersion.md new file mode 100644 index 00000000..552dc861 --- /dev/null +++ b/docs/travis_ci/Dependencies/PandocVersion.md @@ -0,0 +1,15 @@ +# Pandoc Version + +## Travis input + +```yaml +pandoc_version: 2.7.3 +``` + +## Transformed Github Action + +```yaml +- uses: r-lib/actions/setup-pandoc@v1 + with: + pandoc-version: 2.7.4 +``` diff --git a/docs/travis_ci/Dependencies/Perl.md b/docs/travis_ci/Dependencies/Perl.md new file mode 100644 index 00000000..4b5af587 --- /dev/null +++ b/docs/travis_ci/Dependencies/Perl.md @@ -0,0 +1,15 @@ +# Perl + +## Travis input + +```yaml +perl: 5.43 +``` + +## Transformed Github Action + +```yaml +- uses: shogo82148/actions-setup-perl@v1.20.1 + with: + perl-version: '5.43' +``` diff --git a/docs/travis_ci/Dependencies/Php.md b/docs/travis_ci/Dependencies/Php.md new file mode 100644 index 00000000..f2aca56e --- /dev/null +++ b/docs/travis_ci/Dependencies/Php.md @@ -0,0 +1,16 @@ +# Php + +## Travis input + +```yaml +php: 7.4 +``` + +## Transformed Github Action + +```yaml +- uses: shivammathur/setup-php@2.24.0 + with: + tools: phpunit + php-version: '7.4' +``` diff --git a/docs/travis_ci/Dependencies/Python.md b/docs/travis_ci/Dependencies/Python.md new file mode 100644 index 00000000..ccfaf52f --- /dev/null +++ b/docs/travis_ci/Dependencies/Python.md @@ -0,0 +1,15 @@ +# Python + +## Travis input + +```yaml +python: 7 +``` + +## Transformed Github Action + +```yaml +- uses: actions/setup-python@v2 + with: + python-version: '2.7' +``` diff --git a/docs/travis_ci/Dependencies/R.md b/docs/travis_ci/Dependencies/R.md new file mode 100644 index 00000000..80984db5 --- /dev/null +++ b/docs/travis_ci/Dependencies/R.md @@ -0,0 +1,15 @@ +# R + +## Travis input + +```yaml +r: 3.5.3 +``` + +## Transformed Github Action + +```yaml +- uses: r-lib/actions/setup-r@v2 + with: + r-version: 3.5.3 +``` diff --git a/docs/travis_ci/Dependencies/Rust.md b/docs/travis_ci/Dependencies/Rust.md new file mode 100644 index 00000000..0ccefe9d --- /dev/null +++ b/docs/travis_ci/Dependencies/Rust.md @@ -0,0 +1,15 @@ +# Rust + +## Travis input + +```yaml +rust: nightly +``` + +## Transformed Github Action + +```yaml +- uses: actions-rs/toolchain@v1.0.6 + with: + toolchain: '2.7' +``` diff --git a/docs/travis_ci/Dependencies/Rvm.md b/docs/travis_ci/Dependencies/Rvm.md new file mode 100644 index 00000000..74331c91 --- /dev/null +++ b/docs/travis_ci/Dependencies/Rvm.md @@ -0,0 +1,15 @@ +# RVM + +## Travis input + +```yaml +rvm: 2.5 +``` + +## Transformed Github Action + +```yaml +- uses: ruby/setup-ruby@v1.138.0 + with: + ruby-version: head +``` diff --git a/docs/travis_ci/Dependencies/Scala.md b/docs/travis_ci/Dependencies/Scala.md new file mode 100644 index 00000000..063caca0 --- /dev/null +++ b/docs/travis_ci/Dependencies/Scala.md @@ -0,0 +1,20 @@ +# Scala + +## Travis input + +```yaml +scala: + - 2.9.3 + - 2.10.6 + - 2.11.11 +``` + +## Transformed Github Action + +```yaml +- uses: olafurpg/setup-scala@v14 +``` + +## Unsupported Options + +- scala version diff --git a/docs/travis_ci/Dependencies/Smalltalk.md b/docs/travis_ci/Dependencies/Smalltalk.md new file mode 100644 index 00000000..5fab6208 --- /dev/null +++ b/docs/travis_ci/Dependencies/Smalltalk.md @@ -0,0 +1,16 @@ +# Smalltalk + +## Travis input + +```yaml +smalltalk: + - Squeak-trunk +``` + +## Transformed Github Action + +```yaml +- uses: hpi-swa/setup-smalltalkCI@v1 + with: + smalltalk-image: Squeak64-trunk +``` diff --git a/docs/travis_ci/Deploy.md b/docs/travis_ci/Deploy.md new file mode 100644 index 00000000..3ccffd29 --- /dev/null +++ b/docs/travis_ci/Deploy.md @@ -0,0 +1,62 @@ +# Deploy + +- [GitHub Release](Deploy/Release.md) +- [Script](Deploy/Script.md) +- [AWS Cloudformation](Cloudformation.md) +- [Anynines](Deploy/Anynines.md) +- [NPM](Deploy/NPM.md) +- [Heroku](Deploy/Heroku.md) +- [GitHub Pages](Deploy/Pages.md) + +Any deploy transformers not listed above will not be mapped to an action. + +## Unsupported + +- AWS CODEDEPLOY +- AWS ELASTIC BEANSTALK +- AWS LAMBDA +- AWS OPSWORKS +- AWS S3 +- AZURE WEB APPS +- BINTRAY +- BLUEMIX CLOUDFOUNDRY +- BOXFUSE +- CARGO +- CHEF SUPERMARKET +- CLOUD 66 +- CLOUD FOUNDRY +- CONVOX +- DATICA +- ENGINE YARD +- GLEIS +- GOOGLE APP ENGINE +- GOOGLE CLOUD STORAGE +- GOOGLE FIREBASE +- HACKAGE +- HEPHY +- LAUNCHPAD +- NETLIFY DROP +- OPENSHIFT +- PACKAGECLOUD +- PUPPET FORGE +- PYPI +- RACKSPACE CLOUD FILES +- RUBYGEMS +- SCALINGO +- SNAP STORE +- SURGE.SH +- TESTFAIRY +- TRANSIFEX + +## Conditions + +### Supported Options + +- repo +- branch +- all_branches +- condition + +### Unsupported Options + +- dependency conditions diff --git a/docs/travis_ci/Deploy/Anynines.md b/docs/travis_ci/Deploy/Anynines.md new file mode 100644 index 00000000..ccd88178 --- /dev/null +++ b/docs/travis_ci/Deploy/Anynines.md @@ -0,0 +1,25 @@ +# Anynines + +## Travis input + +```yaml +deploy: + provider: anynines + username: + password: + organization: + space: + edge: true +``` + +## Transformed Github Action + +```yaml +- run: cf api https://api.de.a9s.eu-u octocat-p super-secret-o github-s and time + if: "${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}" +``` + +### Unsupported Options + +- buildpack +- skip cleanup (deprecated in Travis) diff --git a/docs/travis_ci/Deploy/Cloudformation.md b/docs/travis_ci/Deploy/Cloudformation.md new file mode 100644 index 00000000..8a91519f --- /dev/null +++ b/docs/travis_ci/Deploy/Cloudformation.md @@ -0,0 +1,41 @@ +# AWS Cloudformation + +## Travis input + +```yaml +deploy: + provider: cloudformation + access-key-id: + secret-access-key: + template: