Skip to content

Commit

Permalink
Added optional maven-settings workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Senjuti256 authored and savitaashture committed Apr 25, 2024
1 parent 369a188 commit b6a4b7c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: task-maven
version: 0.2.0
version: 0.2.1
description: todo
type: application
9 changes: 9 additions & 0 deletions scripts/maven-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ if [[ -f ${MAVEN_SETTINGS_FILE} ]]; then
exit 0
fi

# Check if settings.xml exists in the workspace maven-settings
if [[ -f "${WORKSPACES_MAVEN_SETTINGS_PATH}/settings.xml" ]]; then
cp "${WORKSPACES_MAVEN_SETTINGS_PATH}/settings.xml" "${MAVEN_SETTINGS_FILE}"
echo "Using '${MAVEN_SETTINGS_FILE}' copied from optional workspace maven-settings"
cat ${MAVEN_SETTINGS_FILE}
exit 0
fi


mkdir "${MAVEN_GENERATE_DIRECTORY}"

cat > "${MAVEN_SETTINGS_FILE}" <<EOF
Expand Down
10 changes: 7 additions & 3 deletions templates/task-maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ spec:
description: The workspace consisting of maven project.
- name: server_secret
optional: true
description: The workspace containing server secrets (user and password file)
description: The workspace containing server secrets (username and password)
- name: proxy_secret
optional: true
description: The workspace containing proxy server access credentials.
description: The workspace containing proxy server access credentials (username, password).
- name: proxy_configmap
optional: true
description: The workspace containing some proxy values (proxy_port,proxy_host,proxy_non_proxy_hosts)

- name: maven_settings
optional: true
description: The workspace consisting of the custom maven settings provided by the user.
params:
- name: GOALS
description: maven goals to run
Expand Down Expand Up @@ -57,6 +59,8 @@ spec:
"workspaces.proxy_secret.bound"
"workspaces.proxy_configmap.path"
"workspaces.proxy_configmap.bound"
"workspaces.maven_settings.path"
"workspaces.maven_settings.bound"
}}
{{- include "environment" ( list $variables ) | nindent 6 }}

Expand Down
1 change: 1 addition & 0 deletions test/e2e/e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ source ./test/helper/helper.sh
--workspace="name=server_secret,secret=${E2E_MAVEN_PARAMS_SERVER_SECRET}" \
--workspace="name=proxy_secret,secret=${E2E_MAVEN_PARAMS_PROXY_SECRET}" \
--workspace="name=proxy_configmap,secret=${E2E_MAVEN_PARAMS_PROXY_CONFIGMAP}" \
--workspace name=maven_settings,volumeClaimTemplateFile=./test/e2e/resources/workspace-template.yaml \
--workspace="name=source,claimName=task-maven,subPath=source" \
--filename=test/e2e/resources/pipeline-maven.yaml \
--showlog
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/resources/workspace-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 250Mi

0 comments on commit b6a4b7c

Please sign in to comment.