Merge branch 'choco-ci-fix' into 'master'

Choco ci fix

See merge request openflexure/openflexure-microscope-jsclient!24
This commit is contained in:
Joel Collins 2019-05-20 14:02:08 +00:00
commit 8d12a9b98c
5 changed files with 55 additions and 102 deletions

View file

@ -1,7 +1,6 @@
extends: app/builder-config-base.yaml
win:
target:
- NSIS
- appx
icon: app/icons/win/icon.ico
appx:

View file

@ -1,66 +0,0 @@
$silentArgs = '/S'
$packageName = 'openflexure-ev'
$fileType = 'exe'
$packagepath = Join-Path -Path $PSScriptRoot -ChildPath '..\'
$packageJson = Join-Path -Path $packagepath -ChildPath '\package.json'
$outpath = Join-Path -Path $packagepath -ChildPath 'release-builds\choco'
echo $packagepath
echo $outpath
If(!(test-path $outpath))
{
New-Item -ItemType Directory -Force -Path $outpath
}
# Get version from package.json
$FullVersion = (Get-Content $packageJson) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
$MajVer, $MinVer = $FullVersion.Split("-") # Split version number from beta string
$MinVer = $MinVer.Replace(".", "") # Convert symver into nuspec ver
$version = $MajVer + "-" + $MinVer
$InstURL = "$Env:CI_JOB_URL/artifacts/browse/release-builds/openflexure-ev-win.exe"
echo $InstURL
$NuSpec = @"
<?xml version="1.0"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>$packageName</id>
<title>OpenFlexure eV</title>
<version>$Version</version>
<authors>OpenFlexure</authors>
<owners>Bath Open Instrumentation Group</owners>
<summary>OpenFlexure Microscope client</summary>
<description>An electron-based user client for the OpenFlexure Microscope Server</description>
<projectUrl>https://www.openflexure.org/</projectUrl>
<docsUrl>https://www.openflexure.org/projects/microscope/</docsUrl>
<bugTrackerUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/issues</bugTrackerUrl>
<projectSourceUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/</projectSourceUrl>
<packageSourceUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/</packageSourceUrl>
<tags>openflexure microscope ev</tags>
<licenseUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/raw/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/raw/master/app/icons/png/512x512.png</iconUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
"@
echo $NuSpec | Out-File -force -FilePath "$outpath\openflexure-ev.nuspec"
$InstPS1 = "Install-ChocolateyPackage '$packageName' '$fileType' '$silentArgs' '$InstURL'"
$toolspath = "$outpath\tools"
If(!(test-path $toolspath))
{
New-Item -ItemType Directory -Force -Path $toolspath
}
echo $InstPS1 | Out-File -force -FilePath "$toolspath\chocolateyInstall.ps1"
choco pack --outputdirectory $outpath "$outpath\openflexure-ev.nuspec"

View file

