diff --git a/.tekton/test-pac-component-pull-request.yaml b/.tekton/test-pac-component-pull-request.yaml new file mode 100644 index 00000000..448fc5c7 --- /dev/null +++ b/.tekton/test-pac-component-pull-request.yaml @@ -0,0 +1,39 @@ +apiVersion: tekton.dev/v1beta1 +kind: PipelineRun +metadata: + annotations: + build.appstudio.redhat.com/commit_sha: '{{revision}}' + build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' + build.appstudio.redhat.com/target_branch: '{{target_branch}}' + pipelinesascode.tekton.dev/max-keep-runs: "3" + pipelinesascode.tekton.dev/on-event: '[pull_request]' + pipelinesascode.tekton.dev/on-target-branch: '[main]' + creationTimestamp: null + labels: + build.appstudio.openshift.io/component: test-pac-component + name: test-pac-component-on-pull-request + namespace: test-pac +spec: + params: + - name: git-url + value: '{{repo_url}}' + - name: revision + value: '{{revision}}' + - name: output-image + value: quay.io/psturc/test-images:on-pr-{{revision}} + - name: path-context + value: . + - name: dockerfile + value: Dockerfile + pipelineRef: + bundle: quay.io/redhat-appstudio/pull-request-builds:hacbs-391c42c859b1c44ded3b4ed91d8985f8246421e2 + name: docker-build + workspaces: + - name: workspace + persistentVolumeClaim: + claimName: appstudio + subPath: test-pac-component-on-pull-request-{{revision}} + - name: registry-auth + secret: + secretName: redhat-appstudio-registry-pull-secret +status: {} diff --git a/.tekton/test-pac-component-push.yaml b/.tekton/test-pac-component-push.yaml new file mode 100644 index 00000000..f3c3a761 --- /dev/null +++ b/.tekton/test-pac-component-push.yaml @@ -0,0 +1,38 @@ +apiVersion: tekton.dev/v1beta1 +kind: PipelineRun +metadata: + annotations: + build.appstudio.redhat.com/commit_sha: '{{revision}}' + build.appstudio.redhat.com/target_branch: '{{target_branch}}' + pipelinesascode.tekton.dev/max-keep-runs: "3" + pipelinesascode.tekton.dev/on-event: '[push]' + pipelinesascode.tekton.dev/on-target-branch: '[main]' + creationTimestamp: null + labels: + build.appstudio.openshift.io/component: test-pac-component + name: test-pac-component-on-push + namespace: test-pac +spec: + params: + - name: git-url + value: '{{repo_url}}' + - name: revision + value: '{{revision}}' + - name: output-image + value: quay.io/psturc/test-images:{{revision}} + - name: path-context + value: . + - name: dockerfile + value: Dockerfile + pipelineRef: + bundle: quay.io/redhat-appstudio/pull-request-builds:hacbs-391c42c859b1c44ded3b4ed91d8985f8246421e2 + name: docker-build + workspaces: + - name: workspace + persistentVolumeClaim: + claimName: appstudio + subPath: test-pac-component-on-push-{{revision}} + - name: registry-auth + secret: + secretName: redhat-appstudio-registry-pull-secret +status: {} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5d4fd2d4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.16-alpine + +WORKDIR /app + +COPY go.mod ./ +RUN go mod download + +COPY *.go ./ + +RUN go build -o /main + +EXPOSE 8081 + +CMD [ "/main" , "-p=8081"]