Skip to content

Commit 6d1c49e

Browse files
author
Alexander Rogalskiy
committed
Updates on files
Added changeset on workflow
1 parent d5484db commit 6d1c49e

18 files changed

+284
-14
lines changed

.github/workflows/helm.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
id: prep
1414
run: |
1515
VERSION=$(grep 'version' package.json | awk '{ print $4 }' | tr -d '"')
16-
CHANGELOG="https://github.com/AlexRogalskiy/java-patterns/blob/main/CHANGELOG.md#$(echo $VERSION | tr -d '.')"
16+
CHANGELOG="https://github.com/AlexRogalskiy/android-patterns/blob/main/CHANGELOG.md#$(echo $VERSION | tr -d '.')"
1717
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
1818
echo ::set-output name=VERSION::${VERSION}
1919
echo ::set-output name=CHANGELOG::${CHANGELOG}
@@ -43,7 +43,7 @@ jobs:
4343
build-args: |
4444
REVISON=${{ github.sha }}
4545
tags: |
46-
ghcr.io/AlexRogalskiy/java-patterns:${{ steps.prep.outputs.VERSION }}
46+
ghcr.io/AlexRogalskiy/android-patterns:${{ steps.prep.outputs.VERSION }}
4747
labels: |
4848
org.opencontainers.image.title=${{ github.event.repository.name }}
4949
org.opencontainers.image.description=${{ github.event.repository.description }}
@@ -54,7 +54,7 @@ jobs:
5454
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
5555
- name: Check images
5656
run: |
57-
docker buildx imagetools inspect ghcr.io/AlexRogalskiy/java-patterns:${{ steps.prep.outputs.VERSION }}
57+
docker buildx imagetools inspect ghcr.io/AlexRogalskiy/android-patterns:${{ steps.prep.outputs.VERSION }}
5858
- name: Publish Helm charts
5959
uses: stefanprodan/[email protected]
6060
with:

.markdownlintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
tilt_modules

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ coverage
1414
dist
1515
helm
1616
tilt_modules
17+
okteto
18+
charts
19+
k8s
20+
release

.stignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.git
2+
/node_modules
3+
/tilt_modules

.yaml-lint.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44

55
extends: default
66

7+
locale: en_US.UTF-8
8+
79
rules:
810
# 150 chars should be enough, but don't fail if a line is longer
911
line-length:
1012
max: 150
13+
allow-non-breakable-inline-mappings: true
1114
level: warning
1215
comments:
1316
min-spaces-from-content: 1
17+
level: warning
1418
braces:
1519
min-spaces-inside: 0
1620
max-spaces-inside: 0
@@ -19,6 +23,24 @@ rules:
1923
max-spaces-inside: 0
2024
indentation:
2125
indent-sequences: consistent
22-
document-start: disable
26+
level: warning
27+
document-end: disable
28+
document-start:
29+
level: warning
2330
indentation: disable
24-
truthy: false
31+
colons: enable
32+
commas: enable
33+
comments-indentation:
34+
level: warning
35+
empty-lines: enable
36+
empty-values: disable
37+
hyphens: enable
38+
key-duplicates: enable
39+
key-ordering: disable
40+
new-line-at-end-of-file: enable
41+
new-lines: enable
42+
octal-values: disable
43+
quoted-strings: disable
44+
trailing-spaces: enable
45+
truthy:
46+
level: warning

Makefile

+26-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ else
1515
endif
1616

1717
IMAGE ?= styled-android-patterns
18+
OKTETO_IMAGE ?= okteto/styled-android-patterns
19+
DOCKER_IMAGE ?= alexanderr/styled-android-patterns
1820
TAG ?= latest
1921

2022
# UNAME_OS stores the value of uname -s.
@@ -107,12 +109,12 @@ helm-lint:
107109
# Run helm start command.
108110
.PHONY: helm-start
109111
helm-start:
110-
helm upgrade --install backend-java-patterns -f charts/values.yaml --create-namespace --namespace webapp charts
112+
helm upgrade --install backend-android-patterns -f charts/values.yaml --create-namespace --namespace webapp charts
111113

112114
# Run helm stop command.
113115
.PHONY: helm-stop
114116
helm-stop:
115-
helm uninstall backend-java-patterns --namespace webapp
117+
helm uninstall backend-android-patterns --namespace webapp
116118

117119
# Run helm package command.
118120
.PHONY: helm-package
@@ -123,3 +125,25 @@ helm-package:
123125
# Run helm dev command.
124126
.PHONY: helm-dev
125127
helm-dev: clean helm-lint helm-package
128+
129+
# Run okteto build command.
130+
.PHONY: okteto
131+
okteto:
132+
okteto build -t $(DOCKER_IMAGE) .
133+
okteto build -t $(OKTETO_IMAGE) .
134+
135+
# Run local build command.
136+
.PHONY: local-build
137+
local-build:
138+
python3 -m pip install -r ./docs/requirements.txt
139+
python3 -m mkdocs build --clean --config-file mkdocs.yml
140+
141+
# Run local run command.
142+
.PHONY: local-run
143+
local-run:
144+
python3 -m mkdocs serve --verbose --dirtyreload
145+
146+
# Run github pages deploy command.
147+
.PHONY: gh-pages
148+
gh-pages:
149+
python3 -m mkdocs --verbose gh-deploy --force --remote-branch gh-pages

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ python -m pip install markdown-include
169169
4\) Start the server at ***localhost*** by running the following command:
170170

171171
```shell script
172+
python -m mkdocs build --clean --config-file mkdocs.yml
172173
python -m mkdocs serve --verbose --dirtyreload
173174
```
174175

