This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 646
[dev-1234] - update readme #23
Open
cvega
wants to merge
2
commits into
gothinkster:master
Choose a base branch
from
Paper-Street-Soap-Co:dev-1234
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
draft.toml | ||
charts/ | ||
NOTICE | ||
LICENSE | ||
README.md |
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 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
*.png | ||
|
||
# known compile time folders | ||
target/ | ||
node_modules/ | ||
vendor/ |
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,5 @@ | ||
FROM python:onbuild | ||
ENV PORT 8080 | ||
EXPOSE 8080 | ||
ENTRYPOINT ["python"] | ||
CMD ["app.py"] |
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,60 @@ | ||
pipeline { | ||
agent any | ||
environment { | ||
ORG = 'paper-street-soap-co' | ||
APP_NAME = 'django-realworld-example-app' | ||
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum') | ||
} | ||
stages { | ||
stage('CI Build and push snapshot') { | ||
when { | ||
branch 'PR-*' | ||
} | ||
environment { | ||
PREVIEW_VERSION = "0.0.0-SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER" | ||
PREVIEW_NAMESPACE = "$APP_NAME-$BRANCH_NAME".toLowerCase() | ||
HELM_RELEASE = "$PREVIEW_NAMESPACE".toLowerCase() | ||
} | ||
steps { | ||
sh "python -m unittest" | ||
sh "export VERSION=$PREVIEW_VERSION && skaffold build -f skaffold.yaml" | ||
sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:$PREVIEW_VERSION" | ||
dir('./charts/preview') { | ||
sh "make preview" | ||
sh "jx preview --app $APP_NAME --dir ../.." | ||
} | ||
} | ||
} | ||
stage('Build Release') { | ||
when { | ||
branch 'master' | ||
} | ||
steps { | ||
git 'https://github.com/paper-street-soap-co/django-realworld-example-app.git' | ||
|
||
// so we can retrieve the version in later steps | ||
sh "echo \$(jx-release-version) > VERSION" | ||
sh "jx step tag --version \$(cat VERSION)" | ||
sh "python -m unittest" | ||
sh "export VERSION=`cat VERSION` && skaffold build -f skaffold.yaml" | ||
sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)" | ||
} | ||
} | ||
stage('Promote to Environments') { | ||
when { | ||
branch 'master' | ||
} | ||
steps { | ||
dir('./charts/django-realworld-example-app') { | ||
sh "jx step changelog --version v\$(cat ../../VERSION)" | ||
|
||
// release the helm chart | ||
sh "jx step helm release" | ||
|
||
// promote through all 'Auto' promotion Environments | ||
sh "jx promote -b --all-auto --timeout 1h --version \$(cat ../../VERSION)" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
approvers: | ||
- paperstreetsoapco | ||
reviewers: | ||
- paperstreetsoapco |
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,6 @@ | ||
aliases: | ||
- paperstreetsoapco | ||
best-approvers: | ||
- paperstreetsoapco | ||
best-reviewers: | ||
- paperstreetsoapco |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
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,4 @@ | ||
apiVersion: v1 | ||
description: A Helm chart for Kubernetes | ||
name: django-realworld-example-app | ||
version: v0.1.0 |
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,48 @@ | ||
CHART_REPO := http://jenkins-x-chartmuseum:8080 | ||
CURRENT=$(pwd) | ||
NAME := django-realworld-example-app | ||
OS := $(shell uname) | ||
RELEASE_VERSION := $(shell cat ../../VERSION) | ||
|
||
build: clean | ||
rm -rf requirements.lock | ||
helm dependency build | ||
helm lint | ||
|
||
install: clean build | ||
helm install . --name ${NAME} | ||
|
||
upgrade: clean build | ||
helm upgrade ${NAME} . | ||
|
||
delete: | ||
helm delete --purge ${NAME} | ||
|
||
clean: | ||
rm -rf charts | ||
rm -rf ${NAME}*.tgz | ||
|
||
release: clean | ||
helm dependency build | ||
helm lint | ||
helm init --client-only | ||
helm package . | ||
curl --fail -u $(CHARTMUSEUM_CREDS_USR):$(CHARTMUSEUM_CREDS_PSW) --data-binary "@$(NAME)-$(shell sed -n 's/^version: //p' Chart.yaml).tgz" $(CHART_REPO)/api/charts | ||
rm -rf ${NAME}*.tgz% | ||
|
||
tag: | ||
ifeq ($(OS),Darwin) | ||
sed -i "" -e "s/version:.*/version: $(RELEASE_VERSION)/" Chart.yaml | ||
sed -i "" -e "s/tag: .*/tag: $(RELEASE_VERSION)/" values.yaml | ||
else ifeq ($(OS),Linux) | ||
sed -i -e "s/version:.*/version: $(RELEASE_VERSION)/" Chart.yaml | ||
sed -i -e "s|repository: .*|repository: $(DOCKER_REGISTRY)\/paper-street-soap-co\/django-realworld-example-app|" values.yaml | ||
sed -i -e "s/tag: .*/tag: $(RELEASE_VERSION)/" values.yaml | ||
else | ||
echo "platfrom $(OS) not supported to release from" | ||
exit -1 | ||
endif | ||
git add --all | ||
git commit -m "release $(RELEASE_VERSION)" --allow-empty # if first release then no verion update is performed | ||
git tag -fa v$(RELEASE_VERSION) -m "Release version $(RELEASE_VERSION)" | ||
git push origin v$(RELEASE_VERSION) |
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 @@ | ||
|
||
{{- if contains "NodePort" .Values.service.type }} | ||
Get the application URL by running these commands: | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT/login | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
Get the application URL by running these commands: | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:{{ .Values.service.externalPort }} | ||
{{- else }} | ||
http://{{ .Release.Name }}.{{ .Values.basedomain }} to access your application | ||
{{- end }} |
16 changes: 16 additions & 0 deletions
16
charts/django-realworld-example-app/templates/_helpers.tpl
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,16 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
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). | ||
*/}} | ||
{{- define "fullname" -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
27 changes: 27 additions & 0 deletions
27
charts/django-realworld-example-app/templates/deployment.yaml
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 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
draft: {{ default "draft-app" .Values.draft }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
template: | ||
metadata: | ||
labels: | ||
draft: {{ default "draft-app" .Values.draft }} | ||
app: {{ template "fullname" . }} | ||
{{- if .Values.podAnnotations }} | ||
annotations: | ||
{{ toYaml .Values.podAnnotations | indent 8 }} | ||
{{- end }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- containerPort: {{ .Values.service.internalPort }} | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} |
17 changes: 17 additions & 0 deletions
17
charts/django-realworld-example-app/templates/ingress.yaml
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,17 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
spec: | ||
rules: | ||
- host: {{ .Release.Name }}.{{ .Values.basedomain }} | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: {{ template "fullname" . }} | ||
servicePort: {{ .Values.service.externalPort }} | ||
{{- end -}} |
23 changes: 23 additions & 0 deletions
23
charts/django-realworld-example-app/templates/service.yaml
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,23 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
{{- if .Values.service.name }} | ||
name: {{ .Values.service.name }} | ||
{{- else }} | ||
name: {{ template "fullname" . }} | ||
{{- end }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
{{- if .Values.service.annotations }} | ||
annotations: | ||
{{ toYaml .Values.service.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.externalPort }} | ||
targetPort: {{ .Values.service.internalPort }} | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: {{ template "fullname" . }} |
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,25 @@ | ||
# Default values for python. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
replicaCount: 1 | ||
image: | ||
repository: draft | ||
tag: dev | ||
pullPolicy: IfNotPresent | ||
service: | ||
name: django-realworld-example-app | ||
type: ClusterIP | ||
externalPort: 80 | ||
internalPort: 8080 | ||
annotations: | ||
fabric8.io/expose: "true" | ||
fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx" | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
ingress: | ||
enabled: false |
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,5 @@ | ||
apiVersion: v1 | ||
description: A Helm chart for Kubernetes | ||
icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/master/images/python.png | ||
name: preview | ||
version: 0.1.0-SNAPSHOT |
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,18 @@ | ||
OS := $(shell uname) | ||
|
||
preview: | ||
ifeq ($(OS),Darwin) | ||
sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml | ||
sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml | ||
sed -i "" -e "s/tag: .*/tag: $(PREVIEW_VERSION)/" values.yaml | ||
else ifeq ($(OS),Linux) | ||
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml | ||
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml | ||
sed -i -e "s|repository: .*|repository: $(DOCKER_REGISTRY)\/paper-street-soap-co\/django-realworld-example-app|" values.yaml | ||
sed -i -e "s/tag: .*/tag: $(PREVIEW_VERSION)/" values.yaml | ||
else | ||
echo "platfrom $(OS) not supported to release from" | ||
exit -1 | ||
endif | ||
echo " version: $(PREVIEW_VERSION)" >> requirements.yaml | ||
jx step helm build |
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,16 @@ | ||
# !! File must end with empty line !! | ||
dependencies: | ||
- alias: expose | ||
name: exposecontroller | ||
repository: http://chartmuseum.jenkins-x.io | ||
version: 2.3.56 | ||
- alias: cleanup | ||
name: exposecontroller | ||
repository: http://chartmuseum.jenkins-x.io | ||
version: 2.3.56 | ||
|
||
# !! "alias: preview" must be last entry in dependencies array !! | ||
# !! Place custom dependencies above !! | ||
- alias: preview | ||
name: django-realworld-example-app | ||
repository: file://../django-realworld-example-app |
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,22 @@ | ||
|
||
expose: | ||
Annotations: | ||
helm.sh/hook: post-install,post-upgrade | ||
helm.sh/hook-delete-policy: hook-succeeded | ||
config: | ||
exposer: Ingress | ||
http: true | ||
tlsacme: false | ||
|
||
cleanup: | ||
Args: | ||
- --cleanup | ||
Annotations: | ||
helm.sh/hook: pre-delete | ||
helm.sh/hook-delete-policy: hook-succeeded | ||
|
||
preview: | ||
image: | ||
repository: | ||
tag: | ||
pullPolicy: IfNotPresent |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where this pipeline is running? Can we have access?
The github solutions like travis are enable on this project?