added azure pipeline + helmfiles

This commit is contained in:
Nico Hanus
2020-04-17 12:17:30 +02:00
parent 29f527c380
commit 255a9ca893
8 changed files with 190 additions and 0 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
node_modules
.git
.gitignore

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
#stage 1
FROM node:10-stretch as node
ARG IS_PRODUCTION=false
WORKDIR /app
COPY . .
RUN umask 0022
RUN npm install --always-auth=false
RUN if [ "${IS_PRODUCTION}" = "true" ] ; then npm run-script build-prod ; else npm run-script build ; fi
# stage 2
FROM nginx:alpine
COPY --from=node /app/dist/sales /usr/share/nginx/html
COPY --from=node /app/nginx.conf /etc/nginx/conf.d/default.conf

83
azure-pipelines.yml Normal file
View File

@@ -0,0 +1,83 @@
name: '$(Major).$(Minor).$(Patch)-$(SourceBranchName)'
trigger:
branches:
include:
- '*'
variables:
# Major Version einstellen
- name: 'Major'
value: '1'
# Minor Version einstellen
- name: 'Minor'
value: '0'
- name: 'Patch'
value: "$[counter(format('{0}.{1}', variables['Major'], variables['Minor']),400)]"
jobs:
- job: cibuild_debug
displayName: ISAClient CI Debug
pool:
name: 'Default'
demands:
- Agent.OS -equals Linux
- docker
steps:
- task: Docker@2
displayName: 'build ISAClient Debug'
inputs:
containerRegistry: 'Harbor isa'
repository: isa/ui
command: 'build'
Dockerfile: Dockerfile
buildContext:
tags: 'debug-$(Build.BuildNumber)-$(Build.SourceVersion)'
arguments: '--no-cache'
- task: Docker@2
displayName: 'push ISAClient Debug'
inputs:
containerRegistry: 'Harbor isa'
repository: 'isa/ui'
command: 'push'
tags: 'debug-$(Build.BuildNumber)-$(Build.SourceVersion)'
- task: PublishBuildArtifacts@1
displayName: 'Artefakt veröffentlichen: HelmValues'
inputs:
PathtoPublish: helmvalues
ArtifactName: HelmValues
- task: PublishBuildArtifacts@1
displayName: 'Artefakt veröffentlichen: ISAClientConfigs'
inputs:
PathtoPublish: 'apps/sales/src/assets/config'
ArtifactName: SalesConfigs
- job: cibuild_prod
displayName: ISAClient CI Prod
pool:
name: 'Default'
demands:
- Agent.OS -equals Linux
- docker
steps:
- task: Docker@2
displayName: 'build ISAClient Prod'
inputs:
containerRegistry: 'Harbor isa'
repository: isa/ui
command: 'build'
Dockerfile: Dockerfile
buildContext:
tags: 'prod-$(Build.BuildNumber)-$(Build.SourceVersion)'
arguments: '--no-cache --build-arg IS_PRODUCTION=true'
- task: Docker@2
displayName: 'push ISAClient Prod'
inputs:
containerRegistry: 'Harbor isa'
repository: 'isa/ui'
command: 'push'
tags: 'prod-$(Build.BuildNumber)-$(Build.SourceVersion)'

View File

@@ -0,0 +1,15 @@
fullnameOverride: isa-ui
image:
harborRepo: isa/ui
tag: prod-$(BUILD.BUILDNUMBER)-$(BUILD.SOURCEVERSION)
ingress:
enabled: true
path: /
hosts:
- isa-$(LOWERENVIRONMENT).kubernetes.paragon-systems.de
aspnet_environment: $(ENVIRONMENT)
configMap:
mountPath: /usr/share/nginx/html/assets/config

View File

@@ -0,0 +1,21 @@
fullnameOverride: isa-ui
image:
harborRepo: isa/ui
tag: prod-$(BUILD.BUILDNUMBER)-$(BUILD.SOURCEVERSION)
ingress:
enabled: true
path: /
hosts:
- isa.kubernetes.paragon-systems.de
- isa-$(LOWERENVIRONMENT).kubernetes.paragon-systems.de
deployment_annotations:
co.elastic.logs/module: nginx
co.elastic.logs/fileset.stdout: access
co.elastic.logs/fileset.stderr: error
aspnet_environment: $(ENVIRONMENT)
configMap:
mountPath: /usr/share/nginx/html/assets/config

View File

@@ -0,0 +1,20 @@
fullnameOverride: isa-ui
image:
harborRepo: isa/ui
tag: prod-$(BUILD.BUILDNUMBER)-$(BUILD.SOURCEVERSION)
ingress:
enabled: true
path: /
hosts:
- isa-$(LOWERENVIRONMENT).kubernetes.paragon-systems.de
deployment_annotations:
co.elastic.logs/module: nginx
co.elastic.logs/fileset.stdout: access
co.elastic.logs/fileset.stderr: error
aspnet_environment: $(ENVIRONMENT)
configMap:
mountPath: /usr/share/nginx/html/assets/config

View File

@@ -0,0 +1,15 @@
fullnameOverride: isa-ui
image:
harborRepo: isa/ui
tag: debug-$(BUILD.BUILDNUMBER)-$(BUILD.SOURCEVERSION)
ingress:
enabled: true
path: /
hosts:
- isa-$(LOWERENVIRONMENT).kubernetes.paragon-systems.de
aspnet_environment: $(ENVIRONMENT)
configMap:
mountPath: /usr/share/nginx/html/assets/config

20
nginx.conf Normal file
View File

@@ -0,0 +1,20 @@
server {
listen 80;
root /usr/share/nginx/html;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_comp_level 9;
etag on;
location / {
try_files \$uri \$uri/ /index.html;
}
location /static/ {
add_header Cache-Control max-age=31536000;
}
location /index.html {
add_header Cache-Control no-cache;
}
location /config.json {
add_header Cache-Control no-cache;
}
}