This is an opinionated template Ruby app using Gitlab CI/Openshift/Docker.
Git flow is used as a branching model. See .gitlab-ci.yml.
RVM is used as a Ruby version manager. See .ruby-gemset and .ruby-version. Change gemset name to app name.
Docker is used to build and run containers. See Dockerfile.
Build test image
docker build . -t test_hello_world --target Test
Build prd image
docker build . -t hello_world
Run tests
docker run --rm -it test_hello_world
Run server
docker run --rm -it -p 4567:4567 hello_world
Gitlab CI is used to build and test Docker images and push them to the Gitlab registry.
To run it locally install a gitlab runner or run it via docker:
docker run --rm -t -i gitlab/gitlab-runner --help
Enable testing before commit. Install hooks with 'make git' (see Makefile).
Openshift is based on kubernetes. It is used to deploy the Docker containers. The openshift/init.sh script initiates the Openshift environment.
git clone *url_of_this_repo* *name_of_your_app*
git checkout -b master
git merge ruby
git branch -d ruby
git remote remove origin
git remote add *url_of_your_git_repo*
# Make sure git flow is installed
# Branch name for production releases: [master]
# Branch name for "next release" development: [develop]
# Feature branches? [feature/]
# Release branches? [release/]
# Hotfix branches? [hotfix/]
# Support branches? [support/]
# Version tag prefix? [] v
make git
Look at init.sh and openshift/README.md. Change the values.
Change .ruby-gemset to app name
Add **/*.secrets to gitignore. And remove it from git.