Skip to content

Commit

Permalink
KU Leuven custom executable build
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Apr 17, 2023
1 parent 23a1044 commit e1a522a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ multiplatform_demo: fmt frontend ## build executable for multiple platforms

fix_optimization_error: ## angular needs newer version of terser to optimize typescript 4.4 or later (static initiallization blocks)
rm -rf ../rdm-integration-frontend/node_modules/@angular-devkit/build-angular/node_modules/terser
cp -r ../rdm-integration-frontend/node_modules/terser ../rdm-integration-frontend/node_modules/@angular-devkit/build-angular/node_modules/terser
cp -r ../rdm-integration-frontend/node_modules/terser ../rdm-integration-frontend/node_modules/@angular-devkit/build-angular/node_modules/terser

multiplatform_kul: fmt frontend ## build KUL executable for multiple platforms
cp -r conf/kul_customizations/* image/app/frontend/dist/datasync/
cd image && env GOOS=windows GOARCH=amd64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_windows.exe ./app/local/
cd image && env GOOS=linux GOARCH=amd64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_linux.bin ./app/local/
cd image && env GOOS=darwin GOARCH=amd64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_darwin_amd64.bin ./app/local/
cd image && env GOOS=darwin GOARCH=arm64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_darwin_arm64.bin ./app/local/
18 changes: 18 additions & 0 deletions conf/kul_customizations/assets/html/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Author: Eryk Kulikowski @ KU Leuven (2023). Apache 2.0 License -->
<div class="dataverse-header-block">
<div class="container">
<div class="dataverse-navbar-logo">
<a href="https://rdr.kuleuven.be" class="dataverse-navbar-logo-ref"><img src="assets/img/logo_kuleuven_RDR.png"/></a>
</div>
<div class="dataverse-navbar-collapse">
<ul>
<li class="dataverse-navbar-right-li">
<a href="connect" class="dataverse-navbar-right-ref">Home</a>
</li>
<li class="dataverse-navbar-right-li">
<a href="quit" class="dataverse-navbar-right-ref">Quit</a>
</li>
</ul>
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions image/app/frontend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"integration/app/logging"
"net/http"
"os"
"strings"
)

//go:embed default_frontend_config.json
Expand Down Expand Up @@ -40,6 +41,9 @@ func GetConfig(w http.ResponseWriter, r *http.Request) {
if Config.ExternalURL == "" {
Config.ExternalURL = config.GetExternalDestinationURL()
logging.Logger.Println(Config.ExternalURL)
if strings.Contains(Config.ExternalURL, "kuleuven") {
Config.CollectionOptionsHidden = true
}
}
b, err := json.Marshal(Config)
if err != nil {
Expand Down

0 comments on commit e1a522a

Please sign in to comment.