From 1ec50141b14626806132bc104cfee046b2f818d0 Mon Sep 17 00:00:00 2001 From: Brian McClain Date: Tue, 9 Aug 2022 16:36:18 -0400 Subject: [PATCH] Begin update --- .github/workflows/publish-workshop.yaml | 24 ++++++++++++++++ Makefile | 21 ++++++++++++++ resources/training-portal.yaml | 13 --------- resources/trainingportal.yaml | 16 +++++++++++ resources/workshop.yaml | 38 ++++++++++--------------- 5 files changed, 76 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/publish-workshop.yaml create mode 100644 Makefile delete mode 100644 resources/training-portal.yaml create mode 100644 resources/trainingportal.yaml diff --git a/.github/workflows/publish-workshop.yaml b/.github/workflows/publish-workshop.yaml new file mode 100644 index 0000000..e14adbc --- /dev/null +++ b/.github/workflows/publish-workshop.yaml @@ -0,0 +1,24 @@ +name: Publish Workshop + +on: + push: + tags: + - "[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+-alpha.[0-9]+" + - "[0-9]+.[0-9]+-beta.[0-9]+" + - "[0-9]+.[0-9]+-rc.[0-9]+" + +jobs: + publish-workshop: + runs-on: ubuntu-latest + + if: ${{github.repository != 'vmware-tanzu-labs/educates-workshop-templates'}} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Create release + uses: vmware-tanzu-labs/educates-github-actions/publish-workshop@v4 + with: + token: ${{secrets.GITHUB_TOKEN}} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5076a5c --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +PORTAL_NAME = lab-spring-on-kubernetes +REGISTRY = localhost:5001 + +all: publish-workshop deploy-workshop + +publish-workshop: + imgpkg push -i $(REGISTRY)/$(PORTAL_NAME)-files:latest -f . + +deploy-workshop: update-workshop + kubectl apply -f resources/trainingportal.yaml + STATUS=1; ATTEMPTS=0; ROLLOUT_STATUS_CMD="kubectl rollout status deployment/training-portal -n $(PORTAL_NAME)-ui"; until [ $$STATUS -eq 0 ] || $$ROLLOUT_STATUS_CMD || [ $$ATTEMPTS -eq 5 ]; do sleep 5; $$ROLLOUT_STATUS_CMD; STATUS=$$?; ATTEMPTS=$$((ATTEMPTS + 1)); done + +update-workshop: + kubectl apply -f resources/workshop.yaml + +delete-workshop: + -kubectl delete -f resources/trainingportal.yaml --cascade=foreground + -kubectl delete -f resources/workshop.yaml + +open-workshop: + URL=`kubectl get trainingportal/$(PORTAL_NAME) -o go-template={{.status.educates.url}}`; (test -x /usr/bin/xdg-open && xdg-open $$URL) || (test -x /usr/bin/open && open $$URL) || true \ No newline at end of file diff --git a/resources/training-portal.yaml b/resources/training-portal.yaml deleted file mode 100644 index 105c45e..0000000 --- a/resources/training-portal.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: training.eduk8s.io/v1alpha1 -kind: TrainingPortal -metadata: - name: lab-workshop-1 -spec: - portal: - registration: - type: anonymous - workshops: - - name: lab-workshop-1 - capacity: 1 - expires: 160m - orphaned: 5m diff --git a/resources/trainingportal.yaml b/resources/trainingportal.yaml new file mode 100644 index 0000000..1584090 --- /dev/null +++ b/resources/trainingportal.yaml @@ -0,0 +1,16 @@ +apiVersion: training.educates.dev/v1beta1 +kind: TrainingPortal +metadata: + name: lab-spring-on-kubernetes +spec: + portal: + registration: + type: anonymous + updates: + workshop: true + workshops: + - name: lab-spring-on-kubernetes + capacity: 1 + expires: 60m + orphaned: 5m + \ No newline at end of file diff --git a/resources/workshop.yaml b/resources/workshop.yaml index 7eaea02..3f4b2ce 100644 --- a/resources/workshop.yaml +++ b/resources/workshop.yaml @@ -1,41 +1,33 @@ -apiVersion: training.eduk8s.io/v1alpha2 +apiVersion: training.educates.dev/v1beta1 kind: Workshop metadata: - name: lab-workshop-1 + name: lab-spring-on-kubernetes spec: title: Spring on Kubernetes description: Spring on Kubernetes workshop - vendor: eduk8s.io - difficulty: beginner - duration: 15m - url: https://github.com/springone-tour-2021/lab-workshop-1 - content: - image: quay.io/eduk8s/jdk11-environment:210217.091829.d9293c8 - files: github.com/springone-tour-2021/lab-workshop-1?ref=main + workshop: + image: jdk17-environment:* + files: + - image: + url: $(image_repository)/lab-spring-on-kubernetes-files:latest + includePaths: + - /workshop/** + - /exercises/** session: - session: - ingresses: - - name: petclinic - protocol: http - host: petclinic-app.$(session_namespace).svc.cluster.local - port: 80 - dashboards: - - name: Petclinic - url: "$(ingress_protocol)://$(session_namespace)-petclinic.$(ingress_domain)/" namespaces: budget: large - resources: - memory: 1.7Gi + security: + policy: baseline + resources: + memory: 2Gi applications: terminal: enabled: true layout: split - console: - enabled: true - vendor: octant editor: enabled: true registry: enabled: true docker: enabled: true + \ No newline at end of file