Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added Maven java 17 pack #914

Merged
merged 47 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d17f42b
fix: removed deprecated java options
babadofar Aug 6, 2021
6407c8d
Replace mvn deploy with mvn install
sajol Aug 11, 2021
0ae012f
Update release.yaml
sajol Aug 11, 2021
483621c
Merge branch 'jenkins-x:master' into master
babadofar Aug 11, 2021
2755cf2
Update release.yaml
sajol Aug 11, 2021
5c21951
chore(deps): upgrade Mentor-Medier/jx3-pipeline-catalog to version 3.…
pow-devops2020 Aug 11, 2021
214dcf6
Merge pull request #2 from Mentor-Medier/pr-fca5196b-ef60-42ad-8647-0…
babadofar Aug 11, 2021
8f9a88f
Update release.yaml
babadofar Aug 12, 2021
0a47d92
Update release.yaml
babadofar Aug 12, 2021
05d42d7
Update release.yaml
babadofar Aug 12, 2021
72e7a19
Merge pull request #4 from Mentor-Medier/babadofar-patch-1
sajol Aug 12, 2021
b9c3b24
Java 11 update task link to Mentor-medier from jenkins-x
sultanmahmud0 Aug 13, 2021
c6c5569
Merge pull request #5 from Mentor-Medier/update-task-link-to-mentor
sajol Aug 13, 2021
1967971
Merge branch 'master' of https://github.com/jenkins-x/jx3-pipeline-ca…
babadofar Aug 15, 2021
8bf5bf5
Merge pull request #7 from Mentor-Medier/jenkins-x-master
babadofar Aug 15, 2021
5d0264b
chore(deps): upgrade Mentor-Medier/jx3-pipeline-catalog to version 3.…
pow-devops2020 Aug 16, 2021
6b67e89
Merge pull request #29 from Mentor-Medier/pr-38348248-0332-4665-93b9-…
babadofar Aug 16, 2021
14ac8ce
Update release.yaml
sajol Aug 25, 2021
9d04a5c
Update release.yaml
sajol Aug 25, 2021
4916f3f
chore: use Mentor-Medier catalog
sajol Aug 25, 2021
b0a9955
chore(deps): upgrade Mentor-Medier/jx3-pipeline-catalog to version 3.…
pow-devops2020 Sep 2, 2021
12d47bd
chore(deps): upgrade Mentor-Medier/jx3-pipeline-catalog to version 3.…
pow-devops2020 Sep 2, 2021
db387d7
Merge pull request #100 from Mentor-Medier/pr-b0f1221b-3e02-4596-ab2d…
babadofar Sep 2, 2021
9cebb2a
Merge branch 'jenkins-x:master' into master
babadofar Sep 5, 2021
a3de69a
Adding option to use maven batch mode
babadofar Sep 5, 2021
ab729c1
Update release.yaml
babadofar Sep 5, 2021
f42be42
Update release.yaml
babadofar Sep 5, 2021
ff2b414
Update pullrequest.yaml
babadofar Sep 5, 2021
4f950d2
Merge pull request #101 from Mentor-Medier/babadofar-patch-2
babadofar Sep 5, 2021
064dbaf
Merge pull request #99 from Mentor-Medier/pr-c436b2b2-2b23-4325-9c6d-…
babadofar Sep 5, 2021
13b901a
chore(deps): upgrade Mentor-Medier/jx3-pipeline-catalog to version 3.…
pow-devops2020 Sep 19, 2021
4160a73
chore(deps): upgrade Mentor-Medier/jx3-pipeline-catalog to version 3.…
pow-devops2020 Sep 19, 2021
c7f029a
Merge pull request #114 from Mentor-Medier/pr-453b9cec-cc98-4ca6-b59a…
babadofar Sep 19, 2021
e5c8219
Merge pull request #113 from Mentor-Medier/pr-e21ff860-24cb-48ed-b052…
babadofar Sep 19, 2021
e361733
added mvn-install step to maven-java-16
babadofar Sep 30, 2021
2c241ac
Merge pull request #116 from Mentor-Medier/babadofar-patch-2
sajol Sep 30, 2021
4a65275
feat: added maven-java17 build pack
babadofar Sep 30, 2021
a505f3d
Merge pull request #117 from Mentor-Medier/maven-java-17
babadofar Sep 30, 2021
b25f1dc
merged
babadofar Oct 1, 2021
5fb4975
Merge pull request #118 from Mentor-Medier/jenkins-x-master
babadofar Oct 1, 2021
d0c17a9
fix: merge not resolved
babadofar Oct 1, 2021
6e61ba9
fix: dockerfile for maven 17
babadofar Oct 1, 2021
11ad35e
Update pullrequest.yaml
babadofar Oct 1, 2021
03e3bde
fix: reference to jenkins-x repos
babadofar Oct 1, 2021
5d8a648
fix: reference to jenkins-x repos
babadofar Oct 1, 2021
081ffa2
fix: reference to jenkins-x repos
babadofar Oct 1, 2021
3732672
Update pullrequest.yaml
babadofar Oct 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packs/maven-java16/.lighthouse/jenkins-x/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
env:
- name: MAVEN_OPTS
value: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/maven-java14/pullrequest.yaml@versionStream
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/maven-java16/pullrequest.yaml@versionStream
babadofar marked this conversation as resolved.
Show resolved Hide resolved
name: ""
resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion packs/maven-java16/.lighthouse/jenkins-x/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
env:
- name: MAVEN_OPTS
value: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/maven-java14/release.yaml@versionStream
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/maven-java16/release.yaml@versionStream
babadofar marked this conversation as resolved.
Show resolved Hide resolved
name: ""
resources:
requests:
Expand Down
50 changes: 50 additions & 0 deletions packs/maven-java17/.lighthouse/jenkins-x/pullrequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
creationTimestamp: null
name: pullrequest
spec:
pipelineSpec:
tasks:
- name: from-build-pack
resources: {}
taskSpec:
metadata: {}
stepTemplate:
env:
- name: MAVEN_OPTS
value: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/maven-java17/pullrequest.yaml@versionStream
name: ""
resources:
requests:
cpu: 400m
memory: 512Mi
volumeMounts:
- mountPath: /root/.m2/
name: maven-settings
workingDir: /workspace/source
steps:
- image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone-pr.yaml@versionStream
name: ""
resources: {}
- name: jx-variables
resources: {}
- name: build-set-version
resources: {}
- name: build-mvn-install
resources: {}
- name: check-registry
resources: {}
- name: build-container-build
resources: {}
- name: promote-jx-preview
resources: {}
volumes:
- name: maven-settings
secret:
secretName: jenkins-maven-settings
podTemplate: {}
serviceAccountName: tekton-bot
timeout: 1h0m0s
status: {}
60 changes: 60 additions & 0 deletions packs/maven-java17/.lighthouse/jenkins-x/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
creationTimestamp: null
name: release
spec:
pipelineSpec:
tasks:
- name: from-build-pack
resources: {}
taskSpec:
metadata: {}
stepTemplate:
env:
- name: MAVEN_OPTS
value: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/maven-java17/release.yaml@versionStream
name: ""
resources:
requests:
cpu: 400m
memory: 512Mi
volumeMounts:
- mountPath: /root/.m2/
name: maven-settings
- mountPath: /root/.gnupg
name: release-gpg
workingDir: /workspace/source
steps:
- image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone.yaml@versionStream
name: ""
resources: {}
- name: next-version
resources: {}
- name: jx-variables
resources: {}
- name: build-mvn-deploy
resources: {}
- name: check-registry
resources: {}
- name: build-container-build
resources: {}
- name: promote-changelog
resources: {}
- name: promote-helm-release
resources: {}
- name: promote-jx-promote
resources: {}
volumes:
- name: maven-settings
secret:
secretName: jenkins-maven-settings
- name: release-gpg
secret:
optional: true
secretName: jenkins-release-gpg
podTemplate: {}
serviceAccountName: tekton-bot
timeout: 12h0m0s
status: {}
16 changes: 16 additions & 0 deletions packs/maven-java17/.lighthouse/jenkins-x/triggers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: config.lighthouse.jenkins-x.io/v1alpha1
kind: TriggerConfig
spec:
presubmits:
- name: pr
context: "pr"
always_run: true
optional: false
source: "pullrequest.yaml"
postsubmits:
- name: release
context: "release"
source: "release.yaml"
branches:
- ^main$
- ^master$
14 changes: 14 additions & 0 deletions packs/maven-java17/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM openjdk:17-jdk-slim
ENV PORT 8080
ENV CLASSPATH /opt/lib
EXPOSE 8080

