Skip to content
Snippets Groups Projects
Commit 8ad12d38 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Support updating using make for both CE and EE

parent e107859e
No related branches found
No related tags found
1 merge request!94[WIP] First try to support both CE and EE in gdk
Loading
Loading
@@ -10,6 +10,7 @@ all: ce ee gitlab-workhorse-setup support-setup
 
#-------------------------------
# Set up the GitLab CE Rails app
#-------------------------------
 
ce: ce/gitlab-setup ce/gitlab-shell-setup
 
Loading
Loading
@@ -41,8 +42,6 @@ ce/gitlab/config/resque.yml:
ce/gitlab/.bundle:
cd ${gitlab_development_root}/ce/gitlab && bundle install --without mysql production --jobs 4
 
# Set up gitlab-shell
ce/gitlab-shell-setup: ce/gitlab-shell/.git ce/gitlab-shell/config.yml ce/gitlab-shell/.bundle
 
ce/gitlab-shell/.git:
Loading
Loading
@@ -60,6 +59,7 @@ ce/gitlab-shell/.bundle:
 
#-------------------------------
# Set up the GitLab EE Rails app
#-------------------------------
 
ee: ee/gitlab-setup ee/gitlab-shell-setup
 
Loading
Loading
@@ -91,8 +91,6 @@ ee/gitlab/config/resque.yml:
ee/gitlab/.bundle:
cd ${gitlab_development_root}/ee/gitlab && bundle install --without mysql production --jobs 4
 
# Set up gitlab-shell
ee/gitlab-shell-setup: ee/gitlab-shell/.git ee/gitlab-shell/config.yml ee/gitlab-shell/.bundle
 
ee/gitlab-shell/.git:
Loading
Loading
@@ -108,25 +106,17 @@ ee/gitlab-shell/config.yml:
ee/gitlab-shell/.bundle:
cd ${gitlab_development_root}/ee/gitlab-shell && bundle install --without production --jobs 4
 
#-------------------------------
# Set up gitlab-runner
# ------------------------------------------------
# Update gitlab, gitlab-shell and gitlab-workhorse
# ------------------------------------------------
 
gitlab-runner-setup: gitlab-runner/.git gitlab-runner/.bundle
update: ce/update ee/update gitlab-workhorse-update
 
gitlab-runner/.git:
git clone ${gitlab_runner_repo} gitlab-runner
ce/update: ce/gitlab-update ce/gitlab-shell-update
 
gitlab-runner/.bundle:
cd ${gitlab_development_root}/gitlab-runner && bundle install --jobs 4
ee/update: ee/gitlab-update ee/gitlab-shell-update
 
gitlab-runner-clean:
rm -rf gitlab-runner
# Update gitlab, gitlab-shell and gitlab-runner
update: ce/gitlab-update ce/gitlab-shell-update gitlab-runner-update gitlab-workhorse-update
ce/gitlab-update: gitlab/.git/pull
ce/gitlab-update: ce/gitlab/.git/pull
cd ${gitlab_development_root}/ce/gitlab && \
bundle install --without mysql production --jobs 4 && \
bundle exec rake db:migrate
Loading
Loading
@@ -135,10 +125,6 @@ ce/gitlab-shell-update: ce/gitlab-shell/.git/pull
cd ${gitlab_development_root}/ce/gitlab-shell && \
bundle install --without production --jobs 4
 
gitlab-runner-update: gitlab-runner/.git/pull
cd ${gitlab_development_root}/gitlab-runner && \
bundle install
ce/gitlab/.git/pull:
cd ${gitlab_development_root}/ce/gitlab && \
git checkout -- Gemfile.lock db/schema.rb && \
Loading
Loading
@@ -150,10 +136,51 @@ ce/gitlab-shell/.git/pull:
git stash && git checkout master && \
git pull --ff-only
 
