Commit d6b5938c by SHINDAESUB

first

parents
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
VUE_APP_MODE=development
VUE_APP_MODE=production
VUE_APP_GRAPHQL_HTTP="https://www.nemopai.com/graphql"
VUE_APP_GRAPHQL_WS="wss://www.nemopai.com/graphql"
VUE_APP_GRAPHQL_WPO_HTTP="https://www.nemopai.com/graphql/wpo/"
VUE_APP_GRAPHQL_WPO_WS="wss://www.nemopai.com/graphql/wpo/ws"
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
.DS_Store
node_modules
/dist
/tests/e2e/videos/
/tests/e2e/screenshots/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# home-editor-single-text
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```
### Run your end-to-end tests
```
npm run test:e2e
```
### Run your unit tests
```
npm run test:unit
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/app'
]
}
{
"pluginsFile": "tests/e2e/plugins/index.js"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "home-ksskor-single-web",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"core-js": "^2.6.10",
"vue": "^2.6.10",
"vue-apollo": "^3.0.1",
"vue-router": "^3.1.3",
"vuetify": "^2.2.11",
"vuex": "^3.1.2"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.11.2",
"@vue/cli-plugin-babel": "^3.12.1",
"@vue/cli-plugin-eslint": "^3.12.1",
"@vue/cli-plugin-unit-mocha": "^3.12.1",
"@vue/cli-service": "^3.12.1",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/test-utils": "1.0.0-beta.29",
"babel-eslint": "^10.0.3",
"base64url": "^3.0.1",
"chai": "^4.1.2",
"codemirror": "^5.49.2",
"detect-content-type": "^1.2.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.2.3",
"fontfaceobserver": "^2.1.0",
"graphql-tag": "^2.9.0",
"markdown-it-vue": "^1.0.10",
"material-design-icons-iconfont": "^5.0.1",
"moment": "^2.26.0",
"sass": "^1.23.7",
"sass-loader": "^7.3.1",
"shortid": "^2.2.15",
"vee-validate": "^2.2.15",
"vue-cli-plugin-apollo": "^0.20.0",
"vue-cli-plugin-vuetify": "~2.0.7",
"vue-codemirror-lite": "^1.0.4",
"vue-google-api": "^0.2.0",
"vue-simple-markdown": "^1.1.1",
"vue-template-compiler": "^2.6.10",
"vue2-ace-editor": "0.0.15",
"vuetify-loader": "^1.4.2",
"vuex-persistedstate": "^2.7.0",
"vuex-shared-mutations": "^1.0.2",
"webpack-conditional-loader": "^1.0.12",
"xterm": "^3.14.5"
}
}
module.exports = {
plugins: {
autoprefixer: {}
}
}
<!DOCTYPE html>
<html lang="en">
<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>json json</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
<body>
<noscript>
<strong>We're sorry but home-editor-single-text 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>
NODE_ENV=production
VUE_APP_GRAPHQL_HTTP="https://www.kcert2018.com/graphql"
VUE_APP_GRAPHQL_WS="wss://www.kcert2018.com/graphql"
VUE_APP_GRAPHQL_WPO_HTTP="https://www.kcert2018.com/graphql/wpo/"
VUE_APP_GRAPHQL_WPO_WS="wss://www.kcert2018.com/graphql/wpo/ws"
<template>
<f-app-kcert2-one
mainTitle="KCERT2018" subTitle="json json"
:wpoID="wpoID" :wpoLinked="isLinked"
@wpo-disconnect="clickCloseConnectWPOId"
>
<f-box h="864px" b="black" class="pa-0">
<keep-alive include="">
<router-view/>
</keep-alive>
</f-box>
</f-app-kcert2-one>
</template>
<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
name: 'App',
data () {
return {
}
},
computed: {
...mapGetters({
wpoID: 'json-single-json/wpoID',
isLinked: 'json-single-json/isLinked'
})
},
components: {
},
methods: {
...mapMutations({
setWPOID: 'json-single-json/wpoID'
}),
...mapActions({
closeWPOClient: 'json-single-json/closeWPOClient'
}),
clickCloseConnectWPOId () {
this.setWPOID('')
this.closeWPOClient()
this.$router.push('/first')
}
},
created () {
window.addEventListener('beforeunload', (event) => {
}, false)
// window.addEventListener('touchstart', (event) => {
// event.preventDefault()
// }, { passive: true })
// window.addEventListener('touchmove', (event) => {
// event.preventDefault()
// }, { passive: true })
// window.addEventListener('mousewheel', (event) => {
// event.preventDefault()
// }, { passive: true })
},
mounted () {
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
@import url('https://cdn.materialdesignicons.com/2.8.94/css/materialdesignicons.min.css');
/* Global CSS */
@import url('https://www.kcert2018.com/common/fonts/d2coding/d2coding.css');
</style>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>
// import vMainToolBar from './main/tool-bar-v04'
let mainComponents = {}
mainComponents.install = (Vue, options) => {
// Vue.component('v-main-tool-bar', vMainToolBar)
}
export default mainComponents
export default {
LOCAL_STORAGE_USER_ID: 'user-id',
LOCAL_STORAGE_TOKEN: 'token',
LOCAL_STORAGE_REFRESH_TOKEN: 'refresh-token'
}
import Vue from 'vue'
export const EventBus = new Vue()
// VERSION 001
export const delay = (delayTime) => {
return new Promise(resolve => setTimeout(() => {
// console.log('delayTime = ', delayTime)
resolve()
}, delayTime))
}
// VERSION 001
import WPOClient from '@/wpo/v1.0.0/wpo-client'
export default class WPOAgentClient {
constructor (wpoId) {
// console.log('CALL WPOAgentClient constructor()')
this.wpoId = wpoId
this.isLinked = false
this.onLinked = null // fuction ()
this.onUnlinked = null // fuction ()
this.onStdout = null // fuction (pid, data, time)
this.onEmit = null // fuction (name, data, time)
let wpoClient = new WPOClient(wpoId)
this.wpoClient = wpoClient
this.buildEventsHandler()
}
buildEventsHandler () {
let wpoClient = this.wpoClient
wpoClient.onLinked = () => {
// console.log('EVENT ON Linked')
this.isLinked = true
if (this.onLinked) this.onLinked()
}
wpoClient.onUnlinked = () => {
// console.log('EVENT ON Unlinked')
this.isLinked = false
if (this.onUnlinked) this.onUnlinked()
}
wpoClient.onError = (err) => {
console.log('EVENT ON Error err = ', err)
}
wpoClient.onEmit = (name, data, time) => {
// console.log('EVENT emit time, name, data = ', time, name, data)
if (this.onEmit) this.onEmit(name, data, time)
}
wpoClient.onStdout = (pid, data, time) => {
// console.log('EVENT stdout time, pid, data = ', time, pid, data)
if (this.onStdout) this.onStdout(pid, data, time)
}
}
connect () {
let wpoClient = this.wpoClient
if (!wpoClient) return
wpoClient.connect()
}
comment (str) {
let wpoClient = this.wpoClient
if (!wpoClient) return
wpoClient.comment(str)
}
disconnect () {
let wpoClient = this.wpoClient
if (!wpoClient) return
wpoClient.disconnect()
}
stdin (pid, data) {
let wpoClient = this.wpoClient
if (!wpoClient) return
wpoClient.stdin(pid, data)
}
async Pwd () {
let wpoClient = this.wpoClient
if (!wpoClient) return
let currentDirectory = ''
try {
let resultStr = await wpoClient.call('pwd', '{}')
// console.log('Pwd():resultStr = ', resultStr)
let result = JSON.parse(resultStr)
currentDirectory = result.currentDirectory
} catch (e) {
console.log('Pwd():Error:', e.message)
throw e
}
return currentDirectory
}
async Lstate (path) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let state = {}
try {
let resultStr = await wpoClient.call('lstate', `{ "path" : "${path}" }`)
// console.log('Lstate():resultStr = ', resultStr)
let result = JSON.parse(resultStr)
// console.log('result = ', result)
state = result
} catch (e) {
console.log('Lstate():Error:', e.message)
throw e
}
return state
}
async Dir (path) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dirList = {}
try {
let resultStr = await wpoClient.call('dir', `{ "path" : "${path}" }`)
// console.log('Dir():resultStr = ', resultStr)
let result = JSON.parse(resultStr)
// console.log('result = ', result)
dirList = result
} catch (e) {
console.log('Dir():Error:', e.message)
throw e
}
return dirList
}
async DirTree (path) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dirTree = {}
try {
let resultStr = await wpoClient.call('dir:tree', `{ "path" : "${path}" }`)
// console.log('Dir():resultStr = ', resultStr)
let result = JSON.parse(resultStr)
// console.log('result = ', result)
dirTree = result
} catch (e) {
console.log('Dir():Error:', e.message)
throw e
}
return dirTree
}
async Rename (fromPath, toPath) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let result = false
try {
await wpoClient.call('rename', `{ "from" : "${fromPath}", "to" : "${toPath}" }`)
// let resultStr = await wpoClient.call('rename', `{ "from" : "${fromPath}", "to" : "${toPath}" }`)
// console.log('Rename():resultStr = ', resultStr)
// let result = JSON.parse(resultStr)
// console.log('result = ', result)
result = true
} catch (e) {
console.log('Rename():Error:', e.message)
throw e
}
return result
}
async RunCommand (path, args) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dataObj = { path, args }
let data = JSON.stringify(dataObj)
// console.log('RunCommand():data = ', data)
let result = { runOutput: '' }
try {
let resultStr = await wpoClient.call('run', data)
// console.log('RunCommand():resultStr = ', resultStr)
result = JSON.parse(resultStr)
} catch (e) {
console.log('RunCommand():Error:', e.message)
throw e
}
return result
}
async RunProcess (path, args) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dataObj = { path, args }
let data = JSON.stringify(dataObj)
// console.log('RunProcess():data = ', data)
let result = { runPid: '' }
try {
let resultStr = await wpoClient.call('process', data)
// console.log('RunProcess():resultStr = ', resultStr)
result = JSON.parse(resultStr)
} catch (e) {
console.log('RunProcess():Error:', e.message)
throw e
}
return result
}
async RunPty (path, args, rows, cols, single) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dataObj = { path, args, rows: String(rows), cols: String(cols) }
let data = JSON.stringify(dataObj)
console.log('RunPty():data = ', data)
let result = { runPid: '' }
try {
let callname = 'pty'
if (single) callname = callname + ':single'
let resultStr = await wpoClient.call(callname, data)
// console.log('RunPty():resultStr = ', resultStr)
result = JSON.parse(resultStr)
} catch (e) {
console.log('RunPty():Error:', e.message)
throw e
}
return result
}
async ReadFileAll (filePath) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dataObj = { path: filePath }
let data = JSON.stringify(dataObj)
let result = { readData: '' }
try {
let resultStr = await wpoClient.call('read:file:all', data)
// console.log('ReadFileAll():resultStr = ', resultStr)
let resultObj = JSON.parse(resultStr)
// console.log('resultObj = ', resultObj)
switch (resultObj.type) {
case 'base64' :
result.readData = Buffer.from(resultObj.data, 'base64')
break
default : throw new Error('no support type on ReadFileAll()')
}
} catch (e) {
console.log('ReadFileAll():Error:', e.message)
throw e
}
return result
}
async WriteFileOnSyscall (filePath, fileData) {
let wpoClient = this.wpoClient
if (!wpoClient) return
let dataObj = { path: filePath, type: 'utf8', data: fileData }
switch (typeof fileData) {
case 'string': dataObj.type = 'utf8'; break
default: console.error('not support type of fileData type = ', typeof fileData); return
}
let data = JSON.stringify(dataObj)
let result = { writeState: 'fail' }
try {
await wpoClient.call('write:file:syscall', data)
// let resultStr = await wpoClient.call('write:file:syscall', data)
// console.log('WriteFileOnSyscall():resultStr = ', resultStr)
result.writeState = 'success'
} catch (e) {
console.log('WriteFileOnSyscall():Error:', e.message)
throw e
}
return result
}
}
import config from '@/config-v01' // eslint-disable-line no-unused-vars
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// #if process.env.NODE_ENV !== 'test'
// import { createProvider } from './vue-apollo' // eslint-disable-line no-unused-vars
import { createProviderForWPO } from './vue-apollo-wpo' // eslint-disable-line no-unused-vars
// #endif
import VeeValidate from 'vee-validate'
// import Components from '@/components'
import FComponents from '@/fcomponents/standard/v2.0.1/'
import FontFaceObserver from 'fontfaceobserver'
import vuetify from './plugins/vuetify'
Vue.use(VeeValidate, { inject: false })
// Vue.use(Components)
Vue.use(FComponents)
Vue.config.productionTip = false
console.log('process.env.NODE_ENV : ', process.env.NODE_ENV)
const startApp = async () => {
let regularFont = new FontFaceObserver('D2 coding')
let boldFont = new FontFaceObserver('D2 coding', { weight: 'bold' })
await regularFont.load()
await boldFont.load()
console.log('finished font loading')
new Vue({
router,
store,
// #if process.env.NODE_ENV !== 'test'
// apolloProvider: createProvider(),
apolloProviderForWPO: createProviderForWPO(),
vuetify,
// #endif
render: h => h(App)
}).$mount('#app')
}
startApp()
import Vue from 'vue'
import Vuetify from 'vuetify/lib'
import 'vuetify/dist/vuetify.min.css'
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import '@fortawesome/fontawesome-free/css/all.css' // Ensure you are using css-loade
Vue.use(Vuetify)
export default new Vuetify({
icons: {
iconfont: 'mdi'
}
})
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
// mode: 'history' // history 는 외부 접근에 내부 url 사용할 수 없다.
base: process.env.BASE_URL,
routes: [
{
path: '/',
name: 'main-view',
component: () => import('@/views/main-view')
},
{
path: '/first',
name: 'main-first-view',
component: require('@/views/main-first-view-v1.0.0').default
},
{
path: '*',
redirect: '/'
}
]
})
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
// import sharedMutations from 'vuex-shared-mutations'
import modules from './modules'
Vue.use(Vuex)
export default new Vuex.Store({
plugins: [
createPersistedState({
key: 'vuex-local',
paths: [
'json-single-json.lastWpoID'
]
}),
createPersistedState({
key: 'vuex-session',
storage: window.sessionStorage,
paths: [
'json-single-json.wpoID'
]
})
// sharedMutations({
// predicate: ['wpos/syncCount']
// })
],
modules,
// strict: process.env.NODE_ENV !== 'production'
strict: false
})
/**
* The file enables `@/store/index.js` to import all vuex modules
* in a one-shot manner. There should not be any reason to edit this file.
*/
const files = require.context('.', false, /\.js$/)
const modules = {}
files.keys().forEach(key => {
if (key === './index.js') return
modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
})
export default modules
// import { delay } from '@/lib/utils-v0.0.1'
import { EventBus } from '@/event-bus'
import WPOClient from '@/lib/web-pass-on/wpo-agent-client-v1.9.0'
const state = {
wpoID: '',
lastWpoID: '',
wpoClient: null,
isLinked: false,
valueInfo: [],
checkValue: '1',
checkValueUnit: '',
readValue: '1',
readValueUnit: '',
isResultOk: false
}
const getters = {
wpoID (_state) { return _state.wpoID },
lastWpoID (_state) { return _state.lastWpoID },
isLinked (_state) { return _state.isLinked },
valueInfo (_state) { return _state.valueInfo },
checkValue (_state) { return _state.checkValue },
checkValueUnit (_state) { return _state.checkValueUnit },
readValue (_state) { return _state.readValue },
readValueUnit (_state) { return _state.readValueUnit },
isResultOk (_state) { return _state.isResultOk }
}
const mutations = {
wpoID (_state, payload) {
_state.wpoID = payload
if (payload) _state.lastWpoID = payload
},
isLinked (_state, payload) { _state.isLinked = payload },
valueInfo (_state, payload) { _state.valueInfo = payload },
checkValue (_state, payload) { _state.checkValue = payload },
checkValueUnit (_state, payload) { _state.checkValueUnit = payload },
readValue (_state, payload) { _state.readValue = payload },
readValueUnit (_state, payload) { _state.readValueUnit = payload },
isResultOk (_state, payload) { _state.isResultOk = payload }
}
const actions = {
createWPOClient ({ state, dispatch, commit }, wpoID) {
console.log('CALL json-single-json/createWPOClient() wpoID = ', wpoID)
dispatch('closeWPOClient')
commit('wpoID', wpoID)
state.wpoClient = new WPOClient(wpoID)
state.wpoClient.connect()
state.wpoClient.comment('json single json client v1.0.0')
let wpoClient = state.wpoClient
wpoClient.onLinked = async () => {
console.log('EVENT ON Linked')
commit('isLinked', true)
EventBus.$emit('json-single-json:linked')
}
wpoClient.onUnlinked = () => {
console.log('EVENT ON Unlinked')
commit('isLinked', false)
EventBus.$emit('json-single-json:unlinked')
}
wpoClient.onStdout = (pid, data, time) => {
console.log('EVENT ON Stdout data = ', data)
}
wpoClient.onEmit = (name, data, time) => {
console.log('EVENT ON emit name, data = ', name, data)
}
},
closeWPOClient ({ state, commit }) {
console.log('CALL json-single-json/closeWPOClient()')
if (!state.wpoClient) return
let wpoClient = state.wpoClient
wpoClient.disconnect()
state.wpoClient = null
commit('isLinked', false)
},
async getValueInfoFromProc ({ state, commit }) {
console.log('CALL json-single-json/getValueInfoFromProc()')
if (!state.wpoClient) return
let wpoClient = state.wpoClient
let infoArray = []
let setNumber = 0
let list = {}
try {
// 깃트 명령을 실행해서 버전을 얻는다.
let runPath = 'cat'
let runArgs = ['/proc/cpuinfo']
let result = await wpoClient.RunCommand(runPath, runArgs)
// console.log('result = ', result)
let outputStr = result.runOutput
// console.log('outputStr = ', outputStr)
let outputStrings = outputStr.split('\n')
// console.log('outputStrings = ', outputStrings)
console.log('start setNumber = ', setNumber)
console.log('start infoArray[setNumber] = ', infoArray)
outputStrings.forEach(infoStr => {
// console.log('infoStr = ', infoStr)
try {
if (infoStr) {
let fields = infoStr.split(':')
// console.log('fields = ', fields)
let fieldName = fields[0].trim()
let value = fields[1].trim()
console.log('fieldName = ', fieldName)
console.log('value = ', value)
if (fieldName === 'processor') {
// console.log('fieldName OK')
setNumber = Number(value)
list = {}
if (setNumber === 0) {
infoArray = []
}
// console.log('setNumber = ', setNumber)
}
let infoObj = { name: fieldName, value: value }
list[fieldName] = infoObj
infoArray[setNumber] = list
console.log('list = ', list)
console.log('setNumber = ', setNumber)
console.log('infoArray[setNumber] = ', infoArray)
}
} catch (e) {
console.log('getValueInfoFromProc() infoStr err = ', e)
}
})
} catch (e) {
console.log('getValueInfoFromProc() err = ', e)
}
console.log('valueInfo = ', infoArray)
commit('valueInfo', infoArray)
return infoArray
},
async kTesting ({ state, commit, dispatch }) {
console.log('CALL json-single-json/kTesting()')
let ValueCounter = []
if (!state.wpoClient) return
let valueInfo = await dispatch('getValueInfoFromProc')
console.log('valueInfo = ', valueInfo)
console.log('valueInfo.length = ', valueInfo.length)
if (valueInfo.length === 0) {
commit('readValue', '0')
commit('readValueUnit', '')
return
}
valueInfo.forEach(element => {
let checkData = true
console.log('element = ', element)
console.log(element['physical id'].value)
if (ValueCounter.length === 0) {
ValueCounter.push(element['physical id'].value)
}
ValueCounter.forEach(unit => {
console.log(element['physical id'].value)
console.log(unit)
if (element['physical id'].value === unit) { checkData = false }
})
if (checkData) {
ValueCounter.push(element['physical id'].value)
}
})
commit('readValue', ValueCounter.length + '')
commit('readValueUnit', '')
let checkCounter = parseInt(state.checkValue)
let readCounter = parseInt(ValueCounter.length)
console.log('readCounter = ', readCounter)
console.log('checkCounter = ', checkCounter)
commit('isResultOk', readCounter === checkCounter)
}
}
export default {
namespaced: true,
state,
getters,
mutations,
actions
}
<template>
<!-- eslint-disable -->
<f-simple-markdown>
<template v-slot:content>
# 검사 제목
이 검사는 내용을 검사합니다.
## 검사 방법
CPU 정보는 다음에서 얻어 옵니다.
> /proc/valueInfo
검사 방법
## 기준값
기준값 설명
> [입력값 입력값]
## 판정
판정 방법
</template>
</f-simple-markdown>
<!-- eslint-enable -->
</template>
<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
name: 'instruction-part',
data () { return {} },
computed: {
...mapGetters({
})
},
components: {},
methods: {
...mapMutations({
}),
...mapActions({
})
},
mounted () {},
activated () {}
}
</script>
<style scoped>
</style>
<template>
<f-box b="black">
<v-row
align="center"
justify="center"
>
<v-card :width="800" :height="400" class="blue lighten-4 pa-3 black--text">
<v-toolbar dense class="blue white--text">
<v-icon left>cloud_download</v-icon>
<v-toolbar-title><b>Run Agent</b></v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-card class="mx-auto" color="#26c6da" max-width="750">
<v-card-title class="pb-1">
<v-icon left> mdi-twitter </v-icon>
<span class=" white--text body-2 font-weight-bold">제어할 컴퓨터에서 다음 명령을 실행하세요</span>
</v-card-title>
<v-card-text ref='runScriptTextarea' style="word-break: break-all;word-wrap: break-word;" class="subheading black--text pt-0 pb-0">
{{ runScriptText }}
</v-card-text>
<v-card-actions class="pt-1">
<v-spacer></v-spacer>
<v-checkbox v-model="cbSudo" dark>sudo</v-checkbox>
<span class="mr-5">sudo</span>
<v-btn @click="clickScriptCopy" small color="info">Copy <v-icon small right dark>content_copy</v-icon></v-btn>
</v-card-actions>
</v-card>
<v-card class="mx-auto mt-2" color="white" max-width="750">
<v-card-title class="blue--text pb-1">
<v-icon color="blue" left> mdi-twitter </v-icon>
<span class="body-2 font-weight-bold">실행된 프로그램에서 표시된 WPO ID 를 아래에 입력하세요</span>
</v-card-title>
<v-card-text class="subheading black--text pt-0 pb-0">
<v-text-field
label="WPO ID"
v-model="editWPOId"
placeholder="please type WPO ID"
outline
class="mt-1 black--text"
light
color="warning"
@dblclick="dblclickDebugWPOID"
hide-details
></v-text-field>
</v-card-text>
<v-card-actions class="pt-1">
<v-spacer></v-spacer>
<v-btn @click="clickRun" small color="info">Run <v-icon small right dark>directions_run</v-icon></v-btn>
</v-card-actions>
</v-card>
</v-card-text>
<v-card-actions>
</v-card-actions>
</v-card>
</v-row>
</f-box>
</template>
<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
console.log('CALL MAIN-FIRST')
const storeName = 'json-single-json'
export default {
name: 'main-first-view',
data () {
return {
cbSudo: false,
editWPOId: '',
enddata: null
}
},
computed: {
...mapGetters({
lastWpoID: `${storeName}/lastWpoID`
}),
runScriptText () {
let sudoStr = this.cbSudo ? 'sudo' : ''
let runCmd = `curl -ks https://raw.githubusercontent.com/kcert2018/scripts/master/wpo-agent-nemopai/run.sh | ${sudoStr} sh`
return runCmd
}
},
components: {
},
methods: {
...mapMutations({
setWpoID: `${storeName}/wpoID`
}),
...mapActions({
}),
async clickRun () {
if (!this.editWPOId) return
this.setWpoID(this.editWPOId)
this.$router.push('/')
},
dblclickDebugWPOID () {
this.editWPOId = 'DEVELOP-WPO-PC-001'
},
clickScriptCopy () {
var t = document.createElement('textarea')
document.body.appendChild(t)
t.value = this.runScriptText
t.select()
document.execCommand('copy')
document.body.removeChild(t)
}
},
activated () {
this.editWPOId = this.lastWpoID
}
}
</script>
<style>
.script-font {
font-family: D2Coding, 'D2 coding', monosapce;
}
</style>
<style scoped>
</style>
<template>
<f-box b="transparent">
<span class="white--text">Protocol</span>
<v-textarea
filled
v-model="protocol"
name="input-7-4"
label="json type"
solo
dark
></v-textarea>
<span class="white--text">Type</span>
<v-textarea
filled
v-model="type"
name="input-7-4"
label="json type"
solo
dark
></v-textarea>
<span class="white--text">key</span>
<v-textarea
filled
v-model="key"
name="input-7-4"
label="json key"
solo
dark
></v-textarea>
<span class="white--text">Value</span>
<v-textarea
filled
v-model="value"
name="input-7-4"
label="json value"
solo
dark
></v-textarea>
<v-btn @click="test()">전송</v-btn>
</f-box>
</template>
<script>
import { mapGetters, mapMutations, mapActions ,mapState } from 'vuex'
import { EventBus } from '@/event-bus'
import instructionPart from '@/views/instruction-part'
export default {
name: 'main-view',
data () {
return {
protocol:'',
type:'',
key: '',
value:'',
checkDialog: false,
checkDialogMessage: '',
passCreateClient: false,
editProjectHeadName: 'head',
editProjectTailName: 'tail',
editTemplatePath: '',
editValue: '1'
}
},
computed: {
...mapGetters({
wpoID: 'json-single-json/wpoID',
isLinked: 'json-single-json/isLinked',
valueInfo: 'json-single-json/valueInfo',
checkValue: 'json-single-json/checkValue',
checkValueUnit: 'json-single-json/checkValueUnit',
readValue: 'json-single-json/readValue',
readValueUnit: 'json-single-json/readValueUnit',
isResultOk: 'json-single-json/isResultOk'
}),
...mapState({
wpoClient: state => state['json-single-json'].wpoClient.wpoClient //store 에 있는 wpoClient 안에 있는 wpoClient 객체를 가지고와서 사용 한다.
}),
isBeenWPOId () {
return !!this.wpoID
}
},
components: {
instructionPart
},
methods: {
...mapMutations({
setCheckValue: 'json-single-json/checkValue',
setCheckValueUnit: 'json-single-json/checkValueUnit',
setTesting: 'json-single-json/kTesting'
}),
...mapActions({
createWPOClient: 'json-single-json/createWPOClient',
getValueInfo: 'json-single-json/getValueInfoFromProc',
kTesting: 'json-single-json/kTesting'
}),
inputEditValue (v) {
// console.log('inputEditValue v = ', v)
this.editValue = v
},
clickStartTest () {
console.log('clickStartTest')
let v = this.editValue
let sizeStr = v.replace(/[^0-9]/g, '')
let unitStr = v.replace(/[^A-Za-z]/g, '')
this.setCheckValue(sizeStr)
this.setCheckValueUnit(unitStr)
this.kTesting()
},
async test(){
let kkey = this.key
let msg = {
type: this.type ,
value:{
[this.key] : this.value,
}
}
console.log("---------------------------")
console.log("msg :", JSON.stringify(msg))
console.log("---------------------------")
let result = await this.wpoClient.call(this.protocol, JSON.stringify(msg),10000)
let test =JSON.parse(result)
console.log("test :",test)
// this.resultImage = test.content
},
reload () {
console.log('reload ()')
this.getValueInfo()
console.log(this.valueInfo)
if (this.valueInfo.length === 0) {
setTimeout(() => {
this.reload()
}, 1000)
}
}
},
mounted () {
console.log('mounted')
EventBus.$on('json-single-json:linked', async (msg) => {
console.log('EVENT json-single-json:linked')
})
},
activated () {
console.log('CALL activated')
let thisView = this
thisView.checkDialogMessage = 'Cheking before connect state'
thisView.checkDialog = true
thisView.passCreateClient = false
let waitCheckInterval = setInterval(() => {
if (!thisView.isBeenWPOId) {
thisView.$router.push('/first')
thisView.checkDialog = false
clearInterval(waitCheckInterval)
return
}
if (!thisView.passCreateClient) {
thisView.createWPOClient(this.wpoID)
thisView.passCreateClient = true
thisView.checkDialogMessage = 'Waiting connected'
}
if (thisView.isLinked) {
thisView.checkDialog = false
clearInterval(waitCheckInterval)
}
}, 500)
this.reload()
this.editValue = this.checkValue + ' ' + this.checkValueUnit
}
}
</script>
<style scoped>
</style>
import VueApollo from 'vue-apollo'
import { createApolloClient, restartWebsockets } from 'vue-cli-plugin-apollo/graphql-client'
import { InMemoryCache } from 'apollo-cache-inmemory'
let hostname = window.location.hostname
// Name of the localStorage item
const AUTH_TOKEN = 'apollo-token'
// Endpoint
let httpEndpoint = process.env.VUE_APP_GRAPHQL_WPO_HTTP || `http://${hostname}:4000/graphql/wpo/`
let wsEndpoint = process.env.VUE_APP_GRAPHQL_WPO_WS || `ws://${hostname}:4000/graphql/wpo/ws`
// #if process.env.AS_SERVICE === 'yes'
console.log('[DEV] Access www.nemopai.com server')
httpEndpoint = `https://www.nemopai.com/graphql/wpo/`
wsEndpoint = `wss://www.nemopai.com/graphql/wpo/ws`
// #endif
console.log('[SERVER] httpEndpoint of WPO = ', httpEndpoint)
console.log('[SERVER] wsEndpoint of WPO = ', wsEndpoint)
// Files URL root
// export const filesRoot = process.env.VUE_APP_FILES_ROOT || httpEndpoint.substr(0, httpEndpoint.indexOf('/graphql/'))
// Vue.prototype.$filesRoot = filesRoot
// Config
const defaultOptions = {
// You can use `https` for secure connection (recommended in production)
httpEndpoint,
// You can use `wss` for secure connection (recommended in production)
// Use `null` to disable subscriptions
wsEndpoint,
// wsEndpoint: null,
// LocalStorage token
tokenName: AUTH_TOKEN,
// Enable Automatic Query persisting with Apollo Engine
persisting: false,
// Use websockets for everything (no HTTP)
// You need to pass a `wsEndpoint` for this to work
websocketsOnly: false,
// Is being rendered on the server?
ssr: false,
// Override default apollo link
// note: don't override httpLink here, specify httpLink options in the
// httpLinkOptions property of defaultOptions.
// link: myLink
// Override default cache
// cache: myCache
cache: new InMemoryCache({ freezeResults: false })
// Override the way the Authorization header is set
// getAuth: (tokenName) => ...
// Additional ApolloClient options
// apollo: { ... }
// Client local data (see apollo-link-state)
// clientState: { resolvers: { ... }, defaults: { ... } }
}
// Call this in the Vue app file
export let apolloProviderForWPO = null
export function createProviderForWPO (options = {}) {
// Create apollo client
const { apolloClient, wsClient } = createApolloClient({
...defaultOptions,
...options
})
apolloClient.wsClient = wsClient
// Create vue apollo provider
// const apolloProvider = new VueApollo({
apolloProviderForWPO = new VueApollo({
defaultClient: apolloClient,
// wpoClient: apolloClientOfWPO,
defaultOptions: {
$query: {
// fetchPolicy: 'cache-and-network',
}
},
errorHandler (error) {
// eslint-disable-next-line no-console
console.log('%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', error.message)
}
})
return apolloProviderForWPO
}
// Manually call this when user log in
export async function onLogin (apolloClient, token) {
if (typeof localStorage !== 'undefined' && token) {
localStorage.setItem(AUTH_TOKEN, token)
}
if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
try {
await apolloClient.resetStore()
} catch (e) {
// eslint-disable-next-line no-console
console.log('%cError on cache reset (login)', 'color: orange;', e.message)
}
}
// Manually call this when user log out
export async function onLogout (apolloClient) {
if (typeof localStorage !== 'undefined') {
localStorage.removeItem(AUTH_TOKEN)
}
if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
try {
await apolloClient.resetStore()
} catch (e) {
// eslint-disable-next-line no-console
console.log('%cError on cache reset (logout)', 'color: orange;', e.message)
}
}
import Vue from 'vue'
import VueApollo from 'vue-apollo'
import { createApolloClient, restartWebsockets } from 'vue-cli-plugin-apollo/graphql-client'
import { InMemoryCache } from 'apollo-cache-inmemory'
// Install the vue plugin
Vue.use(VueApollo)
let hostname = window.location.hostname
// Name of the localStorage item
const AUTH_TOKEN = 'apollo-token'
// Endpoint
let httpEndpoint = process.env.VUE_APP_GRAPHQL_HTTP || `http://${hostname}:4000/graphql/wpo/`
let wsEndpoint = process.env.VUE_APP_GRAPHQL_WS || `ws://${hostname}:4000/graphql/wpo/ws`
// #if process.env.AS_SERVICE === 'yes'
console.log('[DEV] Access www.nemopai.com server')
httpEndpoint = `https://www.nemopai.com/graphql/`
wsEndpoint = `wss://www.nemopai.com/graphql/ws`
// #endif
httpEndpoint = `https://www.nemopai.com/graphql`
wsEndpoint = `wss://www.nemopai.com/graphql`
// httpEndpoint = `https://www.nemopai.com/graphql/wpo/`
// wsEndpoint = `wss://www.nemopai.com/graphql/wpo/ws`
console.log('[SERVER] httpEndpoint = ', httpEndpoint)
console.log('[SERVER] wsEndpoint = ', wsEndpoint)
// Files URL root
// export const filesRoot = process.env.VUE_APP_FILES_ROOT || httpEndpoint.substr(0, httpEndpoint.indexOf('/graphql/'))
// Vue.prototype.$filesRoot = filesRoot
// Config
const defaultOptions = {
// You can use `https` for secure connection (recommended in production)
httpEndpoint,
// You can use `wss` for secure connection (recommended in production)
// Use `null` to disable subscriptions
wsEndpoint,
// wsEndpoint: null,
// LocalStorage token
tokenName: AUTH_TOKEN,
// Enable Automatic Query persisting with Apollo Engine
persisting: false,
// Use websockets for everything (no HTTP)
// You need to pass a `wsEndpoint` for this to work
websocketsOnly: false,
// Is being rendered on the server?
ssr: false,
// Override default apollo link
// note: don't override httpLink here, specify httpLink options in the
// httpLinkOptions property of defaultOptions.
// link: myLink
// Override default cache
// cache: myCache
cache: new InMemoryCache({ freezeResults: false })
// Override the way the Authorization header is set
// getAuth: (tokenName) => ...
// Additional ApolloClient options
// apollo: { ... }
// Client local data (see apollo-link-state)
// clientState: { resolvers: { ... }, defaults: { ... } }
}
// Call this in the Vue app file
export let apolloProvider = null
export function createProvider (options = {}) {
// Create apollo client
const { apolloClient, wsClient } = createApolloClient({
...defaultOptions,
...options
})
apolloClient.wsClient = wsClient
// Create vue apollo provider
// const apolloProvider = new VueApollo({
apolloProvider = new VueApollo({
defaultClient: apolloClient,
defaultOptions: {
$query: {
// fetchPolicy: 'cache-and-network',
}
},
errorHandler (error) {
// eslint-disable-next-line no-console
console.log('%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', error.message)
}
})
return apolloProvider
}
// Manually call this when user log in
export async function onLogin (apolloClient, token) {
if (typeof localStorage !== 'undefined' && token) {
localStorage.setItem(AUTH_TOKEN, token)
}
if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
try {
await apolloClient.resetStore()
} catch (e) {
// eslint-disable-next-line no-console
console.log('%cError on cache reset (login)', 'color: orange;', e.message)
}
}
// Manually call this when user log out
export async function onLogout (apolloClient) {
if (typeof localStorage !== 'undefined') {
localStorage.removeItem(AUTH_TOKEN)
}
if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
try {
await apolloClient.resetStore()
} catch (e) {
// eslint-disable-next-line no-console
console.log('%cError on cache reset (logout)', 'color: orange;', e.message)
}
}
module.exports = {
plugins: [
'cypress'
],
env: {
mocha: true,
'cypress/globals': true
},
rules: {
strict: 'off'
}
}
// https://docs.cypress.io/guides/guides/plugins-guide.html
// if you need a custom webpack configuration you can uncomment the following import
// and then use the `file:preprocessor` event
// as explained in the cypress docs
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
/* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */
// const webpack = require('@cypress/webpack-preprocessor')
module.exports = (on, config) => {
// on('file:preprocessor', webpack({
// webpackOptions: require('@vue/cli-service/webpack.config'),
// watchOptions: {}
// }))
return Object.assign({}, config, {
fixturesFolder: 'tests/e2e/fixtures',
integrationFolder: 'tests/e2e/specs',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
supportFile: 'tests/e2e/support/index.js'
})
}
// https://docs.cypress.io/api/introduction/api.html
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'Welcome to Your Vue.js App')
})
})
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
module.exports = {
env: {
mocha: true
}
}
import { expect } from 'chai'
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
})
expect(wrapper.text()).to.include(msg)
})
})
module.exports = {
devServer: {
host: '0.0.0.0'
},
pluginOptions: {
},
chainWebpack: config => {
// Webpack Conditional Loader
config.module
.rule('webpack-conditional-loader')
.test(/\.js$/)
.use('webpack-conditional-loader')
.loader('webpack-conditional-loader')
.end()
},
publicPath: process.env.NODE_ENV === 'production'
? '/json/single/json/'
: '/'
}
#!/bin/bash
echo "github backup"
git add --all
git commit -am "backup"
git push origin master
#!/bin/bash
docker rmi base/home-main-ds:0.3
docker-compose build --no-cache base-vue-cli-3-ds
#!/bin/bash
echo -e "clean home json-single-json"
cd ../apps/home-json-single-json
rm -rf node_modules
rm -rf dist/
rm -rf tests/e2e/videos/
rm -rf tests/e2e/screenshots/
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "kcert2-home-$target delpoy..."
echo -e "\\033]2;kcert2-home-$target delpoy\\007"
./run-build.sh
rm -rf deployment/html
cp -a ../apps/home-$target/dist deployment/html
docker rmi docker.kcert2018.com/kcert2/home-$target-ps:0.1
docker rmi kcert2/home-$target-ps:0.1
docker-compose build kcert2-home-$target-ps
docker tag kcert2/home-$target-ps:0.1 docker.kcert2018.com/kcert2/home-$target-ps:0.1
docker login -u rancher -p "ehsqjfwk9414$" docker.kcert2018.com
docker push docker.kcert2018.com/kcert2/home-$target-ps:0.1
docker logout docker.kcert2018.com
kubectl delete -f ../kube/deploy-all.yml
kubectl apply -f ../kube/deploy-all.yml
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target depoly\\007"
echo -e "kcert2-home-$target depoly\\007"
echo $target "delpoy..."
./run-build.sh
rm -rf deployment/html
cp -a ../apps/home-$target/dist deployment/html
docker rmi docker.nemopai.com/kcert2/home-$target-ps:0.1
docker rmi kcert2/home-$target-ps:0.1
docker-compose build kcert2-home-$target-ps
docker tag kcert2/home-$target-ps:0.1 docker.nemopai.com/kcert2/home-$target-ps:0.1
docker login -u falinux -p "2001May09" docker.nemopai.com
docker push docker.nemopai.com/kcert2/home-$target-ps:0.1
docker logout docker.nemopai.com
kubectl delete -k ../kustomize
kubectl apply -k ../kustomize
FROM nginx:1.15.3-alpine
MAINTAINER David You <frog@falinux.com>
ADD html /usr/share/nginx/html
RUN mkdir -p /usr/share/nginx/html/json/single/
RUN ln -s /usr/share/nginx/html/ /usr/share/nginx/html/json/single/json
FROM node:8.12.0
MAINTAINER David You <frog@falinux.com>
ENV DEBIAN_FRONTEND noninteractive
# USER root
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y locales
RUN dpkg-reconfigure locales
RUN locale-gen C.UTF-8
RUN /usr/sbin/update-locale LANG=C.UTF-8
# Install needed default locale for Makefly
RUN echo 'ko_KR.UTF-8 UTF-8' | tee --append /etc/locale.gen
RUN locale-gen
# Set default locale for the environment
ENV LC_ALL C.UTF-8
ENV LANG ko_KR.UTF-8
ENV LANGUAGE ko_KR.UTF-8
RUN apt-get update && apt-get install -y apt-utils
RUN apt-get update && \
apt-get install -y \
libgtk2.0-0 \
libnotify-dev \
libgconf-2-4 \
libnss3 \
libxss1 \
libasound2 \
xvfb
RUN apt-get update && apt-get install -y fonts-nanum
RUN echo "force new chrome here"
# install Chromebrowser
RUN \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install -y dbus-x11 google-chrome-stable && \
rm -rf /var/lib/apt/lists/*
# "fake" dbus address to prevent errors
# https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
# Add zip utility - it comes in very handy
RUN apt-get update && apt-get install -y zip
# RUN npm install -g npm@6.4.1
RUN yarn global add @vue/cli
# versions of local tools
RUN node -v
RUN npm -v
RUN yarn -v
RUN vue --version
RUN google-chrome --version
RUN zip --version
RUN git --version
# good colors for most applications
ENV TERM xterm
# avoid million NPM install messages
ENV npm_config_loglevel warn
# allow installing when the main user is root
ENV npm_config_unsafe_perm true
WORKDIR /apps
CMD bash
#
# 이 파일은 도커를 관리하는 파일입니다.
#
version: '2'
services:
base-home-main-ds:
image : base/home-main-ds:0.3
container_name : base-home-main-ds
volumes:
- ../../kcert2-home-wpo-admin/apps/home-wpo-admin/src/wpo:/apps/home-json-single-json/src/wpo
- ../../kcert2-home-f-component-v2/apps/home-f-component/src/fcomponents:/apps/home-json-single-json/src/fcomponents
- ../apps/:/apps
network_mode: "host"
privileged: true
environment:
CYPRESS_CACHE_FOLDER: /apps/.cypress-cache
command: bash
kcert2-home-json-single-json-ps:
build:
context : ./deployment
dockerfile : Dockerfile
image : kcert2/home-json-single-json-ps:0.1
environment:
NODE_ENV: production
base-vue-cli-3-ds :
build:
context : ./development
dockerfile : Dockerfile
image : base/home-main-ds:0.3
# end of file
#!/bin/bash
echo -e "home-json-single-json select"
echo "json-single-json" > .select-home-target
target=$(cat .select-home-target)
docker-compose run --name kcert2-home-$target-ds-init \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm install
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target bash\\007"
docker-compose run --name kcert2-home-$target-ds-bash \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/ \
base-home-main-ds \
bash
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "kcert2-home-$target build..."
echo -e "\\033]2;kcert2-home-$target build\\007"
rm -rf ../apps/home-$target/dist/
touch ../apps/home-$target/src/vue-apollo.js
docker-compose run --name kcert2-home-$target-build \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
-e NODE_ENV="production" \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm run build
#!/bin/bash
set -e
./run-lint.sh
./run-unit.sh
./run-e2e.sh
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target dev sever\\007"
echo -e "kcert2-home-$target dev sever"
touch ../apps/home-$target/src/vue-apollo.js
docker-compose run --name kcert2-home-$target-dev \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
-e AS_SERVICE=yes \
base-home-main-ds \
npm run serve
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target dev sever\\007"
echo -e "kcert2-home-$target dev sever"
touch ../apps/home-$target/src/vue-apollo.js
docker-compose run --name kcert2-home-$target-dev \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm run serve
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target e2e single\\007"
echo -e "kcert2-home-$target e2e single"
echo $1
if [ -z "$1" ]; then
echo -e "no target file"
docker-compose run --name kcert2-home-$target-e2e \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/tests/e2e/specs/ \
base-home-main-ds \
ls
exit 1
fi
docker-compose run --name kcert2-home-$target-e2e \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm run test:e2e --headless --spec /apps/home-$target/tests/e2e/specs/$1
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target e2e\\007"
echo -e "kcert2-home-$target e2e"
docker-compose run --name kcert2-home-$target-e2e \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm run test:e2e --headless
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target lint\\007"
echo -e "kcert2-home-$target lint\\007"
docker-compose run --name kcert2-home-$target-ds-lint \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm run lint
\ No newline at end of file
#!/bin/bash
if [ ! -f '.select-home-target' ]; then
echo -e "다음 중 원하는 타켓 설정 스크립트를 실행하세요"
echo -e ""
ls init-*
echo -e ""
exit 1
fi
target=$(cat .select-home-target)
echo -e "\\033]2;kcert2-home-$target unit\\007"
echo -e "kcert2-home-$target unit"
docker-compose run --name kcert2-home-$target-unit \
--rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
--workdir /apps/home-$target/ \
base-home-main-ds \
npm run test:unit
apiVersion: apps/v1
kind: Deployment
metadata:
name: home-json-single-json
namespace: default
spec:
replicas: 3
selector:
matchLabels:
workload.user.cattle.io/workloadselector: deployment-kcert2-home-json-single-json
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
workload.user.cattle.io/workloadselector: deployment-kcert2-home-json-single-json
spec:
containers:
- name: home-json-single-json
image: docker.nemopai.com/kcert2/home-json-single-json-ps:0.1
imagePullPolicy: Always
resources: {}
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: false
stdin: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
tty: true
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: nemopai-docker-registry
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: home-json-single-json
namespace: default
spec:
rules:
- host: www.nemopai.com
http:
paths:
- backend:
serviceName: home-json-single-json
servicePort: 80
path: /json/single/json/
tls:
- secretName: www-nemopai-com-tls
# kustomization.yaml
namespace: default
# namespace: mes
resources:
- deployment.yaml
- service.yaml
- ingress.yaml
apiVersion: v1
kind: Service
metadata:
name: home-json-single-json
namespace: default
spec:
type: ClusterIP
selector:
workload.user.cattle.io/workloadselector: deployment-kcert2-home-json-single-json
ports:
- port: 80
protocol: TCP
targetPort: 80
#!/bin/bash
echo "git update"
git pull origin master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment