Skip to content

Commit 3148575

Browse files
Merge pull request #652 from dperaza4dustbit/consolidate_ci
Consolidate ci
2 parents 59c2dab + 86a685d commit 3148575

File tree

286 files changed

+90116
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+90116
-0
lines changed

samples/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# macOS
2+
.DS_Store
3+
properties.local

samples/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# RHTAP Sample Backstage Templates
2+
3+
## Software Supply Chain Security
4+
5+
This repository provides a suite of language/framework examples that implement end-to-end software supply chain security (SSCS).
6+
7+
The examples contain an advanced continuous integration pipeline covering building, CVE scanning, security scanning, signatures, attestations, SLSA provenance and SBOM along with Gitops-based continuous deployment.
8+
9+
Software Template authors and IDP builders can take these samples to create their own SSCS based starters.
10+
11+
## Usage in Red Hat Developer Hub
12+
13+
To import these templates, register a component in on the golden path template page:
14+
15+
![Screenshot](register.png)
16+
17+
Import `https://github.com/redhat-appstudio/tssc-sample-templates/blob/main/all.yaml`
18+
19+
![Screenshot](register2.png)
20+
21+
## Usage in backstage
22+
23+
Add the following to your `app-config.yaml` file in your backstage configuration:
24+
25+
```yaml
26+
- type: url
27+
target: https://github.com/redhat-appstudio/tssc-sample-templates/blob/main/all.yaml
28+
rules:
29+
- allow: [Location, Template]
30+
```
31+
32+
This will add the samples into a set of backstage templates.
33+
34+
![Screenshot](backstage.png)
35+
36+
## On-prem host support
37+
38+
You need to ensure the on-prem host is being configured in `app-config.yaml` file in your backstage/RHDH configuration.
39+
40+
### Change default host for Git or Quay
41+
42+
[properties](./properties) file holds the default host for GitHub, GitLab and Quay.
43+
44+
Modify the value and run `./generate.sh` will generate new templates with customized default value.
45+
46+
### Provide on-prem host value when create a component
47+
48+
On `Application Repository Information` Page, provide your Git host in the `Repository Server`
49+
50+
**Note:** Please Ensure the correct `Host Type` is selected
51+
52+
![Screenshot](on-prem-git.png)
53+
54+
On `Deployment information` Page, provide your Quay host in the `Image Registry`:
55+
56+
![Screenshot](on-prem-quay.png)
57+
58+
## Contributing
59+
60+
The templates are found in `./templates` and reference reusable content in `./skeleton`.
61+
62+
The pipelines are maintained externally to allow standalone use outside of software templates, as well as evolution of the pipelines in one of more software templates.
63+
64+
### MacOS
65+
66+
Due to differences between Linux and MacOS, the GNU version of `sed` is required to be installed.
67+
68+
```bash
69+
brew install gnu-sed
70+
```
71+
72+
After this, alter PATH. For example, add the following line to your `~/.bash_profile`:
73+
74+
```bash
75+
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
76+
```

samples/all.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: backstage.io/v1alpha1
2+
kind: Location
3+
metadata:
4+
name: tssc-all
5+
description: TSSC Application Samples
6+
spec:
7+
targets:
8+
- ./templates/dotnet/template.yaml
9+
- ./templates/generic-import-from-repo/template.yaml
10+
- ./templates/go/template.yaml
11+
- ./templates/java-quarkus/template.yaml
12+
- ./templates/java-springboot/template.yaml
13+
- ./templates/nodejs/template.yaml
14+
- ./templates/python/template.yaml

samples/backstage.png

1.03 MB
Loading

samples/generate.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
5+
# pull in latest pipeline run definition
6+
$ROOTDIR/scripts/update-tekton-definition
7+
8+
# update generated files in templates
9+
$ROOTDIR/scripts/update-templates
10+
11+
# get gitops templates
12+
echo SKIP $ROOTDIR/scripts/import-gitops-template

samples/on-prem-git.png

46.7 KB
Loading

samples/on-prem-quay.png

33.8 KB
Loading

samples/properties

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# PE can replace these values with on-prem host
2+
export GITHUB__DEFAULT__HOST=github.com
3+
export GITLAB__DEFAULT__HOST=gitlab.com
4+
export BITBUCKET__DEFAULT__HOST=bitbucket.org
5+
6+
export QUAY__DEFAULT__HOST=quay.io
7+
8+
# leave empty if you don't want to set defaults for your git or quay org
9+
export GITHUB__DEFAULT__ORG=""
10+
export GITLAB__DEFAULT__ORG=""
11+
export BITBUCKET__DEFAULT__ORG=""
12+
export QUAY__DEFAULT__ORG=""
13+
14+
# PE can replace these values with own pipeline fork
15+
export PIPELINE__REPO__URL=https://github.com/redhat-appstudio/tssc-dev-multi-ci
16+
export PIPELINE__REPO__BRANCH=main
17+
18+
export DEFAULT__DEPLOYMENT__NAMESPACE__PREFIX=tssc-app
19+
20+
export RHTAP__DEFAULT__NAMESPACE=tssc
21+
export ARGOCD__DEFAULT__NAMESPACE=tssc-gitops
22+
export ARGOCD__DEFAULT__INSTANCE=default
23+
export ARGOCD__DEFAULT__PROJECT=default
24+
25+
26+
# For secret reference in Repository CRs
27+
# Secret will be prefixed by CI name, gitops (for github), or gitlab, or bitbucket in template
28+
# export GIT__SECRET__DEFAULT__NAME=auth-secret
29+
export GIT__SECRET__DEFAULT__KEY=password
30+
export WEBHOOK__SECRET__DEFAULT__NAME=pipelines-secret
31+
export WEBHOOK__SECRET__DEFAULT__KEY=webhook.secret
32+
33+
# compute the template tag to set defaults, leave empty if not set
34+
if [ ! -z "${GITHUB__DEFAULT__ORG}" ]; then
35+
export DEFAULT_ORG_FOR_GITHUB="default: $GITHUB__DEFAULT__ORG"
36+
fi
37+
if [ ! -z "${GITLAB__DEFAULT__ORG}" ]; then
38+
export DEFAULT_ORG_FOR_GITLAB="default: $GITLAB__DEFAULT__ORG"
39+
fi
40+
if [ ! -z "${BITBUCKET__DEFAULT__ORG}" ]; then
41+
export DEFAULT_ORG_FOR_BITBUCKET="default: $BITBUCKET__DEFAULT__ORG"
42+
fi
43+
if [ ! -z "${QUAY__DEFAULT__ORG}" ]; then
44+
export DEFAULT_ORG_FOR_QUAY="default: $QUAY__DEFAULT__ORG"
45+
fi

samples/register.png

215 KB
Loading

samples/register2.png

103 KB
Loading

0 commit comments

Comments
 (0)