ee/gitlab-update: ce/gitlab/.git/pull
cd ${gitlab_development_root}/ee/gitlab && \
bundle install --without mysql production --jobs 4 && \
bundle exec rake db:migrate
ee/gitlab-shell-update: ce/gitlab-shell/.git/pull
cd ${gitlab_development_root}/ee/gitlab-shell && \
bundle install --without production --jobs 4
ee/gitlab/.git/pull:
cd ${gitlab_development_root}/ee/gitlab && \
git checkout -- Gemfile.lock db/schema.rb && \
git stash && git checkout master && \
git pull --ff-only
ee/gitlab-shell/.git/pull:
cd ${gitlab_development_root}/ee/gitlab-shell && \
git stash && git checkout master && \
git pull --ff-only
#---------------------
# Set up gitlab-runner
#---------------------
gitlab-runner-setup: gitlab-runner/.git gitlab-runner/.bundle
gitlab-runner/.git:
git clone ${gitlab_runner_repo} gitlab-runner
gitlab-runner/.bundle:
cd ${gitlab_development_root}/gitlab-runner && bundle install --jobs 4
gitlab-runner-clean:
rm -rf gitlab-runner
gitlab-runner-update: gitlab-runner/.git/pull
cd ${gitlab_development_root}/gitlab-runner && \
bundle install
gitlab-runner/.git/pull:
cd ${gitlab_development_root}/gitlab-runner && git pull --ff-only
 
# --------------------------
# Set up supporting services
# --------------------------
 
support-setup: Procfile redis postgresql .bundle
@echo ""
Loading
Loading
Loading
Loading
@@ -305,10 +305,11 @@ This will run Foreman on port 4000. GitLab-workhorse is already running on port
3000, hence to login to GitLab you may now go to http://localhost:3000 in your
browser. The development login credentials are `root` and `5iveL!fe`.
 
To enable the OpenLDAP server, see the OpenLDAP instructions in this readme.
To enable the OpenLDAP server, see the OpenLDAP instructions in this README.
 
To setup GitLab EE, replace `ce` with `ee` in the command above. See the
GitLab EE section in this readme for more information.
To setup GitLab EE, replace `ce` with `ee` in the commands above. See the
'Switch between GitLab CE and GitLab EE' section in this README for more
information.
 
END Post-installation
 
Loading
Loading
@@ -364,32 +365,70 @@ In order to be able to run both GitLab CE and EE in one development kit, those
two versions should differentiate somehow. Their data are stored in the `ce/`
and `ee/` directories respectively. Each installation has its own repositories,
gitlab-shell and `.ssh` directory. They talk to one single postgres instance,
each having its own database.
each having its own database and they use the same Redis server database.
 
To run GitLab EE effectively you will need a license key. In order to obtain
one, send an e-mail to `sales@gitlab.com` describing your purpose of
developing on EE.
 
## Update gitlab and gitlab-shell repositories
## Update GitLab, gitlab-shell and gitlab-workhorse
 
When working on a new feature, always check that your `gitlab` repository is up
to date with the upstream master branch.
When working on a new feature, always check that your GitLab repository is
up to date with the upstream master branch.
If there are changes in your local repositories or/and a different branch than
master is checked out, the update commands will stash any uncommitted changes
and change to master branch before updating the remote repositories.
The sections below describe how to use the `make` commands to update GitLab. If
you don't want to use the Makefile, the steps you need to manually perform are:
1. Fetch the latest code of GitLab and gitlab-shell
1. Execute `bundle` to install/update any new gems
1. Execute `bundle exec rake db:migrate` to run any database migrations
### Update GitLab CE
 
In order to fetch the latest code, first make sure that `foreman` for
postgres is running (needed for db migration) and then run:
 
```
make update
make ce/update
```
This will update both GitLab CE and `gitlab-shell` and run any possible
migrations. You can also update them separately by running
`make ce/gitlab-update` and `make ce/gitlab-shell-update` respectively.
### Update GitLab EE
If you are developing on GitLab EE, you can update GitLab EE and its gitlab-shell
with:
```bash
make ee/update
```
 
This will update both `gitlab` and `gitlab-shell` and run any possible
migrations. You can also update them separately by running `make gitlab-update`
and `make gitlab-shell-update` respectively.
This will update both GitLab CE and `gitlab-shell` and run any possible
migrations. You can also update them separately by running
`make ce/gitlab-update` and `make ce/gitlab-shell-update` respectively.
 
If there are changes in the aformentioned local repositories or/and a different
branch than master is checked out, the `make update` commands will stash any
uncommitted changes and change to master branch prior to updating the remote
repositories.
### Update gitlab-workhorse
To update gitlab-workhorse, run:
```bash
make gitlab-workhorse-update
```
### Update all
To update GitLab CE, GitLab EE, their gitlab-shells and gitlab workhorse in one
go, run:
```bash
make update
```
 
## Update configuration files created by gitlab-development-kit
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment