{"_id":"@edilsondmorais/scaffolder-backend-module-azure-pipelines","_rev":"4-243686046401b4addd7a977ac602d122","time":{"created":"2023-03-13T16:59:45.405Z","0.4.4":"2023-03-13T15:14:54.785Z","modified":"2023-03-13T20:19:26.817Z","0.4.5":"2023-03-13T16:59:45.733Z","0.4.6":"2023-03-13T20:19:26.701Z"},"name":"@edilsondmorais/scaffolder-backend-module-azure-pipelines","dist-tags":{"latest":"0.4.6"},"versions":{"0.4.5":{"name":"@edilsondmorais/scaffolder-backend-module-azure-pipelines","version":"0.4.5","description":"A collection of Backstage scaffolder backend modules for Azure pipelines.","main":"dist/index.cjs.js","types":"dist/index.d.ts","publishConfig":{"access":"public","main":"dist/index.cjs.js","types":"dist/index.d.ts"},"backstage":{"role":"backend-plugin-module"},"scripts":{"start":"backstage-cli package start","build":"backstage-cli package build","lint":"backstage-cli package lint","test":"backstage-cli package test","clean":"backstage-cli package clean","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack"},"repository":{"type":"git","url":"git+https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines.git"},"keywords":["backstage","azure-devops","azure-pipelines","backstage-plugin","backstage-template"],"author":{"name":"Parfümerie Douglas GmbH"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Parfuemerie-Douglas/scaffolder-backend-module-azure-pipelines/issues"},"homepage":"https://github.com/Parfuemerie-Douglas/scaffolder-backend-module-azure-pipelines#readme","dependencies":{"@backstage/backend-common":"^0.15.1","@backstage/errors":"^1.1.1","@backstage/integration":"^1.3.1","@backstage/plugin-scaffolder-backend":"^1.6.0","@backstage/types":"^1.0.0","@types/node-fetch":"^2.6.2","node-fetch":"2"},"devDependencies":{"@backstage/cli":"^0.19.0"},"gitHead":"8bf3950694ac17446a6561311893bcd3fec9b730","_id":"@edilsondmorais/scaffolder-backend-module-azure-pipelines@0.4.5","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-jPaBBo6GnJ6Clt8BsejV17sRb4gsjjZiHUj+pao1C3r5kk04ZVCW53WCb+ks0Ko0SPI747xloWSuqMbtHWLsqw==","shasum":"f5dfda175f7f130168533e3b2b44bbd5bf6472b1","tarball":"https://registry.npmjs.org/@edilsondmorais/scaffolder-backend-module-azure-pipelines/-/scaffolder-backend-module-azure-pipelines-0.4.5.tgz","fileCount":6,"unpackedSize":58181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRp1VIjTIiMJDIlKdOw03uNkgqYnEOYY4SKq0zc9Az9AiBuKCvDC+BP3U1dcx5zX4HPS/9zX/4INDyVCaY6FFmZbg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD1aBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrygA//R5wvT82uzN/TlImGfw5lHvL8Tx5ncDdBtt06UVANM4ALsNw8\r\nCpib2Pj2+SzvO+10GyXIgkyZxPlOrahDGNi3uDA9QEpRCxGeZSoKItBLIN0z\r\nj3tGPv8OU3SZhGySiDy3E2vu5uvi//BKWaWpBK8u+p0gBzRL2sD17a7ZbNK+\r\nl6rZHqfrbffdtuadSPL6sEGZDLkWHMXFQGnPwEeZCFhA/QabHAkjjS/C+yAm\r\nQ/5R8zGOsq5WIBfhA2ScDgj1EZa5GsSPOTBeG3oBMTKptOBVvSFkBPFhbbK8\r\nTXKN93dHR/lGH/OYFfUxONTs0zGis/Ze1BLdNw4n9WNBueqAA//nqfwCdNBg\r\n+1pcuQmWN66qnS7cKz9dfgcFScLtGUfTReZpn6bN2xcPEYzj1L/fKHfUE6L7\r\nvmyTGJ5gqGQEY8+1HfCC2lxI2y+yDcGtLH0k5hz2kuXB9FRZobOyDu1fsirp\r\no6NKb/ywYz5R7/21C3Zqirb5qyNE8YNsem4Zlcw4WtdZLUP9shvKb2rXJzMI\r\nsfWH0t3fVM6oN/EnEkMztm9JjpGGGQPx/Js92LchuyC6D6kDP1PgB7WaLXaQ\r\nj5743yxxu+S33OuBDB3Y6VJRShI6kGlO4e5EAPncpwiBFYlPs9ZynigGjpEe\r\ni1LvG/lII/tPA1lvSDnvOoQ6akqTI4bGd+s=\r\n=0pqE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"edilsondmorais","email":"edilsondmorais@yahoo.com.br"},"directories":{},"maintainers":[{"name":"edilsondmorais","email":"edilsondmorais@yahoo.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scaffolder-backend-module-azure-pipelines_0.4.5_1678726785476_0.08659503064091778"},"_hasShrinkwrap":false},"0.4.6":{"name":"@edilsondmorais/scaffolder-backend-module-azure-pipelines","version":"0.4.6","description":"A collection of Backstage scaffolder backend modules for Azure pipelines.","main":"dist/index.cjs.js","types":"dist/index.d.ts","publishConfig":{"access":"public","main":"dist/index.cjs.js","types":"dist/index.d.ts"},"backstage":{"role":"backend-plugin-module"},"scripts":{"start":"backstage-cli package start","build":"backstage-cli package build","lint":"backstage-cli package lint","test":"backstage-cli package test","clean":"backstage-cli package clean","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack"},"repository":{"type":"git","url":"git+https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines.git"},"keywords":["backstage","azure-devops","azure-pipelines","backstage-plugin","backstage-template"],"author":{"name":"Edilson S Morais"},"license":"Apache-2.0","bugs":{"url":"https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines/issues"},"homepage":"https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines#readme","dependencies":{"@backstage/backend-common":"^0.18.2","@backstage/errors":"^1.1.4","@backstage/integration":"^1.4.2","@backstage/plugin-scaffolder-backend":"^1.11.0","@backstage/types":"^1.0.2","@types/node-fetch":"^2.6.2","node-fetch":"2.6.7"},"devDependencies":{"@backstage/cli":"^0.22.3"},"gitHead":"684a5e55a87ede9d1fccb764811c451a2b9ff0f6","_id":"@edilsondmorais/scaffolder-backend-module-azure-pipelines@0.4.6","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-RGg4BNd1+kwk1N9nQgcIlbmstDzMgSF+poQFxtK3lsU9ysFJumUBmJhNEWzsPkwGSkH91cHByS9dbC1uhv282Q==","shasum":"dcb3d451cd96f414b8835a5720b36ed158700b46","tarball":"https://registry.npmjs.org/@edilsondmorais/scaffolder-backend-module-azure-pipelines/-/scaffolder-backend-module-azure-pipelines-0.4.6.tgz","fileCount":6,"unpackedSize":58153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcTG2qjWGje7k/E8ryPKGsO0AdmZqpastRXWCNBoGUZAiEA6nVcN9AQZ28VAhg5mTn3APWVF+K8/peZ1bVBUqPoCBw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD4VOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6YRAApQs3mq4Jzv+2ZN/cfWcyGcKWSceTQSktWuRqRqSdyDXkHcRt\r\n3310iyHazRkeEqPM1oP9/7B9FuCj906O7UqgTG+ANxJqWTdmnBUNTuHtsVqL\r\nfvxEAh4TYH9XXMhG8f949kuDoQ/fmiBNq66VO7Wwin2u894hWc4yQgIOE7cI\r\nWCQgKLbVjOYsBGPXEy+6XXKtKi4aPCLiiKS+B22N8ykQJg2j4qTZ8sd3evi5\r\nS5/g9dc+ooue1kvu/bKl5KPLDNFNkHC/tjhQMirx/IT91F7s/dQHIfv7tgUH\r\na4wqO/NLJfcjKCFD0zfkpqK5OzpNE/oRP65tVfYVuCeI1tqSHWKxjltD7b5J\r\nCqWbklQDgsdzX0g+EZ3JDBowrAph8uNKRKTrJpbzHSQ2+hllsK+jh7/9lbFt\r\n4yct8qRXrxclk6UHTiFCYz9KJ8gWLhHQqOjK9MoiEHk53rq4R8buwJ0eNe9y\r\nbUPAhY7U7sqaK0jxiYbCM0d/bP/CkLw6mcinTHZchGEhRVgZ54eNgYP+tR/D\r\nyPJkRb4vAKhxivs5GjoppKorjCkIhJiIlA89IX5s6Ddgz6AZGtlWQch4Helw\r\nyjtdJjjAFqakeQ3YbyVzaf0PGWix/aKokKECoV0Gpka4QPpT5T7539IfjIFg\r\n7Zo7FlwRC0qxVMFExt6NfxGPgUToiorxG9I=\r\n=Pf5s\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"edilsondmorais","email":"edilsondmorais@yahoo.com.br"},"directories":{},"maintainers":[{"name":"edilsondmorais","email":"edilsondmorais@yahoo.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scaffolder-backend-module-azure-pipelines_0.4.6_1678738766510_0.059266003781621945"},"_hasShrinkwrap":false}},"maintainers":[{"name":"edilsondmorais","email":"edilsondmorais@yahoo.com.br"}],"description":"A collection of Backstage scaffolder backend modules for Azure pipelines.","homepage":"https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines#readme","keywords":["backstage","azure-devops","azure-pipelines","backstage-plugin","backstage-template"],"repository":{"type":"git","url":"git+https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines.git"},"author":{"name":"Edilson S Morais"},"bugs":{"url":"https://github.com/edilsondmorais/scaffolder-backend-module-azure-pipelines/issues"},"license":"Apache-2.0","readme":"# scaffolder-backend-module-azure-pipelines\n\nWelcome to the Microsoft Azure pipeline actions for the `scaffolder-backend`.\n\nThis plugin contains a collection of actions:\n\n- `azure:pipeline:create`\n- `azure:pipeline:run`\n- `azure:pipeline:permit`\n\nIt utilizes Azure DevOps REST APIs to\n[create](https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.1),\n[run](https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run-pipeline?view=azure-devops-rest-6.1),\nand\n[authorize](https://docs.microsoft.com/en-us/rest/api/azure/devops/approvalsandchecks/pipeline-permissions/update-pipeline-permisions-for-resource?view=azure-devops-rest-7.1)\nAzure pipelines.\n\n## Getting started\n\nCreate your Backstage application using the Backstage CLI as described here:\n<https://backstage.io/docs/getting-started/create-an-app>.\n\n> Note: If you are using this plugin in a Backstage monorepo that contains the\n> code for `@backstage/plugin-scaffolder-backend`, you need to modify your\n> internal build processes to transpile files from the `node_modules` folder as\n> well.\n\nYou need to configure the actions in your backend:\n\n## From your Backstage root directory\n\n```sh\n# From your Backstage root directory\nyarn add --cwd packages/backend @parfuemerie-douglas/scaffolder-backend-module-azure-pipelines\n```\n\nConfigure the actions (you can check the\n[docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions)\nto see all options):\n\n```typescript\n// packages/backend/src/plugins/scaffolder.ts\n\nimport {\n  createAzurePipelineAction,\n  permitAzurePipelineAction,\n  runAzurePipelineAction,\n} from \"@parfuemerie-douglas/scaffolder-backend-module-azure-pipelines\";\n\nconst actions = [\n  createAzurePipelineAction({ integrations }),\n  permitAzurePipelineAction({ integrations }),\n  runAzurePipelineAction({ integrations }),\n  ...createBuiltInActions({\n    containerRunner,\n    catalogClient,\n    integrations,\n    config: env.config,\n    reader: env.reader,\n  }),\n];\n\nreturn await createRouter({\n  containerRunner,\n  catalogClient,\n  actions,\n  logger: env.logger,\n  config: env.config,\n  database: env.database,\n  reader: env.reader,\n});\n```\n\nThe Azure pipeline actions use an [Azure PAT (personal access\ntoken)](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate)\nfor authorization. The PAT requires `Read & execute` permission for `Build` for\nthe `azure:pipeline:create` and `azure:pipeline:run` actions. For the\n`azure:pipeline:permit` action the PAT requires `Read, query, & manage`\npermission for `Service Connections`. Simply add the PAT to your\n`app-config.yaml`:\n\n```yaml\n# app-config.yaml\n\nintegrations:\n  azure:\n    - host: dev.azure.com\n      token: ${AZURE_TOKEN}\n```\n\nRead more on integrations in Backstage in the [Integrations\ndocumentation](https://backstage.io/docs/integrations/).\n\n## Using the template\n\nAfter loading and configuring the Azure pipeline template actions, you can use\nthe actions in your template:\n\n```yaml\n# template.yaml\n\napiVersion: scaffolder.backstage.io/v1beta3\nkind: Template\nmetadata:\n  name: create-azure-pipeline-demo\n  title: Create Azure Pipeline Test\n  description: Create Azure pipeline example\nspec:\n  owner: parfuemerie-douglas\n  type: service\n\n  parameters:\n    - title: Fill in some steps\n      required:\n        - name\n        - owner\n      properties:\n        name:\n          title: Project name\n          type: string\n          description: Choose a unique project name.\n          ui:field: EntityNamePicker\n          ui:autofocus: true\n        owner:\n          title: Owner\n          type: string\n          description: Select an owner for the Backstage component.\n          ui:field: OwnerPicker\n          ui:options:\n            allowedKinds:\n              - Group\n    - title: Choose a location\n      description: >-\n        Organization is an Azure DevOps organization. Owner is an Azure DevOps project.\n        Repository is the name of the repository Backstage will create for you.\n      required:\n        - repoUrl\n      properties:\n        repoUrl:\n          title: Repository Location\n          type: string\n          ui:field: RepoUrlPicker\n          ui:options:\n            allowedHosts:\n              - dev.azure.com\n\n  steps:\n    - id: fetch\n      name: Template Skeleton\n      action: fetch:template\n      input:\n        url: ./skeleton\n        values:\n          name: ${{ parameters.name }}\n          destination: ${{ parameters.repoUrl | parseRepoUrl }}\n          owner: ${{ parameters.owner }}\n\n    - id: publish\n      name: Publish\n      action: publish:azure\n      input:\n        allowedHosts: [\"dev.azure.com\"]\n        description: This is ${{ parameters.name }}\n        repoUrl: ${{ parameters.repoUrl }}\n\n    - id: createAzurePipeline\n      name: Create Azure Pipeline\n      action: azure:pipeline:create\n      input:\n        organization: ${{ (parameters.repoUrl | parseRepoUrl)['organization'] }}\n        project: ${{ (parameters.repoUrl | parseRepoUrl)['owner'] }}\n        folder: \"my-azure-pipelines-folder\"\n        name: ${{ parameters.name }}\n        repositoryId: ${{ steps.publish.output.repositoryId }}\n        repositoryName: ${{ (parameters.repoUrl | parseRepoUrl)['repo'] }}\n        yamlPath: <optional value to your azure pipelines yaml file, defaults to ./azure-pipelines.yaml>\n\n    - id: runAzurePipeline\n      name: Run Azure Pipeline\n      action: azure:pipeline:run\n      input:\n        organization: ${{ (parameters.repoUrl | parseRepoUrl)['organization'] }}\n        pipelineId: ${{ steps.createAzurePipeline.output.pipelineId }}\n        project: ${{ (parameters.repoUrl | parseRepoUrl)['owner'] }}\n\n    - id: permitAzurePipeline\n      name: Change Azure Pipeline Permissions\n      action: azure:pipeline:permit\n      input:\n        organization: ${{ (parameters.repoUrl | parseRepoUrl)['organization'] }}\n        project: ${{ (parameters.repoUrl | parseRepoUrl)['owner'] }}\n        resourceId: <serviceEndpointId>\n        resourceType: endpoint\n        authorized: true\n        pipelineId: ${{ steps.createAzurePipeline.output.pipelineId }}\n\n    - id: register\n      name: Register\n      action: catalog:register\n      input:\n        repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}\n        catalogInfoPath: \"/catalog-info.yaml\"\n\n  output:\n    links:\n      - title: Repository\n        url: ${{ steps.publish.output.remoteUrl }}\n      - title: Pipeline\n        url: ${{ steps.createAzurePipeline.output.pipelineUrl }}\n      - title: Open in catalog\n        icon: catalog\n        entityRef: ${{ steps.register.output.entityRef }}\n```\n\n**_Note_**: The `azure:pipeline:permit` action authorizes/unauthorizes a\npipeline for a given resource. To authorize a pipeline for a [service\nendpoint](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview)\nset `resourceType` to `endpoint`, provide `resourceId` with the service endpoint\nID (replace `<serviceEndpointId>` in the example code above), and set authorized\nto `true`.\n\nYou can find a list of all registred actions including their parameters at the\n`/create/actions` route in your Backstage application.\n\n**_Note_**: The `azure:pipeline:run`\nit was necessary to generate a new tag 0.4.4 tando publish NPM the recent changes, after version 0.4.3","readmeFilename":"README.md"}