webbuild
webbuild is a docker container that runs your frontend build tasks. It was designed to have them running in a clean predefined environment yet being customizable
The container can be used using briefbote/webbuild
Inside
There are four flavors of this container:
- PHP 5.5
- PHP 5.6
- PHP 7.0
- PHP 7.1
You can use specific php versions by using them as a tag:
docker run briefbote/webbuild:56 for PHP5.5 for example.
The latest tag points to the PHP7.0 version
Build expects /src containing the source code and /app containing the release after all build steps have run.
Git is installed within the container.
The package build-essential is installed within the container.
Note about php-55
This container will not be updated automatically as support for PHP 5.5 has been retired. Version 5.6 will get security updates until 12/31/2018.
See http://php.net/supported-versions.php
Execution
NODEJS will be installed using nvm. It is respecting .nvmrc. After that, grunt, gulp and bower are installed
Customization
You can disable build tools ( installation and run ). Also it is possible to set a custom base directory. From a docker perspective you can inherit from this image and customize the resulting image with a pre- and postbuild script.
See https://github.com/sascha-andres/webbuild/wiki/Customization for more information.
Build steps
$BASEDIR/.webbuild/prebuild.shif it exists- Loading
$BASEDIR/.webbuild/variables.shif it exists nvm install 4ornvm installin .webbuild/ is .nvmrc exists there if using nodenpm installif$BASE/package.jsonexistsbowerif$BASE/bower.jsonexistscomposerwithout dev dependencies if$BASE/composer.jsonexistsgruntif$BASE/Gruntfileexistsgulpif$BASE/gulpfile.jsexistsangularcliif$BASE/.angular-cli.jsonexists$BASE/.webbuild/custom.shif it exists- task if
$BASE/Taskfile.ymlexists $BASE/.webbuild/postbuild.shif it exists
Return codes
Non zero exit codes will be returned when one of the build steps are failing or /app is empty after step 14.
Usage
Assume you want to build a web application in the current directory containing the sources within the src subfolder
and you want to place the build in the app subfolder.
Then you can run the build like this:
docker run -t briefbote/webbuild:latest -v $PWD/src:/src -v $PWD/app:/app
Samples
simple
A very simplistic sample of it is in the samples/simple subfolder of this repository (note that test/app/ is in the .gitignore file).
To run the sample change to the test directory and run run.sh. It (re)creates the app subfolder ands starts a build
that actually does nothing more then to copy the index.html using a custom.sh into the /app folder
Code
Code is open source under the Apache 2.0 License. You can obtain it at https://github.com/sascha-andres/webbuild
If you want to contribute feel free to open an issue
on hub.docker.com
https://hub.docker.com/r/briefbote/webbuild/
Help
Feel free to contact me by creating an issue on https://github.com/sascha-andres/webbuild/issues. You can connect to me using Twitter at https://twitter.com/livingit_de.
History
History is now edited on GitHub WIKI: https://github.com/sascha-andres/webbuild/wiki/History