Skip to content

Commit 1ba8752

Browse files
pmarkiewkamdroll
authored andcommitted
feat(content): laod example-apps via content-loader functionality
- Move example-app definitions from `argocd/example-apps` and `applications/` into `examples/example-apps-via-content-loader` - Adjust Dockerfile to initialize example-apps folder as standalone git repo for content-loader - Update `GitopsPlaygroundCli` to include content examples via `--content.examples` flag - Extend config merging logic (`MapUtils.deepMerge`) to support additional example content source - Update schema, configurator, and tests to handle example-apps path and validation - Clean up redundant templates and adjust paths accordingly This refactor isolates example application definitions into a dedicated content-loader directory, simplifying configuration handling and enabling dynamic content loading via the CLI.
1 parent 40b86bb commit 1ba8752

File tree

68 files changed

+239
-1224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+239
-1224
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Allowlist
55
!applications/
6+
!examples/
67
!exercises/
78
!argocd/
89
!docker-registry/

Dockerfile

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ ENV HOME=/home \
218218
GITOPS_BUILD_LIB_REPO=/gitops/repos/gitops-build-lib.git \
219219
CES_BUILD_LIB_REPO=/gitops/repos/ces-build-lib.git \
220220
JENKINS_PLUGIN_FOLDER=/gitops/jenkins-plugins/ \
221-
LOCAL_HELM_CHART_FOLDER=/gitops/charts/
221+
LOCAL_HELM_CHART_FOLDER=/gitops/charts/ \
222+
EXAMPLE_APPS_CONTENT_REPO=/app/examples/example-apps-via-content-loader
222223

223224
WORKDIR /app
224225

@@ -232,10 +233,30 @@ RUN apk update --no-cache && apk upgrade --no-cache && \
232233
git \
233234
unzip
234235

235-
USER 1000:0
236-
237236
COPY --from=downloader /dist /
238237

238+
# Set example apps config to use the repos from the image
239+
RUN sed -i \
240+
-e "s|url: https://github.com/cloudogu/gitops-build-lib|url: 'file://$GITOPS_BUILD_LIB_REPO'|g" \
241+
-e "s|url: https://github.com/cloudogu/ces-build-lib|url: 'file://$CES_BUILD_LIB_REPO'|g" \
242+
-e "s|url: https://github.com/cloudogu/spring-boot-helm-chart|url: 'file://$SPRING_BOOT_HELM_CHART_REPO'|g" \
243+
-e "s|url: https://github.com/cloudogu/spring-petclinic|url: 'file://$SPRING_PETCLINIC_REPO'|g" \
244+
-e "s|url: https://github.com/cloudogu/gitops-playground|url: 'file://$EXAMPLE_APPS_CONTENT_REPO'|g" \
245+
-e "/^[[:space:]]*path: examples\/example-apps-via-content-loader\//d" \
246+
/app/examples/example-apps-via-content-loader/config.yaml
247+
248+
# Initialize example apps folder with git, so we can use it with content-loader
249+
# we need safe.directory setting because of: fatal: detected dubious ownership in repository at '/app/examples/example-apps-via-content-loader'
250+
RUN git -C /app/examples/example-apps-via-content-loader init -b main && \
251+
git -C /app/examples/example-apps-via-content-loader config user.email "noreply@example.com" && \
252+
git -C /app/examples/example-apps-via-content-loader config user.name "Container" && \
253+
git -C /app/examples/example-apps-via-content-loader add -A && \
254+
git -C /app/examples/example-apps-via-content-loader commit -m "initial commit" && \
255+
git config --global --add safe.directory /app/examples/example-apps-via-content-loader
256+
257+
258+
USER 1000:0
259+
239260
ARG VCS_REF
240261
ARG BUILD_DATE
241262
LABEL org.opencontainers.image.title="gitops-playground" \

applications/argocd/nginx/helm-jenkins/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

applications/argocd/nginx/helm-jenkins/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

applications/argocd/nginx/helm-jenkins/k8s/values-production.ftl.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

applications/argocd/nginx/helm-umbrella/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

applications/argocd/petclinic/helm/k8s/production/configMap.ftl.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

applications/argocd/petclinic/helm/k8s/staging/configMap.ftl.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

applications/argocd/petclinic/helm/k8s/values-production.ftl.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

applications/argocd/petclinic/helm/k8s/values-staging.ftl.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)