# copy pom.xml and wildcards to avoid this command failing if there's no target/lib directory
COPY pom.xml target/lib* /opt/lib/

# NOTE we assume there's only 1 jar in the target dir
# but at least this means we don't have to guess the name
# we could do with a better way to know the name - or to always create an app.jar or something
COPY target/*.jar /opt/app.jar
WORKDIR /opt
CMD ["java", "-jar", "app.jar"]
21 changes: 21 additions & 0 deletions packs/maven-java17/charts/.helmignore
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
5 changes: 5 additions & 0 deletions packs/maven-java17/charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: REPLACE_ME_APP_NAME
description: A Helm chart for Kubernetes
apiVersion: v1
version: 0.1.0-SNAPSHOT
icon: https://raw.githubusercontent.com/cdfoundation/artwork/master/jenkinsx/icon/color/jenkinsx-icon-color.png
11 changes: 11 additions & 0 deletions packs/maven-java17/charts/Kptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kpt.dev/v1alpha1
kind: Kptfile
metadata:
name: charts
upstream:
type: git
git:
commit: b52b35506a05e046d54615c3ade97f3aef8bfb08
repo: https://github.com/jenkins-x/jx3-pipeline-catalog
directory: /helm/charts
ref: master
48 changes: 48 additions & 0 deletions packs/maven-java17/charts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
CHART_REPO := http://jenkins-x-chartmuseum:8080
CURRENT=$(pwd)
NAME := REPLACE_ME_APP_NAME
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)\/REPLACE_ME_DOCKER_REGISTRY_ORG\/REPLACE_ME_APP_NAME|" 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 "chore: 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)
1 change: 1 addition & 0 deletions packs/maven-java17/charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Java 14 application
4 changes: 4 additions & 0 deletions packs/maven-java17/charts/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

Get the application URL by running these commands:

kubectl get ingress {{ template "fullname" . }}
16 changes: 16 additions & 0 deletions packs/maven-java17/charts/templates/_helpers.tpl
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 -}}
66 changes: 66 additions & 0 deletions packs/maven-java17/charts/templates/canary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{- if .Values.canary.enabled }}
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: {{ template "fullname" . }}
labels:
draft: {{ default "draft-app" .Values.draft }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.canary.labels }}
{{ toYaml .Values.canary.labels | indent 4 }}
{{- end }}
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 | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain) }}
analysis:
interval: {{ .Values.canary.analysis.interval }}
threshold: {{ .Values.canary.analysis.threshold }}
maxWeight: {{ .Values.canary.analysis.maxWeight }}
stepWeight: {{ .Values.canary.analysis.stepWeight }}
metrics:
- name: latency
templateRef:
name: latency
namespace: istio-system
thresholdRange:
max: {{ .Values.canary.analysis.metrics.latency.threshold }}
interval: {{ .Values.canary.analysis.metrics.latency.interval | quote }}

---

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: {{ template "fullname" . }}
{{- if .Values.canary.gatewayLabels }}
labels:
{{ toYaml .Values.canary.gatewayLabels | indent 4 }}
{{- end }}
spec:
selector:
istio: ingressgateway
servers:
- port:
number: {{ .Values.service.externalPort }}
name: http
protocol: HTTP
hosts:
- {{ .Values.canary.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain) }}
{{- end }}
Loading