Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
igentify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nimrod
igentify
Commits
6e5e1765
Commit
6e5e1765
authored
6 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Documentation and explanation.
parent
0b05ebf4
Branches
master
No related tags found
No related merge requests found
Pipeline
#9
failed
4 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+50
-0
50 additions, 0 deletions
README.md
with
50 additions
and
0 deletions
README.md
+
50
−
0
View file @
6e5e1765
# Igentify assignment
# Igentify assignment
> Goal: Build a CI/CD pipeline.
## Description
I forked the Platform.sh example Django2 project. I then replaced the
platform.sh specifics with a docker-compose setup (for local usage).
Afterwards I added a Kubernetes deployment and a GitLab CI/CD pipeline.
## Relevant files
`Dockerfile`
`docker-compose.yml`
`.gitlab-ci.yml`
`myapp-deployment.yaml`
`myapp-migrate.yaml`
## Pipeline
The pipeline has 3 steps, build (and upload), test and deploy. The build step
builds the image, tagged as the build run number and uploads it to the registry.
The test step uses the image from the registry, runs it in a Docker network
along side the services described in the step (postgres), runs the migration and
then the tests (no tests so far). This way you always run with a clean database,
test the migrations as well and you can run several such tests simultaneously,
even on the same machine. The last step is deployment, which is run manually.
The step downloads from an S3 bucket the kubectl config then runs the database
migration job, waits for it to finish successfully and finally deploys the
relevant version.
## Assumptions
-
An S3 bucket with the
`kubectl`
config file for the Kubernetes cluster.
-
AWS key ID and secret for the IAM user that's allowed access to the S3 bucket
(key ID in
`.gitlab-ci.yml`
and the secret in the secret variables through the
webui).
-
PostgresQL database deployed to the Kubernetes cluster.
-
Kubernetes secret for the postgres password.
-
GitLab Docker image registry.
-
GitLab runner with access to the Docker daemon.
-
Connectivity with Kubernetes cluster.
## Further work
-
Running as a limited user insided the container.
-
Smaller image size.
-
Resource limits.
-
Spliting the upload for the
`latest`
from the build and upload, not uploading
if the test failed.
-
Use seperate Postgres accounts for migrations and the application.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment