Mostly clean up the build documentation, but also corrects an error in the creation of the database script that supports migration from phppos

This commit is contained in:
Steve Ireland
2023-02-27 20:58:22 -05:00
parent 78cfe927b0
commit d8d82aaeed
3 changed files with 23 additions and 17 deletions

View File

@@ -1,16 +1,18 @@
## Building From Source
# Building OSPOS
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.
## For Developers and Hobbyists Only
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.
If you are a developer and need to add unique features to OSPOS, you can download the raw code from the github repository and make 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 to be a fully functional application.
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.
## Requirements
This applies only to the upcoming 3.4.0 release of OSPOS which is being worked on in the CI4 branch, where we are upgrading OSPOS to version 4 of the CodeIgniter framework.
This applies only to the upcoming 3.4.0 release of OSPOS which is being worked on in the CI4 branch.
## Prerequisites
- Install the latest version of NPM.
- Install the latest version of Composer.
@@ -18,33 +20,37 @@ 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 found at https://github.com/opensourcepos/opensourcepos/tree/ci4-upgrade.
2. Unzip it and copy the contents into your working folder.
2. Unzip it and copy the contents into the 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`
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.
That's all there is to it. These commands thread a lot of smaller tasks together and 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 each task using the correct version of Grunt.
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.
After the build tasks are complete, 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 runnable version of OSPOS.
If you do not have an existing (and upgraded) database, then you will need to continue from this point forward with the standard installation instructions, but at this point you have a runnable version of OSPOS.
### Windows Platform
The .env file is a convenience method for setting your configuration.
Using an `.env` file is a convenient approach to store OSPOS 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.
I've added the following Powershell scripts to make my life a bit easier, which I share with you.
* `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/<working-folder-name>/.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 runnable instance of OSPOS.
The build creates a developer version of a runnable instance of OSPOS. It contains a ton of developer stuff that **should not be deployed to a production environment**.
It is NOT something that should be used for production.
Again, the results of this build 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 build process and can be used for deploying a ***trial production*** instance of OSPOS.
Good luck with your build.
Only official releases should be used for real production. There is significant risk of failure should you chose to deploy a development branch or even a master branch that the development team hasn't signed off on.
Good luck with your build. Please report any issues you encounter.

View File

@@ -138,7 +138,7 @@ module.exports = function(grunt) {
},
files: {
'app/Database/database.sql': ['app/Database/tables.sql', 'app/Database/constraints.sql'],
'app/Database/migrate_phppos_dist.sql': ['app/Database/tables.sql', 'app/Database/phppos_migrate.sql', 'database/constraints.sql']
'app/Database/migrate_phppos_dist.sql': ['app/Database/tables.sql', 'app/Database/Migrations/sqlscripts/pre-3.0.2/phppos_migrate.sql', 'database/constraints.sql']
}
}
},

View File

@@ -8,7 +8,7 @@
## Local install
First of all, if you're seeing the message `system folder missing` after launching your browser, that most likely means you have cloned the repository and have not built the project.
First of all, if you're seeing the message `system folder missing` after launching your browser, or cannot find `database.php`, that most likely means you have cloned the repository and have not built the project. To build the project from a source commit point instead of from an official release check out [Building OSPOS](BUILD.md). Otherwise, continue with the following steps.
1. Download the a [pre-release for a specific branch](https://github.com/opensourcepos/opensourcepos/packages/1047637) or the latest stable [from GitHub here](https://github.com/opensourcepos/opensourcepos/releases). A repository clone will not work unless know how to build the project.
2. Create/locate a new MySQL database to install Open Source Point of Sale into.