Commit f76b998b authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

support for user-charts in virt-engine microservice + cypress test script

parent ea18a58b
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -24,8 +24,12 @@ spec:
        meepOrigin: {{ .Values.meepOrigin }}
    spec:
      serviceAccountName: {{ .Values.serviceAccount }}
      {{- if .Values.codecov.enabled}}
      volumes:
        - name: charts
          hostPath:
            path: "{{ .Values.volumes.charts.path }}"
            type: Directory
        {{- if .Values.codecov.enabled}}
        - name: codecov-storage
          persistentVolumeClaim:
            claimName: meep-virt-engine-codecov-pvc
@@ -41,8 +45,10 @@ spec:
          ports:
            - containerPort: {{ .Values.deployment.port }}
              protocol: {{ .Values.deployment.protocol }}
          {{- if .Values.codecov.enabled}}
          volumeMounts:
            - name: charts
              mountPath: /charts
            {{- if .Values.codecov.enabled}}
            - name: codecov-storage
              mountPath: /codecov
            {{- end}}
@@ -51,4 +57,3 @@ spec:
      affinity:
{{ toYaml .Values.affinity | indent 8 }}
      {{- end }}
+5 −1
Original line number Diff line number Diff line
@@ -27,7 +27,11 @@ service:
  type: ClusterIP
  port: 80

volumes:
  charts:
    path: <HOME>/.meep/charts

codecov:
  enabled: false
  
meepOrigin: co
 No newline at end of file
meepOrigin: core
 No newline at end of file
+2 −14
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package server
import (
	"errors"
	"os"
	"os/user"
	"path/filepath"
	"strconv"
	"strings"
@@ -405,19 +404,8 @@ func addExtSelector(externalTemplate *ExternalTemplate, selector string) {

func getFullPath(path string) string {
	fullPath := path

	// Get home directory
	usr, err := user.Current()
	if err != nil {
		return fullPath
	}
	homeDir := usr.HomeDir

	// Replace ~ with home directory
	if path == "~" {
		fullPath = homeDir
	} else if strings.HasPrefix(path, "~/") {
		fullPath = filepath.Join(homeDir, path[2:])
	if path != "" && !strings.HasPrefix(path, "/") {
		fullPath = filepath.Join("/charts/", path)
	}
	return fullPath
}
+2 −1
Original line number Diff line number Diff line
@@ -187,7 +187,8 @@ func deployCore(cobraCmd *cobra.Command, registry string, tag string) {
	//---
	repo = "meep-virt-engine"
	chart = gitdir + utils.RepoCfg.GetString("repo.core.meep-virt-engine.chart")
	k8sDeployCore(repo, registry, tag, chart, nil, cobraCmd)
	flags := utils.HelmFlags(nil, "--set", "volumes.charts.path="+workdir+"charts")
	k8sDeployCore(repo, registry, tag, chart, flags, cobraCmd)
	//---
	repo = "meep-mon-engine"
	chart = gitdir + utils.RepoCfg.GetString("repo.core.meep-mon-engine.chart")

test/run-cypress.sh

0 → 100755
+27 −0
Original line number Diff line number Diff line
#!/bin/bash

# Get full path to script directory
SCRIPT=$(readlink -f "$0")
BASEDIR=$(dirname "$SCRIPT")
cd $BASEDIR

echo ""
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo ">>> Running Cypress Tests"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo ""

# Retrieve workdir
WORKDIR=`grep workdir $HOME/.meepctl.yaml | sed 's/^.*workdir:[ \t]*//'`
DEMO2DIR=${WORKDIR}/charts/demo2

# Copy demo charts to workdir
mkdir -p ${DEMO2DIR}
cp -r ../examples/demo2/charts ${DEMO2DIR}
cp -r ../examples/demo2/values ${DEMO2DIR}

# Install Cypress
npm ci

# Run cypress tests
npm run cy:run