Skip to content

Commit

Permalink
Merge pull request #189 from schemahero/issue/134
Browse files Browse the repository at this point in the history
Add shell command
  • Loading branch information
marccampbell committed May 26, 2020
2 parents e51c055 + 86cff64 commit 6f1926e
Show file tree
Hide file tree
Showing 112 changed files with 1,766 additions and 768 deletions.
41 changes: 4 additions & 37 deletions .github/workflows/build-and-test.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/setup-go@v1.1.2
with:
go-version: "1.14.1"
go-version: "1.14.3"
- name: setup goenv
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
Expand All @@ -31,7 +31,6 @@ jobs:
name: kubectl-schemahero
path: bin/kubectl-schemahero

## We list each here so that they all show up in the output of github checks
test-postgres:
runs-on: ubuntu-latest
needs: build
Expand All @@ -43,19 +42,8 @@ jobs:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/postgres/column-set-default run
- run: make -C integration/tests/postgres/column-unset-default run
- run: make -C integration/tests/postgres/create-table run
- run: make -C integration/tests/postgres/foreign-key-create run
- run: make -C integration/tests/postgres/foreign-key-action run
- run: make -C integration/tests/postgres/foreign-key-drop run
- run: make -C integration/tests/postgres/foreign-key-alter run
- run: make -C integration/tests/postgres/not-null run
- run: make -C integration/tests/postgres/index-create run
- run: make -C integration/tests/postgres/primary-key-add run
- run: make -C integration/tests/postgres/primary-key-drop run
- run: make -C integration/tests/postgres run

## We list each here so that they all show up in the output of github checks
test-mysql:
runs-on: ubuntu-latest
needs: build
Expand All @@ -67,19 +55,8 @@ jobs:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/mysql/column-set-default run
- run: make -C integration/tests/mysql/column-unset-default run
- run: make -C integration/tests/mysql/create-table run
- run: make -C integration/tests/mysql/foreign-key-create run
- run: make -C integration/tests/mysql/foreign-key-action run
- run: make -C integration/tests/mysql/foreign-key-drop run
- run: make -C integration/tests/mysql/foreign-key-alter run
- run: make -C integration/tests/mysql/not-null run
- run: make -C integration/tests/mysql/index-create run
- run: make -C integration/tests/mysql/primary-key-add run
- run: make -C integration/tests/mysql/primary-key-drop run
- run: make -C integration/tests/mysql run

## We list each here so that they all show up in the output of github checks
test-cockroach:
runs-on: ubuntu-latest
needs: build
Expand All @@ -91,17 +68,7 @@ jobs:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/cockroach/column-set-default run
- run: make -C integration/tests/cockroach/column-unset-default run
- run: make -C integration/tests/cockroach/create-table run
- run: make -C integration/tests/cockroach/foreign-key-create run
- run: make -C integration/tests/cockroach/foreign-key-action run
- run: make -C integration/tests/cockroach/foreign-key-drop run
- run: make -C integration/tests/cockroach/foreign-key-alter run
- run: make -C integration/tests/cockroach/not-null run
- run: make -C integration/tests/cockroach/index-create run
- run: make -C integration/tests/cockroach/primary-key-add run
- run: make -C integration/tests/cockroach/primary-key-drop run
- run: make -C integration/tests/cockroach run

kots:
runs-on: ubuntu-latest
Expand Down
43 changes: 5 additions & 38 deletions .github/workflows/tagged-release.yaml
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/setup-go@v1.1.2
with:
go-version: "1.14.1"
go-version: "1.14.3"
- name: setup goenv
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
Expand All @@ -30,7 +30,6 @@ jobs:
name: kubectl-schemahero
path: bin/kubectl-schemahero

