Skip to content

Commit

Permalink
feature(scripts): add run scripts for windows and linux
Browse files Browse the repository at this point in the history
Add scripts run-windows.cmd and run-linux to repository. The scripts execute cse-server-go and opens the default browser
on localhost:8000.
Update Jenkinsfile to copy these scripts into the distribution folder.
Fix Linux library linking by creating a script to update the rpath of all files in /lib during Jenkins build process.

Closes #64

set-rpath script
  • Loading branch information
Flakstad authored and Flakstad committed Mar 12, 2019
1 parent 1582c23 commit 50f009d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pipeline {
CONAN_USER_HOME_SHORT = "${env.CONAN_USER_HOME}"
OSP_CONAN_CREDS = credentials('jenkins-osp-conan-creds')
}

tools {
go 'go-1.11.5'
//'com.cloudbees.jenkins.plugins.customtools.CustomTool' 'mingw-w64' awaiting fix in customToolsPlugin
Expand All @@ -35,7 +35,7 @@ pipeline {
projectName: 'open-simulation-platform/cse-client/master',
filter: 'resources/public/**/*',
target: 'src/cse-server-go')

dir ('src/cse-server-go') {
sh 'conan remote add osp https://osp-conan.azurewebsites.net/artifactory/api/conan/conan-local --force'
sh 'conan user -p $OSP_CONAN_CREDS_PSW -r osp $OSP_CONAN_CREDS_USR'
Expand All @@ -57,6 +57,9 @@ pipeline {
dir ('src/cse-server-go/dist/bin') {
sh 'cp -rf ../../cse-server-go.exe .'
}
dir ('src/cse-server-go/dist') {
sh 'cp -rf ../run-windows.cmd .'
}
}
}
stage ('Zip dist') {
Expand Down Expand Up @@ -120,12 +123,11 @@ pipeline {
projectName: 'open-simulation-platform/cse-client/master',
filter: 'resources/public/**/*',
target: 'src/cse-server-go')

dir ('src/cse-server-go') {
sh 'conan remote add osp https://osp-conan.azurewebsites.net/artifactory/api/conan/conan-local --force'
sh 'conan user -p $OSP_CONAN_CREDS_PSW -r osp $OSP_CONAN_CREDS_USR'
sh 'conan install . -s build_type=Release -s compiler.libcxx=libstdc++11 -u'
sh 'patchelf --set-rpath \'$ORIGIN/../lib\' dist/lib/*'
}
}
}
Expand All @@ -142,6 +144,13 @@ pipeline {
dir ('src/cse-server-go/dist/bin') {
sh 'cp -rf ../../cse-server-go .'
}
dir ('src/cse-server-go/dist') {
sh 'cp ../run-linux .'
}
dir ('src/cse-server-go') {
sh 'chmod 755 set-rpath'
sh './set-rpath dist/lib'
}
}
}
stage ('Zip dist') {
Expand Down
3 changes: 3 additions & 0 deletions run-linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
xdg-open http://localhost:8000
./bin/cse-server-go
3 changes: 3 additions & 0 deletions run-windows.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
start http://localhost:8000
start .\bin\cse-server-go.exe
5 changes: 5 additions & 0 deletions set-rpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
for file in $(pwd)/$1/*
do
patchelf --set-rpath '$ORIGIN' $file
done

0 comments on commit 50f009d

Please sign in to comment.