Add repourlpicker and publisher for bitbucket cloud

The bitbucket cloud api needs project key to create repo under
a project.

Signed-off-by: Mustansar Anwar ul Samad <mustansar.samad@gmail.com>
This commit is contained in:
Mustansar Anwar ul Samad
2021-04-19 13:18:18 +12:00
parent 0c58dd73d0
commit 9b41ea27b6
14 changed files with 857 additions and 0 deletions
@@ -0,0 +1,75 @@
apiVersion: backstage.io/v1beta2
kind: Template
metadata:
name: bitbucket-cloud
title: Test Bitbucket Cloud RepoUrlPicker template
description: scaffolder v1beta2 template demo publishing to bitbucket cloud
spec:
owner: backstage/techdocs-core
type: service
parameters:
- title: Choose a location
required:
- repoUrl
properties:
repoUrl:
title: Repository Location
type: string
ui:field: RepoUrlPickerBitbucketCloud
- title: Fill in some steps
required:
- name
- owner
properties:
name:
title: Name
type: string
description: Unique name of the component
ui:autofocus: true
ui:options:
rows: 5
owner:
title: Owner
type: string
description: Owner of the component
ui:field: OwnerPicker
ui:options:
allowedKinds:
- Group
steps:
- id: fetch-base
name: Fetch Base
action: fetch:cookiecutter
input:
url: ./template
values:
name: '{{ parameters.name }}'
owner: '{{ parameters.owner }}'
- id: fetch-docs
name: Fetch Docs
action: fetch:plain
input:
targetPath: ./community
url: https://github.com/backstage/community/tree/main/backstage-community-sessions
- id: publish
name: Publish
action: publish:bitbucketcloud
input:
allowedHosts: ['bitbucket.org']
description: 'This is {{ parameters.name }}'
repoUrl: '{{ parameters.repoUrl }}'
- id: register
name: Register
action: catalog:register
input:
repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}'
catalogInfoPath: '/catalog-info.yaml'
output:
remoteUrl: '{{ steps.publish.output.remoteUrl }}'
entityRef: '{{ steps.register.output.entityRef }}'
@@ -0,0 +1,8 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: {{cookiecutter.name | jsonify}}
spec:
type: website
lifecycle: experimental
owner: {{cookiecutter.owner | jsonify}}
@@ -0,0 +1,14 @@
apiVersion: backstage.io/v1alpha1
kind: Location
metadata:
name: example-templates-local
description: A collection of locally available Backstage example templates
spec:
targets:
- ./create-react-app/template.yaml
- ./docs-template/template.yaml
- ./react-ssr-template/template.yaml
- ./springboot-grpc-template/template.yaml
- ./v1beta2-demo/template.yaml
- ./pull-request/template.yaml
- ./bitbucket-cloud-demo/template.yaml