diff --git a/docker/scripts/export_builds.sh b/docker/scripts/export_builds.sh new file mode 100644 index 0000000..d9c84ee --- /dev/null +++ b/docker/scripts/export_builds.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Create the exported directory +mkdir -p build + +# Locate services/packages and grab only the built files + package.json +for file in $(find . -regex '.\/\(services\|packages\)\/.*\/\(dist\|lib\)'); do + cp --parents -R $file build; +done diff --git a/docker/scripts/export_deps.sh b/docker/scripts/export_deps.sh new file mode 100644 index 0000000..4045daf --- /dev/null +++ b/docker/scripts/export_deps.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Create the exported directory +mkdir -p build + +# Locate services/packages and grab only the built files + package.json +for file in $(find . -regex '.\/\(services\|packages\)\/.*\/\(package.json\|node_modules\)'); do + cp --parents -R $file build; +done diff --git a/package.json b/package.json index 8884f7b..9f2b95a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,14 @@ "repository": "ssh://git@git.dlii.tech:222/Autoplex/autoplex.git", "author": "David Ludwig ", "license": "MIT", + "scripts": { + "build": "lerna run build", + "build:packages": "lerna run build --scope=@ldt/package-*", + "build:services": "lerna run build --scope=@ldt/service-*", + "export": "rimraf ./build && yarn run export:deps && yarn run export:builds", + "export:deps": "/bin/sh ./docker/scripts/export_deps.sh", + "export:builds": "/bin/sh ./docker/scripts/export_builds.sh" + }, "devDependencies": { "@types/chai": "^4.3.0", "@types/mocha": "^9.1.0",