initial commit

Change-Id: Id0b2c1cad10ede7d7ab11fd7951ad0342a5c1b54
This commit is contained in:
Scaffolder 2026-05-20 16:58:31 +00:00
commit 62c2091ba5
6 changed files with 102 additions and 0 deletions

24
.tekton/pipeline.yaml Normal file
View File

@ -0,0 +1,24 @@
# Reuses the cluster-wide build-sign-deploy Pipeline in the demo-secure namespace.
# To run on every push, install OpenShift Pipelines as Code or fire the EventListener
# in demo-secure with the right git-revision.
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: new-go-app9-
namespace: new-go-app9
spec:
pipelineRef:
name: build-sign-deploy
namespace: demo-secure
serviceAccountName: pipeline
params:
- name: image
value: image-registry.openshift-image-registry.svc:5000/new-go-app9/new-go-app9:latest
workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 2Gi

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM registry.access.redhat.com/ubi9/go-toolset:1.22 AS build
WORKDIR /opt/app-root/src
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /tmp/app .
FROM registry.access.redhat.com/ubi9-minimal:latest
COPY --from=build /tmp/app /usr/local/bin/app
USER 1001
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/app"]

28
argocd-app.yaml Normal file
View File

@ -0,0 +1,28 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: new-go-app9
namespace: openshift-gitops
labels:
category: app
spec:
project: default
source:
repoURL:
targetRevision: master
path: deploy
destination:
server: https://kubernetes.default.svc
namespace: new-go-app9
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/template/spec/containers/0/image
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true

14
catalog-info.yaml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: new-go-app9
description: new demo go app
annotations:
backstage.io/kubernetes-id: new-go-app9
backstage.io/kubernetes-namespace: new-go-app9
janus-idp.io/tekton: new-go-app9
argocd/app-name: new-go-app9
spec:
type: service
lifecycle: experimental
owner: platform

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module new-go-app9
go 1.22

23
main.go Normal file
View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
fmt.Fprintf(w, "hello from new-go-app9\n")
})
http.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
})
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
log.Printf("new-go-app9 listening on :%s", port)
log.Fatal(http.ListenAndServe(":"+port, nil))
}