Skip to content
Snippets Groups Projects
Commit 66c3ca03 authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Added Rakefile with DEV specific commands to build docker images

Docker local tag will contain local code, so we can test them locally
parent 0fa15a51
No related merge requests found
FROM gitlab/gitlab-ce:nightly
COPY ./app /opt/gitlab/embedded/service/gitlab-rails/app
COPY ./lib /opt/gitlab/embedded/service/gitlab-rails/lib
COPY ./db /opt/gitlab/embedded/service/gitlab-rails/db
FROM gitlab/gitlab-ee:nightly
COPY ./app /opt/gitlab/embedded/service/gitlab-rails/app
COPY ./lib /opt/gitlab/embedded/service/gitlab-rails/lib
COPY ./db /opt/gitlab/embedded/service/gitlab-rails/db
COPY ./ee /opt/gitlab/embedded/service/gitlab-rails/ee
......@@ -57,4 +57,23 @@ GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password bin/qa Test::Instance https://gi
All [supported environment variables are here](https://gitlab.com/gitlab-org/gitlab-qa#supported-environment-variables).
### Rebuilding docker images
For development purpose, you can patch the `nigthly` images with changed code available in your machine.
This allows for faster iteration, and allows you to test the changes in the same environment that will be run by GitLab CI.
Locally patched images are tagged as `local`, and can be build by one of the commands bellow:
```bash
rake dev:build_gitlab_ce_docker # Build Gitlab CE Docker image based on nightly with local code
rake dev:build_gitlab_ee_docker # Build Gitlab EE Docker image based on nightly with local code
rake dev:build_qa_docker # Build QA Docker image based on nightly with local code
```
You can use the custom patched images to execute `gitlab-qa` with local changes, like this example:
```bash
gitlab-qa Test::Integration::Geo gitlab/gitlab-ee:local
```
[GDK]: https://gitlab.com/gitlab-org/gitlab-development-kit/
namespace :dev do
desc 'Build QA Docker image based on nightly with local code'
task :build_qa_docker do
sh 'docker build . -t gitlab/gitlab-ee-qa:local'
end
desc 'Build Gitlab EE Docker image based on nightly with local code'
task :build_gitlab_ee_docker do
sh 'docker build ./../ -f Dockerfile.gitlab-ee -t gitlab/gitlab-ee:local'
end
desc 'Build Gitlab CE Docker image based on nightly with local code'
task :build_gitlab_ce_docker do
sh 'docker build ./../ -f Dockerfile.gitlab-ce -t gitlab/gitlab-ce:local'
end
end
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment