Initial commit

This commit is contained in:
Erki Aas 2023-01-20 18:35:15 +02:00
commit 19ca3b75c6
18 changed files with 6431 additions and 0 deletions

18
.dockerignore Normal file
View File

@ -0,0 +1,18 @@
.kpt-pipeline/
charts/
skaffold.yaml
README.md
.git/
node_modules/
.drone.yml
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.kpt-pipeline

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM harbor.k-space.ee/docker.io/library/node AS dev
WORKDIR /app
EXPOSE 8080
COPY package* ./
RUN npm install
COPY . .
ENTRYPOINT ["npm", "run", "dev"]
# builder
FROM dev AS builder
RUN npm run build
# serve
FROM nginx AS prod
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist .
ENTRYPOINT ["nginx", "-g", "daemon off;"]

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# mobitter
### Development
Change `image:` values in `skaffold.yaml`
Development server would be deployed to playground.k-space.ee
Run skaffold:
```
skaffold dev -n <namespace> --kube-context <if-applicable>
```

5
babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

4
charts/Chart.yaml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: v1
description: Webservice to manage and preview Mobirec flip-disc displays
name: mobitter
version: 0.1.0

View File

@ -0,0 +1,62 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Chart.Name }}
annotations:
kubernetes.io/ingress.class: traefik
cert-manager.io/cluster-issuer: default
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
spec:
rules:
- host: {{ .Values.host }}
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: {{ .Chart.Name }}
port:
number: 8080
tls:
- hosts:
- "*.k-space.ee"
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}
spec:
type: ClusterIP
selector:
app: {{ .Chart.Name }}
ports:
- protocol: TCP
port: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
labels:
app: {{ .Chart.Name }}
spec:
selector:
matchLabels:
app: {{ .Chart.Name }}
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ .Chart.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.image }}
ports:
- containerPort: 8080

4
charts/values.yaml Normal file
View File

@ -0,0 +1,4 @@
replicaCount: 1
image: mobitter:latest
host: "mobitter-yeaa8.codemowers.ee"

19
jsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

9
nginx.conf Normal file
View File

@ -0,0 +1,9 @@
server {
listen 8080;
server_name _;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}

43
package.json Normal file
View File

@ -0,0 +1,43 @@
{
"name": "mobitter",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
"vue": "^3.2.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

17
public/index.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

27
skaffold.yaml Normal file
View File

@ -0,0 +1,27 @@
apiVersion: skaffold/v4beta1
kind: Config
build:
artifacts:
- image: harbor.k-space.ee/eaas/mobitter
profiles:
- name: dev
activation:
- command: dev
build:
artifacts:
- image: harbor.k-space.ee/eaas/mobitter
docker:
target: dev
sync:
manual:
- src: 'src/**'
dest: .
deploy:
helm:
releases:
- name: mobitter
chartPath: charts
setValues:
image: harbor.k-space.ee/eaas/mobitter
host: 'playground.k-space.ee'

43
src/App.vue Normal file
View File

@ -0,0 +1,43 @@
<template>
<div>
<div id="preview">{{ text }}</div>
<input v-model="input">
</div>
</template>
<script>
export default {
name: 'Mobitter-FE',
data () {
return {
input: null
}
},
computed: {
text () {
let text = this.input
// Do something with text.
return text
}
},
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
#preview {
border: 2px solid black;
width: 1200px;
height: 100px;
margin: 20px auto;
line-height: 100px;
font-size: 24px;
}
</style>

4
src/main.js Normal file
View File

@ -0,0 +1,4 @@
import { createApp } from 'vue'
import App from './App.vue'
createApp(App).mount('#app')

15
vue.config.js Normal file
View File

@ -0,0 +1,15 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
devServer: {
allowedHosts: "all",
liveReload: true,
hot: true,
client: {
webSocketURL: 'ws://0.0.0.0/ws',
},
headers: {
'Access-Control-Allow-Origin': '*',
}
},
transpileDependencies: true
})

6105
yarn.lock Normal file

File diff suppressed because it is too large Load Diff