@ -1,27 +1,30 @@
silentArgs='/S'
packageName='openflexure-ev'
fileType='exe'
#!/bin/bash
scriptPath=`dirname $0`
packageName='openflexure-ev'
scriptPath=$(dirname "$0")
packagePath="$(dirname "$scriptPath")"
packageJson="$packagePath/package.json"
installerPath="$packagePath/openflexure-ev-win.exe"
installerHash=`sha256sum ${installerPath} | awk '{ print $1 }'`
echo "$installerHash"
outpath="$packagePath/release-builds/choco"
toolspath="$outpath/tools"
mkdir -p $toolspath
mkdir -p "$toolspath"
echo $scriptPath
echo $packageJson
echo $outpath
echo "$scriptPath"
echo "$packageJson"
echo "$outpath"
# Get package version from package.json
packageVersion=$(cat $packageJson \
| grep version \
| head -1 \
packageVersion=$(grep version < "$packageJson" | head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
| tr -d ':space:')
echo "$packageVersion"
echo "Package version: $packageVersion"
# Convert into a nupkg-safe version string
majVer="$(echo "$packageVersion" | cut -d'-' -f1)"
@ -34,12 +37,14 @@ else
version="$majVer-$minVer"
fi
echo "$version"
echo "Nupkg version: $version"
# Build installer URL
instURL="$CI_JOB_URL/artifacts/raw/release-builds/openflexure-ev-win.exe"
echo $instURL
pipelineURL="$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_REF_NAME/raw"
instURL="$pipelineURL/openflexure-ev-win.exe?job=package:win32"
nuspecURL="$CI_JOB_URL/artifacts/browse"
echo "$instURL"
# Build nuspec
cat > "$outpath/openflexure-ev.nuspec" <<- EOL
@ -50,20 +55,21 @@ cat > "$outpath/openflexure-ev.nuspec" <<- EOL
<title>OpenFlexure eV</title>
<version>$version</version>
<authors>OpenFlexure</authors>
<owners>Bath Open Instrumentation Group</owners>
<owners>Joel Collins</owners>
<summary>OpenFlexure Microscope client</summary>
<description>An electron-based user client for the OpenFlexure Microscope Server</description>
<projectUrl>https://www.openflexure.org/</projectUrl>
<docsUrl>https://www.openflexure.org/projects/microscope/</docsUrl>
<bugTrackerUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/issues</bugTrackerUrl>
<projectSourceUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/</projectSourceUrl>
<packageSourceUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/</packageSourceUrl>
<packageSourceUrl>$nuspecURL</packageSourceUrl>
<tags>openflexure microscope ev</tags>
<licenseUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/raw/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://gitlab.com/openflexure/openflexure-microscope-jsclient/raw/master/app/icons/png/512x512.png</iconUrl>
<iconUrl>https://build.openflexure.org/openflexure_ev/512x512.png</iconUrl>
</metadata>
<files>
<file src="tools/**" target="tools" />
@ -72,8 +78,26 @@ cat > "$outpath/openflexure-ev.nuspec" <<- EOL
EOL
# Build installer PS1 content
instPS1="Install-ChocolateyPackage $packageName $fileType $silentArgs $instURL"
echo $instPS1 > "$toolspath/chocolateyInstall.ps1"
cat > "$toolspath/chocolateyInstall.ps1" <<- EOL
\$ErrorActionPreference = "Stop";
\$toolsDir = "\$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
\$url = "$instURL"
# Build nupkg
# choco pack --allow-unofficial --outputdirectory $outpath "$outpath/openflexure-ev.nuspec"
\$packageArgs = @{
packageName = "openflexure-ev"
unzipLocation = \$toolsDir
fileType = "exe"
url = \$url
url64bit = \$url
softwareName = "OpenFlexure eV"
checksum = "${installerHash}"
checksumType = "sha256"
silentArgs = "/S"
}
Install-ChocolateyPackage @packageArgs
EOL

13
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "openflexure-ev",
"version": "0.2.3",
"version": "0.2.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -9332,11 +9332,6 @@
"unicode-match-property-value-ecmascript": "^1.1.0"
}
},
"register-service-worker": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/register-service-worker/-/register-service-worker-1.6.2.tgz",
"integrity": "sha512-I8L87fX2TK29LDx+wgyOUh2BJ3rDIRC1FtRZEHeP3rivzDv6p1DDZLGGtPucqjEkm45+2crtFIFssEWv56+9Wg=="
},
"registry-auth-token": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz",
@ -10993,9 +10988,9 @@
}
},
"uikit": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/uikit/-/uikit-3.1.4.tgz",
"integrity": "sha512-XGtlKlQXeNoQJi9wyff6DCkeX0P5/wdZw7LOenH7a5AOTRfUZDhTGX9uSCvRBroYBIKj6Eq2fe2efw2d1/rdHg==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/uikit/-/uikit-3.1.1.tgz",
"integrity": "sha512-swmRPHiu1ehqtH8l1SSmbTk5LRx0JiaIwJlhjZfH2stQDZ6WUzC8zN6Jo9muEkptM1N+Vm5Qxa1DTeg+nkMCTQ==",
"dev": true
},
"unicode-canonical-property-names-ecmascript": {

View file

@ -147,7 +147,7 @@ export default {
var keyCodeList = Object.keys(keyCodes).map(function(key){return keyCodes[key];});
if (!(event.target instanceof HTMLInputElement) && !(event.target.classList.contains('lightbox-link')) && keyCodeList.includes(event.keyCode)) {
console.log(this.keysDown)
//console.log(this.keysDown)
// Calculate movement array
var x_rel = 0;
var y_rel = 0;
@ -190,6 +190,7 @@ export default {
},
moveRequest: function(x, y, z, absolute) {
console.log(`Sending move request of ${x}, ${y}, ${z}`)
// If not movement-locked
if (!this.moveLock) {
// Lock move requests