diff --git a/BUILD.md b/BUILD.md index ca914db4c..82b14e504 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,10 +1,10 @@ ## Building From Source -If you have special requirements that you need to add to OSPOS then you can download the raw code from the github repository to make your changes. If it's a really cool change that might benefit others then we ask that you consider contributing it to the project. +If you have special requirements that you need to add to OSPOS, you can download the raw code from the github repository and make your changes. If it's a really cool change that might benefit others, we ask that you consider contributing it to the project. -After you've made your changes you will need to do a "BUILD" on it to add all necessary components that OSPOS needs so that it can actually run. +After you've made your changes you will need to do a "BUILD" on it to add all necessary components that OSPOS needs to actually run. -This documents the "How to Build" processes. +This documents the "How to Build" process. The goal here was to do a lot of work in setting up and configuring the build process so that the actual build is as simple as possible. I think we've accomplished that task. @@ -17,31 +17,34 @@ This applies only to the upcoming 3.4.0 release of OSPOS which is being worked o ## The Workflow -1. Download the code from the CI4 branch. (If you are reading this then you probably have already done this and the following step.) -2. Unzip it into a working folder. -3. Start a terminal session frm the root of the working folder. +1. Download the code from the CI4 branch found at https://github.com/opensourcepos/opensourcepos/tree/ci4-upgrade. +2. Unzip it and copy the contents into your working folder. +3. Start a terminal session from the root of your working folder. For example, I normally open up the working folder in PHPStorm and run the commands from the Terminal provided by the IDE. 4. Enter the following commands: - - npm install - - npm run build + - `npm install` + - `npm run build` -That's all there is to it. +That's all there is to it. The build task threads a lot of smaller grunt tasks together and will run them sequentially. If you want to run each step manually then you will need to pay attention to the bouncing between folders that takes place in order to run the correct version of Grunt. -If you have the database set up and a preconfigured copy of .env just drop then .env file into the root folder then you should be ready to go. +If you have the database set up and a preconfigured copy of .env, just drop the .env file into the root of the working folder. You should be ready to go. -If not then you will need to continue from this point forward with the standard installation instructions, but at this point you have running version of OSPOS. +If not, then you will need to continue from this point forward with the standard installation instructions, but at this point you have runnable version of OSPOS. -The .env file should be used to contain your configuration. +### Windows Platform + +The .env file is a convenience method for setting your configuration. If you are running on a Windows based work station (which is what I use) I've added a couple of Powershell scripts to make my life a bit easier, which I share with you. -* build.ps1 - Which runs the build but also rstores the .env from a backup I make of it in a specifically placed folder. -* build-steps.ps1 - This runs through each step of the build and pauses just before it executes the next build step so that the developer can check the results of the previous build step. +* `build.ps1` - Which runs the build but also restores the .env from a backup I make of it in a specifically placed folder. I place a copy of the configured .env file in a folder that has the following path from the working folder: `../env//.env` +* `build-steps.ps1` - This runs through each step of the build and pauses just before it executes the next build step so that the developer can check the results of the previous build step. ## The Result -The build creates a developer version of a running instance of OSPOS. +The build creates a developer version of a runnable instance of OSPOS. -It is NOT something that should be installed into production. +It is NOT something that should be used for production. + +However, the zip and tar files, found in the root `dist` folder, are created as part of the build process and can be used for deploying a production instance of OSPOS. -However, the zip and tar files, found in the root dist folder, are created as part of the process can be used for deploying a production instance of OSPOS. Good luck with your build. diff --git a/build.ps1 b/build.ps1 index 5340691b9..8a3551348 100644 --- a/build.ps1 +++ b/build.ps1 @@ -23,12 +23,12 @@ npm run buildtasks Write-Output "=============================================================================" Write-Output "Restore configured .env file if it exists." -Write-Output "(If one is found in a folder located at ../etc/name-of-current-folder)" +Write-Output "(If one is found in a folder located at ../env/)" Write-Output "=============================================================================" $currentfolder = Split-Path -Path (Get-Location) -Leaf -if(Test-Path -Path ../etc/$currentfolder/.env -PathType Leaf) +if(Test-Path -Path ../env/$currentfolder/.env -PathType Leaf) { -Copy ../etc/$currentfolder/.env +Copy ../env/$currentfolder/.env } Write-Output "============================================================================="