diff --git a/openem-ingestor/.vscode/launch.json b/openem-ingestor/.vscode/launch.json index df49c1e..11639dd 100644 --- a/openem-ingestor/.vscode/launch.json +++ b/openem-ingestor/.vscode/launch.json @@ -2,12 +2,22 @@ "version": "0.2.0", "configurations": [ { - "name": "Wails: Debug openem-ingestor", + "name": "Wails: Debug Desktop App", "type": "go", "request": "launch", "mode": "exec", - "program": "${workspaceFolder}/build/bin/openem-ingestor", - "preLaunchTask": "build", + "program": "${workspaceFolder}/desktop-app/build/bin/openem-ingestor", + "preLaunchTask": "build app", + "cwd": "${workspaceFolder}", + "env": {} + }, + { + "name": "Wails: Debug Service", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/service/build/bin/openem-ingestor", + "preLaunchTask": "build service", "cwd": "${workspaceFolder}", "env": {} } diff --git a/openem-ingestor/.vscode/tasks.json b/openem-ingestor/.vscode/tasks.json index 2b0d0ee..187a71d 100644 --- a/openem-ingestor/.vscode/tasks.json +++ b/openem-ingestor/.vscode/tasks.json @@ -2,10 +2,40 @@ "version": "2.0.0", "tasks": [ { - "label": "build", + "label": "copy app config", + "type": "shell", + "command": "cp", + "args": [ + "${workspaceFolder}/core/openem-ingestor-config.yaml", + "${workspaceFolder}/desktop-app/build/bin/" + ] + }, + { + "label": "copy service config", + "type": "shell", + "command": "cp", + "args": [ + "${workspaceFolder}/core/openem-ingestor-config.yaml", + "${workspaceFolder}/service/build/bin/" + ] + }, + { + "label": "build desktop app", "type": "shell", "options": { - "cwd": "${workspaceFolder}" + "cwd": "${workspaceFolder}/desktop-app/" + }, + "command": "wails", + "args": [ + "build", + "-debug" + ] + }, + { + "label": "build service app", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}/service/" }, "command": "go", "args": [ @@ -17,6 +47,28 @@ "-o", "build/bin/openem-ingestor" ] - } + }, + { + "label": "build app", + "group": { + "kind": "build", + "isDefault": true + }, + "dependsOn": [ + "build desktop app", + "copy app config" + ] + }, + { + "label": "build service", + "group": { + "kind": "build", + "isDefault": false + }, + "dependsOn": [ + "build service app", + "copy service config" + ] + }, ] } \ No newline at end of file diff --git a/openem-ingestor/app.go b/openem-ingestor/desktop-app/app.go similarity index 100% rename from openem-ingestor/app.go rename to openem-ingestor/desktop-app/app.go diff --git a/openem-ingestor/frontend/.vscode/extensions.json b/openem-ingestor/desktop-app/frontend/.vscode/extensions.json similarity index 100% rename from openem-ingestor/frontend/.vscode/extensions.json rename to openem-ingestor/desktop-app/frontend/.vscode/extensions.json diff --git a/openem-ingestor/frontend/README.md b/openem-ingestor/desktop-app/frontend/README.md similarity index 100% rename from openem-ingestor/frontend/README.md rename to openem-ingestor/desktop-app/frontend/README.md diff --git a/openem-ingestor/frontend/index.html b/openem-ingestor/desktop-app/frontend/index.html similarity index 100% rename from openem-ingestor/frontend/index.html rename to openem-ingestor/desktop-app/frontend/index.html diff --git a/openem-ingestor/frontend/package-lock.json b/openem-ingestor/desktop-app/frontend/package-lock.json similarity index 100% rename from openem-ingestor/frontend/package-lock.json rename to openem-ingestor/desktop-app/frontend/package-lock.json diff --git a/openem-ingestor/frontend/package.json b/openem-ingestor/desktop-app/frontend/package.json similarity index 100% rename from openem-ingestor/frontend/package.json rename to openem-ingestor/desktop-app/frontend/package.json diff --git a/openem-ingestor/frontend/package.json.md5 b/openem-ingestor/desktop-app/frontend/package.json.md5 similarity index 100% rename from openem-ingestor/frontend/package.json.md5 rename to openem-ingestor/desktop-app/frontend/package.json.md5 diff --git a/openem-ingestor/frontend/src/App.svelte b/openem-ingestor/desktop-app/frontend/src/App.svelte similarity index 100% rename from openem-ingestor/frontend/src/App.svelte rename to openem-ingestor/desktop-app/frontend/src/App.svelte diff --git a/openem-ingestor/frontend/src/List.svelte b/openem-ingestor/desktop-app/frontend/src/List.svelte similarity index 100% rename from openem-ingestor/frontend/src/List.svelte rename to openem-ingestor/desktop-app/frontend/src/List.svelte diff --git a/openem-ingestor/frontend/src/ListElement.svelte b/openem-ingestor/desktop-app/frontend/src/ListElement.svelte similarity index 100% rename from openem-ingestor/frontend/src/ListElement.svelte rename to openem-ingestor/desktop-app/frontend/src/ListElement.svelte diff --git a/openem-ingestor/frontend/src/assets/fonts/OFL.txt b/openem-ingestor/desktop-app/frontend/src/assets/fonts/OFL.txt similarity index 100% rename from openem-ingestor/frontend/src/assets/fonts/OFL.txt rename to openem-ingestor/desktop-app/frontend/src/assets/fonts/OFL.txt diff --git a/openem-ingestor/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2 b/openem-ingestor/desktop-app/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2 similarity index 100% rename from openem-ingestor/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2 rename to openem-ingestor/desktop-app/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2 diff --git a/openem-ingestor/frontend/src/assets/images/logo-wide-1024x317.png b/openem-ingestor/desktop-app/frontend/src/assets/images/logo-wide-1024x317.png similarity index 100% rename from openem-ingestor/frontend/src/assets/images/logo-wide-1024x317.png rename to openem-ingestor/desktop-app/frontend/src/assets/images/logo-wide-1024x317.png diff --git a/openem-ingestor/frontend/src/main.ts b/openem-ingestor/desktop-app/frontend/src/main.ts similarity index 100% rename from openem-ingestor/frontend/src/main.ts rename to openem-ingestor/desktop-app/frontend/src/main.ts diff --git a/openem-ingestor/frontend/src/style.css b/openem-ingestor/desktop-app/frontend/src/style.css similarity index 100% rename from openem-ingestor/frontend/src/style.css rename to openem-ingestor/desktop-app/frontend/src/style.css diff --git a/openem-ingestor/frontend/src/vite-env.d.ts b/openem-ingestor/desktop-app/frontend/src/vite-env.d.ts similarity index 100% rename from openem-ingestor/frontend/src/vite-env.d.ts rename to openem-ingestor/desktop-app/frontend/src/vite-env.d.ts diff --git a/openem-ingestor/frontend/svelte.config.js b/openem-ingestor/desktop-app/frontend/svelte.config.js similarity index 100% rename from openem-ingestor/frontend/svelte.config.js rename to openem-ingestor/desktop-app/frontend/svelte.config.js diff --git a/openem-ingestor/frontend/tsconfig.json b/openem-ingestor/desktop-app/frontend/tsconfig.json similarity index 100% rename from openem-ingestor/frontend/tsconfig.json rename to openem-ingestor/desktop-app/frontend/tsconfig.json diff --git a/openem-ingestor/frontend/tsconfig.node.json b/openem-ingestor/desktop-app/frontend/tsconfig.node.json similarity index 100% rename from openem-ingestor/frontend/tsconfig.node.json rename to openem-ingestor/desktop-app/frontend/tsconfig.node.json diff --git a/openem-ingestor/frontend/vite.config.ts b/openem-ingestor/desktop-app/frontend/vite.config.ts similarity index 100% rename from openem-ingestor/frontend/vite.config.ts rename to openem-ingestor/desktop-app/frontend/vite.config.ts diff --git a/openem-ingestor/frontend/wailsjs/go/main/App.d.ts b/openem-ingestor/desktop-app/frontend/wailsjs/go/main/App.d.ts similarity index 100% rename from openem-ingestor/frontend/wailsjs/go/main/App.d.ts rename to openem-ingestor/desktop-app/frontend/wailsjs/go/main/App.d.ts diff --git a/openem-ingestor/frontend/wailsjs/go/main/App.js b/openem-ingestor/desktop-app/frontend/wailsjs/go/main/App.js similarity index 100% rename from openem-ingestor/frontend/wailsjs/go/main/App.js rename to openem-ingestor/desktop-app/frontend/wailsjs/go/main/App.js diff --git a/openem-ingestor/frontend/wailsjs/runtime/package.json b/openem-ingestor/desktop-app/frontend/wailsjs/runtime/package.json similarity index 100% rename from openem-ingestor/frontend/wailsjs/runtime/package.json rename to openem-ingestor/desktop-app/frontend/wailsjs/runtime/package.json diff --git a/openem-ingestor/frontend/wailsjs/runtime/runtime.d.ts b/openem-ingestor/desktop-app/frontend/wailsjs/runtime/runtime.d.ts similarity index 100% rename from openem-ingestor/frontend/wailsjs/runtime/runtime.d.ts rename to openem-ingestor/desktop-app/frontend/wailsjs/runtime/runtime.d.ts diff --git a/openem-ingestor/frontend/wailsjs/runtime/runtime.js b/openem-ingestor/desktop-app/frontend/wailsjs/runtime/runtime.js similarity index 100% rename from openem-ingestor/frontend/wailsjs/runtime/runtime.js rename to openem-ingestor/desktop-app/frontend/wailsjs/runtime/runtime.js diff --git a/openem-ingestor/main.go b/openem-ingestor/desktop-app/main.go similarity index 100% rename from openem-ingestor/main.go rename to openem-ingestor/desktop-app/main.go diff --git a/openem-ingestor/desktop-app/openem-ingestor-config.yaml b/openem-ingestor/desktop-app/openem-ingestor-config.yaml new file mode 100644 index 0000000..38c6f8a --- /dev/null +++ b/openem-ingestor/desktop-app/openem-ingestor-config.yaml @@ -0,0 +1,13 @@ +Scicat: + Host: http://openem-scopem.ethz.ch:89/api/v3 + AccessToken: "asdf" +Transfer: + Method: S3 + S3: + Endpoint: scopem-openem.ethz.ch:9000 + Bucket: landingzone + Checksum: true + Globus: + Endpoint: globus.psi.ch +Misc: + ConcurrencyLimit: 2 \ No newline at end of file diff --git a/openem-ingestor/wails.json b/openem-ingestor/desktop-app/wails.json similarity index 100% rename from openem-ingestor/wails.json rename to openem-ingestor/desktop-app/wails.json diff --git a/openem-ingestor/service/main.go b/openem-ingestor/service/main.go new file mode 100644 index 0000000..f5e09b9 --- /dev/null +++ b/openem-ingestor/service/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "log" + "openem-ingestor/core" + + "github.com/spf13/viper" +) + +func main() { + if err := core.ReadConfig(); err != nil { + panic(fmt.Errorf("Failed to read config file: %w", err)) + } + log.Printf("Config file used: %s", viper.ConfigFileUsed()) + log.Println(viper.AllSettings()) + +}