{"_id":"@cmoulliard/plugin-scaffolder-backend-module-gitea","name":"@cmoulliard/plugin-scaffolder-backend-module-gitea","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@cmoulliard/plugin-scaffolder-backend-module-gitea","version":"0.1.0","description":"The gitea module for @backstage/plugin-scaffolder-backend","backstage":{"role":"backend-plugin-module"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/backstage/backstage.git","directory":"plugins/scaffolder-backend-module-gitea"},"license":"Apache-2.0","exports":{".":"./src/index.ts","./package.json":"./package.json"},"main":"src/index.ts","types":"src/index.ts","typesVersions":{"*":{"package.json":["package.json"]}},"scripts":{"build":"backstage-cli package build","clean":"backstage-cli package clean","lint":"backstage-cli package lint","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack","start":"backstage-cli package start","test":"backstage-cli package test"},"dependencies":{"@backstage/backend-plugin-api":"workspace:^","@backstage/config":"workspace:^","@backstage/errors":"workspace:^","@backstage/integration":"workspace:^","@backstage/plugin-scaffolder-node":"workspace:^","node-fetch":"^2.6.7","yaml":"^2.0.0"},"devDependencies":{"@backstage/backend-test-utils":"workspace:^","@backstage/cli":"workspace:^","@backstage/plugin-scaffolder-node-test-utils":"workspace:^","msw":"^1.0.0"},"_id":"@cmoulliard/plugin-scaffolder-backend-module-gitea@0.1.0","gitHead":"a69da355927a5a00341b23209658b28ce9de4851","bugs":{"url":"https://github.com/backstage/backstage/issues"},"homepage":"https://github.com/backstage/backstage#readme","_nodeVersion":"20.11.0","_npmVersion":"10.3.0","dist":{"integrity":"sha512-bok0YyWLcjkG+/vw29z6dwFn/DsO76ohZnAa4vEqhUhA6RnA3qKTyTFCdYMxl5iajJT6RRDmYjZNnRXBRmHLBQ==","shasum":"27200045f2aaf09af21cb7c3a9d845115533b9c7","tarball":"https://registry.npmjs.org/@cmoulliard/plugin-scaffolder-backend-module-gitea/-/plugin-scaffolder-backend-module-gitea-0.1.0.tgz","fileCount":5,"unpackedSize":47517,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDar3NCIEodiERbcffxRy+pLkrSExdQbwy7qsUnW19hvwIhAMZdFEGF9FmFYyztjj0AyUg1JhZjiYgk1oKgr1rA4f7t"}]},"_npmUser":{"name":"cmoulliard","email":"cmoulliard@redhat.com"},"directories":{},"maintainers":[{"name":"cmoulliard","email":"cmoulliard@redhat.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-scaffolder-backend-module-gitea_0.1.0_1713460117889_0.9602639743391426"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-18T17:08:37.778Z","0.1.0":"2024-04-18T17:08:38.065Z","modified":"2024-04-18T17:08:38.359Z"},"maintainers":[{"name":"cmoulliard","email":"cmoulliard@redhat.com"}],"description":"The gitea module for @backstage/plugin-scaffolder-backend","homepage":"https://github.com/backstage/backstage#readme","repository":{"type":"git","url":"git+https://github.com/backstage/backstage.git","directory":"plugins/scaffolder-backend-module-gitea"},"bugs":{"url":"https://github.com/backstage/backstage/issues"},"license":"Apache-2.0","readme":"# scaffolder-backend-module-gitea\n\nWelcome to the `publish:gitea` action of the `scaffolder-gitea-backend`.\n\n## Getting started\n\nTo use this action, you will have to add the package using the following command to be executed at the root of your backstage project:\n\n```bash\nyarn --cwd packages/backend add @backstage/plugin-scaffolder-backend-module-gitea\n```\n\nConfigure the action (if not yet done):\n(you can check the [docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions) to see all options):\n\nBefore to create a template, include to your `app-config.yaml` file the\ngitea host and credentials under the `integrations:` section\n\n```yaml\nintegrations:\n  gitea:\n    - host: gitea.com\n      username: '<GITEA_USER>'\n      password: '<GITEA_PASSWORD>'\n    - host: localhost:3333\n      username: '<GITEA_LOCALHOST_USER>'\n      password: '<GITEA_LOCALHOST_PASSWORD>'\n```\n\n**Important**: As backstage will issue HTTPS/TLS requests to the gitea instance, it is needed to configure `gitea` with a valid certificate or at least with a\nself-signed certificate `gitea cert --host localhost -ca` trusted by a CA authority. Don't forget to set the env var `NODE_EXTRA_CA_CERTS` to point to the CA file before launching backstage !\n\nWhen done, you can create a template which:\n\n- Declare the `RepoUrlPicker` within the `spec/parameters` section to select the gitea hosts\n- Include a step able to publish by example the newly generated project using the action `action: publish:gitea`\n\n```yaml\napiVersion: scaffolder.backstage.io/v1beta3\nkind: Template\nmetadata:\n  name: quarkus-web-template\n  title: Quarkus Hello world\n  description: Create a simple microservice using Quarkus\n  tags:\n    - java\n    - quarkus\nspec:\n  owner: quarkus\n  type: service\n  parameters:\n    - title: Git repository Information\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              - gitea.<YOUR_DOMAIN>:<PORT>\n              - localhost:<PORT>\n\n  steps:\n    - id: template\n      name: Generating component\n      action: fetch:template\n      input:\n        url: ./skeleton\n        values:\n          name: ${{ parameters.name }}\n\n    - id: publish\n      name: Publishing to a gitea git repository\n      action: publish:gitea\n      input:\n        description: This is ${{ parameters.component_id }}\n        repoUrl: ${{ parameters.repoUrl }}\n        defaultBranch: main\n\n    - id: register\n      if: ${{ parameters.dryRun !== true }}\n      name: Register\n      action: catalog:register\n      input:\n        repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }}\n        catalogInfoPath: 'main/catalog-info.yaml'\n\n  output:\n    links:\n      - title: Source Code Repository\n        url: ${{ steps.publish.output.remoteUrl }}\n      - title: Open Component in catalog\n        icon: catalog\n        entityRef: ${{ steps.register.output.entityRef }}\n```\n\nAccess the newly gitea repository created using the `repoContentsUrl` ;-)\n","readmeFilename":"README.md"}