diff --git a/Dockerfile.eap b/Dockerfile.eap new file mode 100644 index 00000000..3cede8da --- /dev/null +++ b/Dockerfile.eap @@ -0,0 +1,3 @@ +FROM entando/entando-eap71-base:6.0.0 +COPY target/*.war /opt/eap/standalone/deployments/ +#RUN $ENTANDO_COMMON_PATH/init-derby-from-war.sh \ No newline at end of file diff --git a/Dockerfile.wildfly b/Dockerfile.wildfly new file mode 100644 index 00000000..b226f68c --- /dev/null +++ b/Dockerfile.wildfly @@ -0,0 +1,3 @@ +FROM entando/entando-wildfly12-base:6.0.0 +COPY target/*.war /wildfly/standalone/deployments/ +#RUN $ENTANDO_COMMON_PATH/init-derby-from-war.sh \ No newline at end of file diff --git a/charts/entando-de-app/Makefile b/charts/entando-de-app/Makefile index 2e16c462..a6e00cce 100755 --- a/charts/entando-de-app/Makefile +++ b/charts/entando-de-app/Makefile @@ -36,7 +36,7 @@ ifeq ($(OS),Darwin) 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)\/entando\/entando-de-app|" values.yaml + sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/entando\/entando-de-app-$(JEE_SERVER)|" values.yaml sed -i -e "s/tag:.*/tag: $(RELEASE_VERSION)/" values.yaml else echo "platfrom $(OS) not supported to release from" diff --git a/charts/entando-de-app/requirements.yaml b/charts/entando-de-app/requirements.yaml index 9dd13307..a72cd830 100644 --- a/charts/entando-de-app/requirements.yaml +++ b/charts/entando-de-app/requirements.yaml @@ -2,4 +2,4 @@ dependencies: - alias: entando-operator name: entando-k8s-controller-coordinator repository: https://jenkins-x-chartmuseum-jx.apps.serv.run - version: 6.0.30 + version: 6.0.32 diff --git a/charts/maven/.helmignore b/charts/maven/.helmignore deleted file mode 100755 index f0c13194..00000000 --- a/charts/maven/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# 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 diff --git a/charts/maven/Chart.yaml b/charts/maven/Chart.yaml deleted file mode 100644 index 684ada30..00000000 --- a/charts/maven/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -description: A Helm chart for Kubernetes -icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/master/images/java.png -name: maven -version: 0.1.0-SNAPSHOT diff --git a/charts/maven/Makefile b/charts/maven/Makefile deleted file mode 100755 index 2e16c462..00000000 --- a/charts/maven/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -CHART_REPO := http://jenkins-x-chartmuseum:8080 -CURRENT=$(pwd) -NAME := entando-de-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)\/entando\/entando-de-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) diff --git a/charts/maven/README.md b/charts/maven/README.md deleted file mode 100755 index 7c394613..00000000 --- a/charts/maven/README.md +++ /dev/null @@ -1 +0,0 @@ -# Java application \ No newline at end of file diff --git a/charts/maven/templates/NOTES.txt b/charts/maven/templates/NOTES.txt deleted file mode 100755 index 97823be2..00000000 --- a/charts/maven/templates/NOTES.txt +++ /dev/null @@ -1,4 +0,0 @@ - -Get the application URL by running these commands: - -kubectl get ingress {{ template "fullname" . }} diff --git a/charts/maven/templates/_helpers.tpl b/charts/maven/templates/_helpers.tpl deleted file mode 100755 index f0d83d2e..00000000 --- a/charts/maven/templates/_helpers.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{{/* 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 -}} diff --git a/charts/maven/templates/canary.yaml b/charts/maven/templates/canary.yaml deleted file mode 100755 index bd5e3f85..00000000 --- a/charts/maven/templates/canary.yaml +++ /dev/null @@ -1,58 +0,0 @@ -{{- if .Values.canary.enabled }} -apiVersion: flagger.app/v1alpha3 -kind: Canary -metadata: - name: {{ template "fullname" . }} - labels: - draft: {{ default "draft-app" .Values.draft }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" -spec: - provider: istio - targetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ template "fullname" . }} - progressDeadlineSeconds: {{ .Values.canary.progressDeadlineSeconds }} - {{- if .Values.hpa.enabled }} - autoscalerRef: - apiVersion: autoscaling/v2beta1 - kind: HorizontalPodAutoscaler - name: {{ template "fullname" . }} - {{- end }} - service: - port: {{ .Values.service.externalPort }} - targetPort: {{ .Values.service.internalPort }} - gateways: - - {{ template "fullname" . }} - hosts: - - {{ .Values.canary.host }} - canaryAnalysis: - interval: {{ .Values.canary.canaryAnalysis.interval }} - threshold: {{ .Values.canary.canaryAnalysis.threshold }} - maxWeight: {{ .Values.canary.canaryAnalysis.maxWeight }} - stepWeight: {{ .Values.canary.canaryAnalysis.stepWeight }} - metrics: - - name: request-success-rate - threshold: {{ .Values.canary.canaryAnalysis.metrics.requestSuccessRate.threshold }} - interval: {{ .Values.canary.canaryAnalysis.metrics.requestSuccessRate.interval }} - - name: request-duration - threshold: {{ .Values.canary.canaryAnalysis.metrics.requestDuration.threshold }} - interval: {{ .Values.canary.canaryAnalysis.metrics.requestDuration.interval }} - ---- - -apiVersion: networking.istio.io/v1alpha3 -kind: Gateway -metadata: - name: {{ template "fullname" . }} -spec: - selector: - istio: ingressgateway - servers: - - port: - number: {{ .Values.service.externalPort }} - name: http - protocol: HTTP - hosts: - - {{ .Values.canary.host }} -{{- end }} diff --git a/charts/maven/templates/deployment.yaml b/charts/maven/templates/deployment.yaml deleted file mode 100755 index f4858abc..00000000 --- a/charts/maven/templates/deployment.yaml +++ /dev/null @@ -1,56 +0,0 @@ -{{- if .Values.knativeDeploy }} -{{- else }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "fullname" . }} - labels: - draft: {{ default "draft-app" .Values.draft }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" -spec: -{{- if .Values.hpa.enabled }} -{{- else }} - replicas: {{ .Values.replicaCount }} -{{- end }} - 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 }} - env: -{{- range $pkey, $pval := .Values.env }} - - name: {{ $pkey }} - value: {{ quote $pval }} -{{- end }} - envFrom: -{{ toYaml .Values.envFrom | indent 10 }} - ports: - - containerPort: {{ .Values.service.internalPort }} - livenessProbe: - httpGet: - path: {{ .Values.probePath }} - port: {{ .Values.service.internalPort }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - readinessProbe: - httpGet: - path: {{ .Values.probePath }} - port: {{ .Values.service.internalPort }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - resources: -{{ toYaml .Values.resources | indent 12 }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} -{{- end }} diff --git a/charts/maven/templates/hpa.yaml b/charts/maven/templates/hpa.yaml deleted file mode 100755 index 1c03eb4c..00000000 --- a/charts/maven/templates/hpa.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{{- if .Values.hpa.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ template "fullname" . }} - labels: - draft: {{ default "draft-app" .Values.draft }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ template "fullname" . }} - minReplicas: {{ .Values.hpa.minReplicas }} - maxReplicas: {{ .Values.hpa.maxReplicas }} - metrics: - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.hpa.cpuTargetAverageUtilization }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.hpa.memoryTargetAverageUtilization }} -{{- end }} \ No newline at end of file diff --git a/charts/maven/templates/ksvc.yaml b/charts/maven/templates/ksvc.yaml deleted file mode 100755 index d37fb3f8..00000000 --- a/charts/maven/templates/ksvc.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if .Values.knativeDeploy }} -apiVersion: serving.knative.dev/v1alpha1 -kind: Service -metadata: -{{- if .Values.service.name }} - name: {{ .Values.service.name }} -{{- else }} - name: {{ template "fullname" . }} -{{- end }} - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" -spec: - runLatest: - configuration: - revisionTemplate: - spec: - container: - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: -{{- range $pkey, $pval := .Values.env }} - - name: {{ $pkey }} - value: {{ quote $pval }} -{{- end }} - livenessProbe: - httpGet: - path: {{ .Values.probePath }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - readinessProbe: - failureThreshold: {{ .Values.readinessProbe.failureThreshold }} - httpGet: - path: {{ .Values.probePath }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - resources: -{{ toYaml .Values.resources | indent 14 }} -{{- end }} diff --git a/charts/maven/templates/service.yaml b/charts/maven/templates/service.yaml deleted file mode 100755 index 9a2a4c75..00000000 --- a/charts/maven/templates/service.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{{- if or .Values.knativeDeploy .Values.canary.enabled }} -{{- else }} -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" . }} -{{- end }} diff --git a/charts/maven/values.yaml b/charts/maven/values.yaml deleted file mode 100755 index 3db56802..00000000 --- a/charts/maven/values.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Default values for Maven projects. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -image: - repository: draft - tag: dev - pullPolicy: IfNotPresent - -# define environment variables here as a map of key: value -env: - -# enable this flag to use knative serve to deploy the app -knativeDeploy: false - -# HorizontalPodAutoscaler -hpa: - enabled: false - minReplicas: 2 - maxReplicas: 6 - cpuTargetAverageUtilization: 80 - memoryTargetAverageUtilization: 80 - -# Canary deployments -# If enabled, Istio and Flagger need to be installed in the cluster -canary: - enabled: false - progressDeadlineSeconds: 60 - canaryAnalysis: - interval: "1m" - threshold: 5 - maxWeight: 60 - stepWeight: 20 - # WARNING: Canary deployments will fail and rollback if there is no traffic that will generate the below specified metrics. - metrics: - requestSuccessRate: - threshold: 99 - interval: "1m" - requestDuration: - threshold: 1000 - interval: "1m" - # The host is using Istio Gateway and is currently not auto-generated - # Please overwrite the `canary.host` in `values.yaml` in each environment repository (e.g., staging, production) - host: acme.com - -service: - name: entando-de-app - type: ClusterIP - externalPort: 80 - internalPort: 8080 - annotations: - fabric8.io/expose: "true" - fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx" -resources: - limits: - cpu: 500m - memory: 512Mi - requests: - cpu: 400m - memory: 512Mi -probePath: /actuator/health -livenessProbe: - initialDelaySeconds: 60 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 -readinessProbe: - failureThreshold: 1 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 diff --git a/charts/preview/Makefile b/charts/preview/Makefile index 42f14b65..ee1d7599 100755 --- a/charts/preview/Makefile +++ b/charts/preview/Makefile @@ -8,7 +8,7 @@ ifeq ($(OS),Darwin) 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)\/entando\/entando-de-app|" values.yaml + sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/entando\/entando-de-app-$(JEE_SERVER)|" values.yaml sed -i -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml else echo "platfrom $(OS) not supported to release from" diff --git a/charts/preview/values.yaml b/charts/preview/values.yaml index 660e45cd..3e1d95a3 100755 --- a/charts/preview/values.yaml +++ b/charts/preview/values.yaml @@ -1,13 +1,13 @@ preview: app: - repository: entando/entando-de-app-wildfly - tag: 6.0.0 + repository: docker-registry.default.svc:5000/entando/entando-de-app + tag: 6.0.8 pullPolicy: IfNotPresent entando-operator: env: ENTANDO_DOCKER_IMAGE_VERSION_DEFAULT: 6.0.0 - ENTANDO_DOCKER_REGISTRY_OVERRIDE: docker-registry.default.svcsss:5000 + ENTANDO_DOCKER_REGISTRY_OVERRIDE: docker-registry.default.svc:5000 ENTANDO_DOCKER_IMAGE_NAMESPACE_OVERRIDE: entando ENTANDO_DEFAULT_ROUTING_SUFFIX: apps.serv.run ENTANDO_POD_READINESS_TIMEOUT_SECONDS: "600" diff --git a/jenkins-x.yml b/jenkins-x.yml index 390dbf8c..d9594f7a 100755 --- a/jenkins-x.yml +++ b/jenkins-x.yml @@ -5,6 +5,8 @@ pipelineConfig: env: - name: PIPELINE_CODE value: deap + - name: JEE_SERVER + value: wildfly - name: _JAVA_OPTIONS value: -XX:+UnlockExperimentalVMOptions -Dsun.zip.disableMemoryMapping=true -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Xms1000m -Xmx12000m pipelines: @@ -18,7 +20,7 @@ pipelineConfig: name: create-admin-rolebinding - sh: mvn clean verify name: mvn-verify - - sh: echo "This avoids unwanted kaniko command substitution" && skaffold build -f skaffold.yaml + - sh: echo "This avoids unwanted kaniko command substitution" && skaffold build -p ${JEE_SERVER} -f skaffold.yaml name: container-build # - sh: run-inter-process-tests # name: run-inter-process-tests @@ -33,7 +35,7 @@ pipelineConfig: name: create-admin-rolebinding - sh: mvn clean package name: mvn-build - - sh: echo "This avoids unwanted kaniko command substitution" && skaffold build -f skaffold.yaml + - sh: echo "This avoids unwanted kaniko command substitution" && skaffold build -p ${JEE_SERVER} -f skaffold.yaml name: container-build - sh: jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION) name: post-build diff --git a/skaffold.yaml b/skaffold.yaml index 9d481e6e..7d3b12d5 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -12,6 +12,18 @@ build: deploy: kubectl: {} profiles: +- name: eap + build: + artifacts: + - image: entando/entando-de-app-eap + docker: + dockerfile: Dockerfile.eap +- name: wildfly + build: + artifacts: + - image: entando/entando-de-app-wildfly + docker: + dockerfile: Dockerfile.wildfly - name: dev build: tagPolicy: