During local development the images build for the application stack are named by `docker-compose`, if not specified otherwise. For testing they are by default named `registry/namespace/phd5` via setting the `STACK_PHP_IMAGE` variable used in `docker-compose.test.yml`.
In the CI we override this variable by setting it in the configuration to the actual image name we want to push later, eg. `registry.example.com/mycomany/the-project` for private registries or `vendor/image` for usage with *DockerHub*.
---
### Workflow
1. Clone application from local repository
2. Start application `make all`
3. Make changes in local development stack
4. (optional) Run tests in isolated local testing stack `make TEST up setup run-tests`
5. Commit (triggers CI)
6. CI builds images
7. CI starts isolated stacks (by setting custom `COMPOSE_PROJECT_NAME`s) from built images and performs setup operations
8. CI runs tests (also acceptance tests with Selenium containers)
9. CI creates reports
10. CI performs cleanup of isolated stacks
11. CI tags images and pushes them to a registry (if tests were successful)
## Usage
### Using *Git* branches to build releases and trigger deployments
Run the test suites from build scripts
Build, test and push a `:latest` image
$ sh build/scripts/build.sh
$ sh build/scripts/test.sh
```
make latest
```
Build, test and push a `:1.2.3-4-gfedcba98` image
#### Building the `:production` image
```
make release
```
Adjust your `Dockerfile` and build `FROM phundament/app:production`.