## We list each here so that they all show up in the output of github checks
test-postgres:
runs-on: ubuntu-latest
needs: build
Expand All @@ -42,19 +41,8 @@ jobs:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/postgres/column-set-default run
- run: make -C integration/tests/postgres/column-unset-default run
- run: make -C integration/tests/postgres/create-table run
- run: make -C integration/tests/postgres/foreign-key-create run
- run: make -C integration/tests/postgres/foreign-key-action run
- run: make -C integration/tests/postgres/foreign-key-drop run
- run: make -C integration/tests/postgres/foreign-key-alter run
- run: make -C integration/tests/postgres/not-null run
- run: make -C integration/tests/postgres/index-create run
- run: make -C integration/tests/postgres/primary-key-add run
- run: make -C integration/tests/postgres/primary-key-drop run
- run: make -C integration/tests/postgres run

## We list each here so that they all show up in the output of github checks
test-mysql:
runs-on: ubuntu-latest
needs: build
Expand All @@ -66,19 +54,8 @@ jobs:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/mysql/column-set-default run
- run: make -C integration/tests/mysql/column-unset-default run
- run: make -C integration/tests/mysql/create-table run
- run: make -C integration/tests/mysql/foreign-key-create run
- run: make -C integration/tests/mysql/foreign-key-action run
- run: make -C integration/tests/mysql/foreign-key-drop run
- run: make -C integration/tests/mysql/foreign-key-alter run
- run: make -C integration/tests/mysql/not-null run
- run: make -C integration/tests/mysql/index-create run
- run: make -C integration/tests/mysql/primary-key-add run
- run: make -C integration/tests/mysql/primary-key-drop run
- run: make -C integration/tests/mysql run

## We list each here so that they all show up in the output of github checks
test-cockroach:
runs-on: ubuntu-latest
needs: build
Expand All @@ -90,17 +67,7 @@ jobs:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/cockroach/column-set-default run
- run: make -C integration/tests/cockroach/column-unset-default run
- run: make -C integration/tests/cockroach/create-table run
- run: make -C integration/tests/cockroach/foreign-key-create run
- run: make -C integration/tests/cockroach/foreign-key-action run
- run: make -C integration/tests/cockroach/foreign-key-drop run
- run: make -C integration/tests/cockroach/foreign-key-alter run
- run: make -C integration/tests/cockroach/not-null run
- run: make -C integration/tests/cockroach/index-create run
- run: make -C integration/tests/cockroach/primary-key-add run
- run: make -C integration/tests/cockroach/primary-key-drop run
- run: make -C integration/tests/cockroach run

goreleaser:
runs-on: ubuntu-latest
Expand All @@ -114,7 +81,7 @@ jobs:
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1.1.2
with:
go-version: "1.14.1"
go-version: "1.14.3"
- uses: azure/docker-login@v1
with:
username: schemaherodeploy
Expand Down
4 changes: 3 additions & 1 deletion config/crds/v1/databases.schemahero.io_databases.yaml
Expand Up @@ -16,7 +16,7 @@ spec:
singular: database
scope: Namespaced
versions:
- name: v1alpha3
- name: v1alpha4
schema:
openAPIV3Schema:
description: Database is the Schema for the databases API
Expand Down Expand Up @@ -133,6 +133,8 @@ spec:
type: object
type: object
type: object
disableShellCommand:
type: boolean
immediateDeploy:
type: boolean
schemahero:
Expand Down
6 changes: 4 additions & 2 deletions config/crds/v1beta1/databases.schemahero.io_databases.yaml
Expand Up @@ -133,6 +133,8 @@ spec:
type: object
type: object
type: object
disableShellCommand:
type: boolean
immediateDeploy:
type: boolean
schemahero:
Expand All @@ -159,9 +161,9 @@ spec:
required:
- spec
type: object
version: v1alpha3
version: v1alpha4
versions:
- name: v1alpha3
- name: v1alpha4
served: true
storage: true
status:
Expand Down
2 changes: 1 addition & 1 deletion config/dev/database/postgres-10.7.yaml
Expand Up @@ -4,7 +4,7 @@ data:
uri: cG9zdGdyZXM6Ly90ZXN0dXNlcjpwYXNzd29yZEBwb3N0Z3Jlc3FsOjU0MzIvdGVzdGRiP3NzbG1vZGU9ZGlzYWJsZQ==
kind: Secret
metadata:
name: postgresql-secret
name: postgresql
type: Opaque
---
apiVersion: v1
Expand Down
171 changes: 171 additions & 0 deletions config/dev/database/postgres-11.8.0.yaml
@@ -0,0 +1,171 @@
---
# Source: postgresql/templates/secrets.yaml
apiVersion: v1
kind: Secret
metadata:
name: postgresql
labels:
app: postgresql
chart: postgresql-8.10.0
release: "postgresql"
heritage: "Helm"
type: Opaque
data:
postgresql-password: "cGFzc3dvcmQ="
uri: cG9zdGdyZXM6Ly90ZXN0dXNlcjpwYXNzd29yZEBwb3N0Z3Jlc3FsOjU0MzIvdGVzdGRiP3NzbG1vZGU9ZGlzYWJsZQ==