charts/templates/deployment.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ metadata:
55
name: {{ $fullName }}
66
labels:
77
{{- include "backend-android-patterns.labels" . | nindent 4 }}
8+
{{- with .Values.deployment.additionalLabels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
811
spec:
912
{{- if not .Values.hpa.enabled }}
1013
replicas: {{ .Values.general.replicaCount }}

charts/templates/secret.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ metadata:
55
name: {{ include "backend-android-patterns.fullname" . }}
66
labels:
77
{{- include "backend-android-patterns.labels" . | nindent 4 }}
8+
{{- with .Values.secrets.additionalLabels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
811
data:
912
BASE_URL: {{ default "" .Values.secrets.data.baseUrl | b64enc | quote }}
13+
{{- if .Values.secrets.data.baseToken }}
14+
BASE_TOKEN: {{ .Values.secrets.data.baseToken | b64enc | quote }}
15+
{{- else }}
16+
BASE_TOKEN: {{ randAlphaNum 10 | b64enc | quote }}
17+
{{- end }}
1018
{{- end }}

charts/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ configMaps:
3131

3232
secrets:
3333
create: false
34+
additionalLabels:
35+
app.kubernetes.io/component: vault
36+
data:
37+
baseUrl: ""
38+
baseToken: ""
3439

3540
ui:
3641
color: "#34577c"

docs/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ markdown-checklist>=0.4.1
77
fontawesome-markdown>=0.2.6
88
markdown-include>=0.6.0
99
pymdown-extensions>=8.2
10+
python-markdown-math>=0.6
1011
mkdocs-material-extensions>=1.0
1112
mkdocs-git-revision-date-localized-plugin>=0.9.2
1213
mkdocs-awesome-pages-plugin>=2.5.0

k8s/backend/deployment.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ spec:
122122
memory: "3G"
123123
ephemeral-storage: "3G"
124124
securityContext:
125-
allowPrivilegeEscalation: false
126125
allowPrivilegeEscalation: false
127126
privileged: false
128127
readOnlyRootFilesystem: false

mkdocs.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,20 @@ markdown_extensions:
106106
- pymdownx.mark: {}
107107
- pymdownx.critic: {}
108108
- pymdownx.inlinehilite: {} # https://squidfunk.github.io/mkdocs-material/extensions/pymdown/#inlinehilite
109-
- pymdownx.superfences: {} # https://squidfunk.github.io/mkdocs-material/extensions/pymdown/#superfences
109+
- pymdownx.superfences: # https://squidfunk.github.io/mkdocs-material/extensions/pymdown/#superfences
110+
custom_fences:
111+
- name: mermaid
112+
class: mermaid
113+
format: !!python/name:pymdownx.superfences.fence_div_format
110114
- pymdownx.tabbed: {} # https://squidfunk.github.io/mkdocs-material/extensions/pymdown/#tabbed
111115
- pymdownx.details: {} # https://squidfunk.github.io/mkdocs-material/extensions/pymdown/#details
112116
- pymdownx.emoji: # https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/#configuration
113-
emoji_index: "!!python/name:materialx.emoji.twemoji"
114-
emoji_generator: "!!python/name:materialx.emoji.to_svg"
117+
emoji_index: !!python/name:materialx.emoji.twemoji
118+
emoji_generator: !!python/name:materialx.emoji.to_svg
115119
- smarty: {} # https://python-markdown.github.io/extensions/smarty/
116120
- nl2br: {} # https://python-markdown.github.io/extensions/smarty/
117121
- mdx_truly_sane_lists: {} # https://github.com/radude/mdx_truly_sane_lists -> proper indentation of md list items
122+
- markdown.extensions.attr_list: {}
118123

119124
# Other Settings
120125
strict: false # halt processing when a warning is raised

okteto-pipeline.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
icon: https://okteto.com/icons/icon-384x384.png
2+
deploy:
3+
- okteto build -t okteto.dev/styled-android-patterns .
4+
# - kubectl create clusterrolebinding kube-system-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
5+
# - kubectl create role access-secrets --verb=get,list,watch,update,create --resource=secrets
6+
# - kubectl create rolebinding --role=access-secrets default-to-secrets --serviceaccount=kube-system:default
7+
# - helm upgrade --install backend-android-patterns -f charts/values.yaml --create-namespace --namespace webapp charts --set tag=${OKTETO_GIT_COMMIT}
8+
- kubectl apply -f okteto/deployment.yaml
9+
devs:
10+
- okteto.yml

okteto.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: backend-android-patterns-v1
2+
image: okteto/styled-android-patterns
3+
labels:
4+
app.kubernetes.io/part-of: devops
5+
app.kubernetes.io/component: documentation
6+
environment:
7+
- ENVIRONMENT=Development
8+
# command: [ "/usr/bin/python3.8", "-m", "mkdocs", "serve", "--verbose", "--dirtyreload", "--dev-addr=0.0.0.0:8000" ]
9+
sync:
10+
- .:/docs
11+
workdir: .
12+
remote: 2222
13+
resources:
14+
requests:
15+
memory: "64Mi"
16+
cpu: "250m"
17+
limits:
18+
memory: "128Mi"
19+
cpu: "500m"
20+
forward:
21+
- 8000:8000
22+
persistentVolume:
23+
enabled: false
24+
lifecycle:
25+
postStart: false
26+
postStop: true
27+
securityContext:
28+
runAsUser: 1000
29+
runAsGroup: 2000
30+
fsGroup: 3000
31+
capabilities:
32+
add:
33+
- SYS_PTRACE

0 commit comments

Comments
 (0)