Skip to content

Commit

Permalink
Change folder structure to accomodate separate binary for service
Browse files Browse the repository at this point in the history
Add launch and build task to debug service and app respectively
  • Loading branch information
phwissmann committed Aug 28, 2024
1 parent 8eac16d commit 372fc28
Show file tree
Hide file tree
Showing 31 changed files with 99 additions and 6 deletions.
16 changes: 13 additions & 3 deletions openem-ingestor/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
Expand Down
58 changes: 55 additions & 3 deletions openem-ingestor/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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"
]
},
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions openem-ingestor/desktop-app/openem-ingestor-config.yaml
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
18 changes: 18 additions & 0 deletions openem-ingestor/service/main.go
Original file line number Diff line number Diff line change
@@ -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())

}

0 comments on commit 372fc28

Please sign in to comment.