---
# Source: postgresql/templates/svc-headless.yaml
apiVersion: v1
kind: Service
metadata:
name: postgresql-headless
labels:
app: postgresql
chart: postgresql-8.10.0
release: "postgresql"
heritage: "Helm"
spec:
type: ClusterIP
clusterIP: None
ports:
- name: tcp-postgresql
port: 5432
targetPort: tcp-postgresql
selector:
app: postgresql
release: "postgresql"
---
# Source: postgresql/templates/svc.yaml
apiVersion: v1
kind: Service
metadata:
name: postgresql
labels:
app: postgresql
chart: postgresql-8.10.0
release: "postgresql"
heritage: "Helm"
annotations:
spec:
type: ClusterIP
ports:
- name: tcp-postgresql
port: 5432
targetPort: tcp-postgresql
selector:
app: postgresql
release: "postgresql"
role: master
---
# Source: postgresql/templates/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql-postgresql
labels:
app: postgresql
chart: postgresql-8.10.0
release: "postgresql"
heritage: "Helm"
annotations:
spec:
serviceName: postgresql-headless
replicas: 1
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: postgresql
release: "postgresql"
role: master
template:
metadata:
name: postgresql
labels:
app: postgresql
chart: postgresql-8.10.0
release: "postgresql"
heritage: "Helm"
role: master
spec:
securityContext:
fsGroup: 1001
containers:
- name: postgresql
image: docker.io/bitnami/postgresql:11.8.0-debian-10-r5
imagePullPolicy: "IfNotPresent"
resources:
requests:
cpu: 250m
memory: 256Mi
securityContext:
runAsUser: 1001
env:
- name: BITNAMI_DEBUG
value: "false"
- name: POSTGRESQL_PORT_NUMBER
value: "5432"
- name: POSTGRESQL_VOLUME_DIR
value: "/bitnami/postgresql"
- name: PGDATA
value: "/bitnami/postgresql/data"
- name: POSTGRES_USER
value: "testuser"
- name: POSTGRES_DB
value: testdb
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgresql
key: postgresql-password
- name: POSTGRESQL_ENABLE_LDAP
value: "no"
ports:
- name: tcp-postgresql
containerPort: 5432
livenessProbe:
exec:
command:
- /bin/sh
- -c
- exec pg_isready -U "postgres" -h 127.0.0.1 -p 5432
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 6
readinessProbe:
exec:
command:
- /bin/sh
- -c
- -e
- |
exec pg_isready -U "postgres" -h 127.0.0.1 -p 5432
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 6
volumeMounts:
- name: dshm
mountPath: /dev/shm
- name: data
mountPath: /bitnami/postgresql
subPath:
volumes:
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 1Gi
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "8Gi"
2 changes: 1 addition & 1 deletion config/dev/github/mysql.yaml
@@ -1,4 +1,4 @@
apiVersion: databases.schemahero.io/v1alpha3
apiVersion: databases.schemahero.io/v1alpha4
kind: Database
metadata:
name: testdb
Expand Down

0 comments on commit 6f1926e

Please sign in to comment.