# https://taskfile.dev #Called by the vnbuild system to produce builds for my website #https://www.vaughnnugent.com/resources/software version: "3" vars: BUILDS_URL: https://www.vaughnnugent.com/public/resources/software/builds includes: install: taskfile: install.taskfile.yaml plugins: taskfile: plugins.taskfile.yaml container: dir: container #always run from the container directory taskfile: container/Taskfile.yaml vars: BUILDS_URL: '{{.BUILDS_URL}}' PACKAGE_FILE_NAME: "sb-alpine3.19-oci.tgz" #the name of the output package file tasks: build: cmds: #clean out dist dir before building - cmd: powershell -Command "rm -Recurse -Force ./dist" ignore_error: true #copy setup script for linux - cmd: powershell -Command "mkdir lib -Force" ignore_error: true - cmd: wsl dos2unix ./setup.sh #convert the setup script to unix line endings for linux platform: [ win-x64 ] - powershell -Command "cp setup.sh lib/ -Force" - task: install-plugins - task: install-webserver #run container build last - task: container:build install-webserver: cmds: - for: [ win-x64, linux-x64, osx-x64 ] task: create-env vars: TARGET_OS: '{{.ITEM}}' postbuild_success: cmds: #make bin dir - cmd: powershell -Command "mkdir bin -Force" ignore_error: true - for: [ win-x64, linux-x64, osx-x64 ] task: pack vars: TARGET_OS: '{{.ITEM}}' #cleanup unnecessary build files that clog up the pipeline - for: [ build, plugins, dist, lib ] cmd: powershell -Command "rm -Recurse '{{.ITEM}}'" ignore_error: true - task: container:postbuild_success install-plugins: cmds: #add plugins - task: plugins:all build-container: cmds: - task: container:build create-env: vars: BUILD_DIR: './build/{{.TARGET_OS}}' cmds: #create dir for env - cmd: powershell -Command "mkdir {{.BUILD_DIR}} -Force" ignore_error: true #copy build files - for: [ plugins, dist, lib, config ] cmd: powershell -Command "cp -Recurse -Force {{.ITEM}} {{.BUILD_DIR}}" - task: get-webserver vars: TARGET_OS: '{{.TARGET_OS}}' BUILD_DIR: '{{.BUILD_DIR}}' get-webserver: internal: true cmds: - task: install:install vars: PROJECT_NAME: 'VNLib.Webserver' MODULE_NAME: "VNLib.Webserver" FILE_NAME: "{{.TARGET_OS}}-release.tgz" DIR: '{{.BUILD_DIR}}/webserver' - cmd: powershell -Command "cp -Force ./config/config.json {{.BUILD_DIR}}/config.json" pack: internal: true cmds: - cmd: powershell -Command "mkdir build/{{.TARGET_OS}}/ -Force" ignore_error: true - cd build/{{.TARGET_OS}} && tar -czf ../../bin/{{.TARGET_OS}}-release.tgz . clean: ignore_error: true cmds: - for: [ ./build, ./bin, ./dist, ./plugins, ./lib ] cmd: powershell -Command "rm -Recurse -Force '{{.ITEM}}'" - task: container:clean