About
Deployment
Secret management
Setup
Environment variables
Custom DNS names
Configure backend URL
Configure mobile app metadata
Provide a template for an application.
The template included a bare bones rails application that can be contanarised and deployed to kubernetes.
The repository is setup with a Dockerfile and will build and image and push it to the internal repository.
A helm chart in the app-deploy-fe folder will also deploy the application to your kubernetes cluster.
The repository contains all the components for a fully automated build and deploy system.
Once the kubernetes cluster is created, merges to master will be automatically tagged with a version and deployed.
Clone (make a copy) of this repository.
Choose a name specific to your project, it must start with a letter and only contain letters, numbers or hyphens ( - ) and underscores ( _ )
In your project under settings, set the following variables
The following are made available to your pod as environment variables:
TEMPLATEAPP_DATABASE
The name of the database created.
TEMPLATEAPP_DATABASE_USER
User to authenticate with database.
TEMPLATEAPP_DATABASE_PASSWORD
Password for database authentication.
TEMPLATE_DATABASE_HOSTNAME
Database hostname to connect to.
You can define vaules to pass to your applicaiton in the app-deploy-fe/vaules.yml file, with "appExtConfig".
For example:
appExtConfig:
extval1: "example1"
EXTVAL2: "example2"This will expose environment variables in your pod such as :
# echo $EXTVAL2
example2You may add any many variables as you need, using names of your choosing.
You must generate the value here from within the Gitlab web interface. Go to:
Under Settings -> Repository, select all scopes. Click "Create deploy token"
IMPORTANT: set the name of the token to gitlab-deploy-token as this will ensure it gets injected to the pipeline automatically.
To use this repo to function as just a deployment :
- Make a copy of your application repo into a new repository.
- Add the existing gitab-ci variables to the new repo
- If deploying to a new cluser, ensure you replace the KUBECONFIG variable to point to the new cluster
- Remove the application code and Dockerfile
- Remove the build stage in the .gitlab-ci.yml file
- Set the gitlab-ci variable
CONTAINER_IMAGEto your image name, e.g.CONTAINER_IMAGE=gitlab.builder.ai:5000/ruby-app
- Set the gitlab-ci variable
APP_VERSIONto the version you wish to deploy e.g.APP_VERSION=0.0.12
All of the component relating to build the container and deploying it are included in this repository.
Make only the changes that you need and remember, "with great power comes great responsibility"