Skip to content

Instantly share code, notes, and snippets.

View juliuscanute's full-sized avatar
💭
I may be slow to respond.

juliuscanute

💭
I may be slow to respond.
View GitHub Profile
@juliuscanute
juliuscanute / Dockerfile
Created June 21, 2019 08:24
Spring Boot
FROM anapsix/alpine-java
RUN mkdir -p /usr/springboot
COPY ./target/api-0.0.1-SNAPSHOT.jar /usr/springboot
WORKDIR /usr/springboot
EXPOSE 8080
CMD ["java", "-jar", "api-0.0.1-SNAPSHOT.jar"]
@juliuscanute
juliuscanute / azure-pipelines.yml
Last active June 25, 2019 22:50
Azure Pipeline
pool:
vmImage: 'ubuntu-latest'
variables:
imageName: spring-demo
steps:
- task: Maven@3
inputs:
@juliuscanute
juliuscanute / application.yaml
Created June 25, 2019 22:46
Spring Boot Service Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "spring-demo.fullname" . }}-deployment
spec:
replicas: {{ .Values.scale }}
selector:
matchLabels:
app: {{ template "spring-demo.fullname" . }}-spring
template:
@juliuscanute
juliuscanute / application.yaml
Created June 25, 2019 22:46
Spring Boot Service Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "spring-demo.fullname" . }}-deployment
spec:
replicas: {{ .Values.scale }}
selector:
matchLabels:
app: {{ template "spring-demo.fullname" . }}-spring
template:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "spring-demo.fullname" . }}-env
data:
SPRING_PROFILE: {{ .Values.spring.profile }}
MYSQL_USERNAME: {{ .Values.mysql.mysqlUser }}
MYSQL_DATA_SOURCE: jdbc:mysql://{{ .Release.Name }}-mysql.{{ .Release.Namespace }}.svc.cluster.local:3306/{{ .Values.mysql.mysqlDatabase }}
- task: HelmDeploy@0
displayName: Helm package
inputs:
command: package
chartPath: $(chartPath)
destination: $(Build.ArtifactStagingDirectory)
version: $(Build.BuildNumber)
updatedependency: true
- task: PublishBuildArtifacts@1
inputs:
@juliuscanute
juliuscanute / dictionary-spec.yaml
Created July 3, 2019 06:04
Get Total Pages Specification
/v1/dictionary/pages:
get:
tags:
- 'Query Dictionary'
responses:
'200':
description: 'Success'
content:
application/json:
schema:
@juliuscanute
juliuscanute / dictionary-spec.yaml
Created July 3, 2019 06:13
Get words in a page
/v1/dictionary/page/{pageNo}:
get:
tags:
- 'Query Dictionary'
parameters:
- name: pageNo
in: path
required: true
description: Page number of the dictionary
schema:
/v1/dictionary:
get:
tags:
- 'Query Dictionary'
parameters:
- name: word
in: query
required: true
description: Word to search
schema:
@juliuscanute
juliuscanute / DictionaryTotalPageHandler.kt
Last active July 4, 2019 00:51
Get Total Pages in Dictionary
class DictionaryTotalPageHandler {
private val global = Startup
@FunctionName("getNumberOfPagesInDictionary")
fun run(
@HttpTrigger(name = "req", methods = [HttpMethod.GET], route = "v1/dictionary/pages", authLevel = AuthorizationLevel.ANONYMOUS) request: HttpRequestMessage<Optional<String>>,
context: ExecutionContext): HttpResponseMessage {
context.logger.info("Processing get pages of dictionary")
val result = DictionaryController().getNumberOfPagesInDictionary()