Skip to content

Commit

Permalink
Adds script to create a release using Tekton
Browse files Browse the repository at this point in the history
Signed-off-by: Shivam Mukhade <[email protected]>
  • Loading branch information
SM43 committed Mar 5, 2021
1 parent 9dc8a9e commit 882770f
Show file tree
Hide file tree
Showing 22 changed files with 727 additions and 18 deletions.
1 change: 0 additions & 1 deletion config/00-init/01-db-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: v1
kind: Secret
metadata:
name: db
namespace: tekton-hub
labels:
app: db
type: Opaque
Expand Down
1 change: 0 additions & 1 deletion config/00-init/02-db-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db
namespace: tekton-hub
labels:
app: db
spec:
Expand Down
1 change: 0 additions & 1 deletion config/00-init/03-db-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: db
namespace: tekton-hub
labels:
app: db
spec:
Expand Down
1 change: 0 additions & 1 deletion config/00-init/04-db-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: v1
kind: Service
metadata:
name: db
namespace: tekton-hub
labels:
app: db
spec:
Expand Down
1 change: 0 additions & 1 deletion config/01-db/10-db-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: batch/v1
kind: Job
metadata:
name: db-migration
namespace: tekton-hub
labels:
app: db
spec:
Expand Down
1 change: 0 additions & 1 deletion config/02-api/20-api-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: v1
kind: Secret
metadata:
name: api
namespace: tekton-hub
type: Opaque
stringData:
GH_CLIENT_ID: ''
Expand Down
1 change: 0 additions & 1 deletion config/02-api/21-api-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: api
namespace: tekton-hub
labels:
app: api
data:
Expand Down
1 change: 0 additions & 1 deletion config/02-api/22-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: tekton-hub
labels:
app: api
spec:
Expand Down
1 change: 0 additions & 1 deletion config/02-api/23-api-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ apiVersion: v1
kind: Service
metadata:
name: api
namespace: tekton-hub
labels:
app: api
spec:
Expand Down
1 change: 0 additions & 1 deletion config/03-ui/30-ui-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: ui
namespace: tekton-hub
data:
API_URL: 'https://api.hub.tekton.dev'
GH_CLIENT_ID: ''
1 change: 0 additions & 1 deletion config/03-ui/31-ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: ui
namespace: tekton-hub
labels:
app: ui
spec:
Expand Down
1 change: 0 additions & 1 deletion config/03-ui/32-ui-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: v1
kind: Service
metadata:
name: ui
namespace: tekton-hub
labels:
app: ui
spec:
Expand Down
1 change: 0 additions & 1 deletion config/04-kubernetes/40-api-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
acme.cert-manager.io/http01-edit-in-place: 'true'
cert-manager.io/cluster-issuer: letsencrypt-prod
name: api
namespace: tekton-hub
spec:
rules:
- http:
Expand Down
1 change: 0 additions & 1 deletion config/04-kubernetes/41-ui-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ui
namespace: tekton-hub
annotations:
acme.cert-manager.io/http01-edit-in-place: 'true'
cert-manager.io/cluster-issuer: letsencrypt-prod
Expand Down
1 change: 0 additions & 1 deletion config/04-openshift/40-api-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: api
namespace: tekton-hub
labels:
app: api
spec:
Expand Down
1 change: 0 additions & 1 deletion config/04-openshift/41-ui-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ui
namespace: tekton-hub
spec:
to:
kind: Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: v1
kind: Secret
metadata:
name: catalog-refresh
namespace: tekton-hub
type: Opaque
stringData:
HUB_TOKEN: ""
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: catalog-refresh
namespace: tekton-hub
labels:
app: api
spec:
Expand Down
95 changes: 95 additions & 0 deletions tekton/api/golang-db-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Copyright © 2021 The Tekton Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: golang-db-test
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: test
tekton.dev/displayName: "golang test"
spec:
description: >-
This Task is Golang task to test Go projects.
params:
- name: package
description: package (and its children) under test
- name: packages
description: "packages to test (default: ./...)"
default: "./..."
- name: path_context
description: path to the directory to use as context.
default: "."
- name: version
description: golang version to use for tests
default: "latest"
- name: flags
description: flags to use for the test command
default: -race -cover -v
- name: GOOS
description: "running program's operating system target"
default: linux
- name: GOARCH
description: "running program's architecture target"
default: amd64
- name: GO111MODULE
description: "value of module support"
default: auto
workspaces:
- name: source
steps:
- name: unit-test
image: docker.io/library/golang:$(params.version)
script: |
SRC_PATH="$GOPATH/src/$(params.package)/$(params.path_context)"
mkdir -p $SRC_PATH
cp -R "$(workspaces.source.path)"/"$(params.path_context)"/* $SRC_PATH
cd $SRC_PATH
go test $(params.flags) $(params.packages)
env:
- name: GOOS
value: "$(params.GOOS)"
- name: GOARCH
value: "$(params.GOARCH)"
- name: GO111MODULE
value: "$(params.GO111MODULE)"
- name: POSTGRES_HOST
value: localhost
- name: POSTGRES_DB
value: hub_test
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: POSTGRES_PORT
value: "5432"
sidecars:
- image: postgres:13@sha256:260a98d976574b439712c35914fdcb840755233f79f3e27ea632543f78b7a21e
name: db
ports:
- containerPort: 5432
protocol: TCP
env:
- name: POSTGRES_DB
value: hub_test
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
Loading

0 comments on commit 882770f

Please sign in to comment.