diff options
author | vnugent <public@vaughnnugent.com> | 2024-03-10 15:50:07 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-03-10 15:50:07 -0400 |
commit | 323ff67badfc46ad638d75f059d60d9425ccb2fa (patch) | |
tree | 6f4d824eaea0f4c433f98c0685bf66c06b30e16a /plugins/ObjectCacheServer/server/container/Taskfile.yaml | |
parent | 5d4192880654fd6e00e587814169415b42621327 (diff) |
ci(server): Conainerize and add vncache server packages
Diffstat (limited to 'plugins/ObjectCacheServer/server/container/Taskfile.yaml')
-rw-r--r-- | plugins/ObjectCacheServer/server/container/Taskfile.yaml | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/plugins/ObjectCacheServer/server/container/Taskfile.yaml b/plugins/ObjectCacheServer/server/container/Taskfile.yaml new file mode 100644 index 0000000..10ee86b --- /dev/null +++ b/plugins/ObjectCacheServer/server/container/Taskfile.yaml @@ -0,0 +1,80 @@ +# https://taskfile.dev + +#inlcuded by the ci main taskfile to produce containerized builds, and also +#be included by the container itself to run build tasks inside the container + +version: "3" + +vars: + INCLUDE_FILES: "Dockerfile, docker-compose.yaml" + +includes: + install: + taskfile: ../install.taskfile.yaml + optional: true #not needed for inside container build + +tasks: + #called from inside the container to build native libraries + build-libs: + vars: + OUT_DIR: "{{.USER_WORKING_DIR}}/out" + + #build stage generates the following libraries + generates: + - "{{.USER_WORKING_DIR}}/out/libvn_rpmalloc.so" + + cmds: + #build rpmalloc library + - cd lib/vnlib_rpmalloc/ && task && cp build/libvn_rpmalloc.so {{.OUT_DIR}}/libvn_rpmalloc.so + + #called from ci pipline to build the package + build: + cmds: + # clean up the run.sh script to remove windows line endings in my wsl default instance + - cmd: wsl dos2unix ./run.sh + platforms: [ windows/amd64 ] + + #init build image + - task: setup-container-image + + #remove the default config file as it's not needed in the container + - powershell -Command "rm -Force -Recurse build/app/config/" + + #install rpmalloc + - task: install-rpmalloc-lib + + postbuild_success: + cmds: + #tar up the build directory and move it to the output bin directory + - cmd: cd build/ && tar -czf '{{ .BINARY_DIR }}/{{.PACKAGE_FILE_NAME}}' . + #clean up all the build files after build succeeds + - task: clean + + clean: + ignore_error: true + cmds: + - cmd: powershell -Command "rm -Recurse -Force ./build" + + install-rpmalloc-lib: + internal: true + cmds: + #install compressor plugin + - task: install:install + vars: + PROJECT_NAME: 'vnlib_rpmalloc' + MODULE_NAME: "VNLib.Core" + FILE_NAME: "src.tgz" + DIR: './build/app/lib/vnlib_rpmalloc' + + setup-container-image: + internal: true + cmds: + #make build directory + - powershell -Command "mkdir build, build/app, build/app/config-templates/, build/app/static/ -Force" + #copy the existing linux-x64 build to the build folder, this will be the container base + - powershell -Command "cp -Recurse -Force ../build/linux-x64/* build/app/" + #copy local scripts and config data into the build folder + - powershell -Command "cp -Force run.sh, Taskfile.yaml build/app/" + - powershell -Command "cp -Force Dockerfile, docker-compose.yaml build/" + - powershell -Command "cp -Force static/* build/app/static/" + - powershell -Command "cp -Force config-templates/* build/app/config-templates/" |