Skip to content

Commit

Permalink
fix: fixed Runner builds where the binary missed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kasp1 committed Oct 13, 2022
1 parent 27a59d3 commit ef25efd
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 14 deletions.
1 change: 1 addition & 0 deletions CI/archive-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ for (let name of fs.readdirSync('dist')) {
}

archive.directory('dist/webui/', 'webui')
archive.directory('dist/data/', 'data')

archive.finalize()
14 changes: 8 additions & 6 deletions CI/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ steps:
- displayName: Install Dependencies
command: npm i

#
# Build
#
# - displayName: Semantic Release
# command: npx semantic-release --no-ci --debug

- displayName: Install Runner Dependencies
command: cd "runner" && npm i

- displayName: Build Runner
command: cd "runner" && pkg main.js -o ../dist/dozer-win -t latest-win
command: ncc build runner/main.js -o dist &&
pkg dist/index.js -o dist/dozer-win -t latest-win

- displayName: Install WebUI Dependencies
command: cd "webui" && npm i
Expand All @@ -27,9 +25,13 @@ steps:
- displayName: Build NativeUI
command: cd "nativeui" && flutter build windows

- displayName: Copy Windows Build
- displayName: Assemble Windows Build
command: copy nativeui\build\windows\runner\Release\dozerui.exe dist\dozerui-win.exe &&
copy nativeui\build\windows\runner\Release\*.dll dist\
copy nativeui\build\windows\runner\Release\*.dll dist\ &&
copy "%DOZER_VS_DLLS%\vcruntime140.dll" dist\ &&
copy "%DOZER_VS_DLLS%\vcruntime140_1.dll" dist\ &&
copy "%DOZER_VS_DLLS%\msvcp140.dll" dist\ &&
xcopy nativeui\build\windows\runner\Release\data dist\data\ /E/H

- displayName: Package Windows Build
command: node CI/archive-windows.js
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ Useful if:
- Your environment is already set up and you want to save time installing all tools on each CI/CD run.
- You want to develop and test your CI/CD steps on your localhost before uploading the scripts to a cloud CI/CD.

The GUI is optional. Dozer can be also run on servers.
The GUI is optional. Dozer can also just run as a CLI command.

![](resources/screenshots/3.png)

## Sponsored By

[![](resources/sponsors/rtd.jpg)](https://store.steampowered.com/app/1496770/RTD__Road_to_Desolace/)

[![](resources/sponsors/nextkind.png)](https://nextkind.org)

# Quick Start

## Install

0. If you have Dozer 3 or earlier installed, uninstall it first (find Dozer in the *Apps & Features* settings dialog, click it and select Uninstall).
1. Download a release archive for your platform from the [Releases page](https://github.com/kasp1/Dozer/releases) and unzip it to a safe folder.
2. Add that folder to your PATH.
2. Add that folder to your PATH. Then make sure to open a fresh terminal before using Dozer.
- [How to add to PATH on Windows](https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14))
- [How to add to PATH on Linux](https://linuxize.com/post/how-to-add-directory-to-path-in-linux/)
- [How to add to PATH on MacOS](https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/)
Expand Down Expand Up @@ -209,13 +215,19 @@ Before using the `--webui` argument, you need to make sure the *Web UI* is built

Before using `--gui`, you need to make sure the `dozerui` command exists on your system. If the command is not present in your system `PATH` environment variable, you can specify a direct path to the *Native UI* binary as `--gui path/to/binary`. The same way you can also guide the *Dozer Runner* to start any other command present on your system, e.g. `--gui customui`.

### Build

Install `pkg` and `ncc`, the commands which compile the *Runner* into binaries... `npm i -g pkg @vercel/ncc`.

In the project root folder, execute `ncc build runner/main.js -o dist && pkg dist/index.js -o dist/dozer-win -t latest-win`. The built binary should appear as `../dist/dozer-win.exe`.

## Dozer WebUI

### Setup

0. Make sure you have [Node.js](https://nodejs.org) and [Vue CLI](https://cli.vuejs.org/) installed.
1. Clone the repository.
2. In a terminal, change to the `webui` directory.
2. In a terminal, change to the `webui` directory.
3. Run `npm i` to install dependencies.

### Develop
Expand All @@ -226,6 +238,34 @@ The source code of the *WebUI* is in the `webui` folder. Each time you want to t

In the `webui` folder, execute `node run serve`. The built files should appear under `../dist/webui`.

## Dozer NativeUI

### Setup

0. Make sure you have [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/) and [Flutter SDK](https://docs.flutter.dev/get-started/install) installed.
1. Clone the repository.
2. In a terminal, change to the `nativeui` directory.
3. Run `flutter pub get` to install dependencies.

### Develop

The source code of the *NativeUI* is in the `nativeui` folder. Each time you want to test, execute `flutter run windows`, which will start the UI app in a hot-reload mode.

### Build

In the `nativeui` folder, execute `flutter build windows`. The built files should appear under `nativeui/build/windows/runner/Release`.

## Packaging for Distribution

Before packaging for distribution, the development and build requirements for each *Runner*, *WebUI*, and *NativeUI* have to be met first.

### Windows

The `DOZER_VC_DLLS` environment variable needs to be set to the path where `msvcp140.dll`, `vcruntime140.dll`, `vcruntime140_1.dll` are located, e.g. `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.32.31326\x64\Microsoft.VC143.CRT`.

Run `build-dist-win.bat`. When finished, the Dozer distributable should be present as `dist/Windows64.zip`.


## Websockets API

Unless the `--no-api` command line argument is specified on the *Dozer Runner*, it will open the Websockets API for any custom UI or scripts to connect and get information about the pipeline's progress.
Expand Down
5 changes: 0 additions & 5 deletions nativeui/README.md

This file was deleted.

Binary file added resources/sponsors/nextkind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/sponsors/rtd.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef25efd

Please sign in to comment.