-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use the Common chart - Add instructions for the Helm chart - Upgrade Docker base image python version - Update Dockerfile to install mosbot correctly - Remove unneded images from docker-compose.yml - Fix reStructuredText markup in docs
- Loading branch information
Showing
13 changed files
with
181 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
FROM python:3.6-slim | ||
FROM python:3.7-slim | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN pip install pipenv | ||
COPY Pipfile Pipfile.lock ./ | ||
RUN pipenv install | ||
|
||
COPY dist/abot-0.0.1a0.tar.gz ./mosbot.tar.gz | ||
RUN tar xf mosbot.tar.gz --strip-components=1 | ||
RUN pipenv sync | ||
|
||
COPY setup.cfg setup.py README.rst alembic.ini ./ | ||
COPY alembic ./alembic | ||
COPY mosbot ./mosbot | ||
RUN pipenv run python setup.py develop | ||
|
||
CMD ["pipenv", "run", "bot", "run"] | ||
|
||
CMD ["/bin/sh", "-c", "pipenv run alembic upgrade head && pipenv run bot run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
version: '2' | ||
services: | ||
rabbitmq: | ||
image: rabbitmq:management | ||
ports: | ||
- "15672:15672" | ||
- "5672:5672" | ||
- "4369:4369" | ||
redis: | ||
image: redis | ||
ports: | ||
- "6379:6379" | ||
postgres: | ||
image: mdillon/postgis | ||
ports: | ||
- "5432:5432" | ||
# mosbot: | ||
# image: dtgoitia/mosbot:latest | ||
# environment: | ||
# DATABASE_URL: postgresql://postgres@postgres/postgres | ||
# depends_on: | ||
# - postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
name: mosbot | ||
description: Master of Soundtrack bot | ||
version: 0.0.1 | ||
appVersion: 0.0.1 | ||
home: https://github.com/txomon/mosbot | ||
sources: | ||
- https://github.com/txomon/mosbot | ||
keywords: | ||
- bot | ||
- mosbot | ||
- master of soundtrack | ||
maintainers: | ||
- name: txomon | ||
email: [email protected] |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencies: | ||
- name: common | ||
repository: http://storage.googleapis.com/kubernetes-charts-incubator | ||
version: 0.0.5 | ||
- name: postgresql | ||
repository: https://kubernetes-charts.storage.googleapis.com | ||
version: 3.13.1 | ||
digest: sha256:e1563a17669e7c46c9db98c4322374903cd88974b24634e0334047f98c2eacc3 | ||
generated: "2019-05-19T08:39:48.617716388+01:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dependencies: | ||
- name: common | ||
repository: http://storage.googleapis.com/kubernetes-charts-incubator | ||
version: 0.0.5 | ||
- name: postgresql | ||
repository: https://kubernetes-charts.storage.googleapis.com | ||
version: 3.13.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "mosbot-chart.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "mosbot-chart.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mosbot-chart.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mosbot-chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl port-forward $POD_NAME 8080:80 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "mosbot-chart.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* Generate PostgreSQL database URL */}} | ||
{{- define "mosbot-chart.databaseurl" -}} | ||
postgresql:// | ||
{{- .Values.postgresql.postgresqlUsername -}}: | ||
{{- .Values.postgresql.postgresqlPassword -}}@ | ||
{{- .Release.Name }}-postgresql. | ||
{{- .Release.Namespace -}}/ | ||
{{- .Values.postgresql.postgresqlDatabase -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- template "common.deployment" (list . "mosbot.deployment") -}} | ||
{{- define "mosbot.deployment" -}} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
template: | ||
spec: | ||
containers: | ||
- {{ template "common.container" (list . "mosbot.deployment.container") }} | ||
{{- end -}} | ||
{{- define "mosbot.deployment.container" -}} | ||
env: | ||
- name: DATABASE_URL | ||
value: {{ template "mosbot-chart.databaseurl" . }} | ||
{{ if and .Values.dubtrackUsername .Values.dubtrackPassword -}} | ||
- name: DUBTRACK_USERNAME | ||
value: {{ .Values.dubtrackUsername | quote }} | ||
- name: DUBTRACK_PASSWORD | ||
value: {{ .Values.dubtrackPassword | quote }} | ||
{{ end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
image: | ||
repository: dtgoitia/mosbot | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
|
||
replicaCount: 1 | ||
|
||
# TODO: setup ingress | ||
service: | ||
type: NodePort | ||
port: 80 | ||
|
||
# Dubtrack credentials | ||
# dubtrackUsername: rococo | ||
# dubtrackPassword: 1234 | ||
|
||
ingress: | ||
enabled: false | ||
tls: false | ||
hosts: | ||
- host: mosbot-chart.local | ||
paths: [] | ||
|
||
postgresql: | ||
postgresqlUsername: dbUser | ||
postgresqlPassword: pass1234 | ||
postgresqlDatabase: myPostgresDatabaseName | ||
service: | ||
port: 5432 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters