Skip to content

Commit

Permalink
Begin update
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMMcClain committed Aug 9, 2022
1 parent 3a4af1c commit 1ec5014
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 36 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish-workshop.yaml
Original file line number Diff line number Diff line change
@@ -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}}
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions resources/training-portal.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions resources/trainingportal.yaml
Original file line number Diff line number Diff line change
@@ -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

38 changes: 15 additions & 23 deletions resources/workshop.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1ec5014

Please sign in to comment.