Skip to content

Some template code for setting up a project using Gitlab and Openshift

Notifications You must be signed in to change notification settings

ldlamarc/gitlab-openshift

Repository files navigation

Introduction

This is an opinionated template Ruby app using Gitlab CI/Openshift/Docker.

Conventions

Git flow

Git flow is used as a branching model. See .gitlab-ci.yml.

RVM

RVM is used as a Ruby version manager. See .ruby-gemset and .ruby-version. Change gemset name to app name.

Docker

Docker is used to build and run containers. See Dockerfile.

Commands

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

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

Githooks

Enable testing before commit. Install hooks with 'make git' (see Makefile).

Openshift

Openshift is based on kubernetes. It is used to deploy the Docker containers. The openshift/init.sh script initiates the Openshift environment.

Using the template

Git

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

Openshift

Look at init.sh and openshift/README.md. Change the values.

RVM

Change .ruby-gemset to app name

Gitignore

Add **/*.secrets to gitignore. And remove it from git.

About

Some template code for setting up a project using Gitlab and Openshift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published