Skip to content
Snippets Groups Projects
Unverified Commit 1ffb129e authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Initial take on Review Apps

parent cbbbd4e0
No related branches found
No related tags found
1 merge request!243WIP: Initial take on Review Apps
Pipeline #
Loading
Loading
@@ -32,3 +32,21 @@ RUN echo 'eval "$(rbenv init -)"' >> /home/gdk/.bash_profile
RUN mkdir /home/gdk/.rbenv/plugins
RUN git clone https://github.com/sstephenson/ruby-build.git /home/gdk/.rbenv/plugins/ruby-build
RUN bash -l -c "rbenv install 2.3.3 && rbenv global 2.3.3"
WORKDIR /home/gdk
ENV host=0.0.0.0 port=5000
ADD review-apps/init /review-apps/init
RUN /review-apps/init
USER root
RUN apt-get install -y nano vim ed
USER gdk
ADD review-apps/run /review-apps/run
COPY support /home/gdk/gitlab-development-kit/support
COPY Makefile /home/gdk/gitlab-development-kit/Makefile
EXPOSE 5000
CMD ["/review-apps/run"]
Loading
Loading
@@ -13,6 +13,7 @@ port = $(shell cat port 2>/dev/null)
username = $(shell whoami)
sshd_bin = $(shell which sshd)
git_bin = $(shell which git)
docker_repo = "ayufan/gitlab-development-kit"
 
all: gitlab-setup gitlab-shell-setup gitlab-workhorse-setup support-setup gitaly-setup
 
Loading
Loading
@@ -91,25 +92,36 @@ update: gitlab-update gitlab-shell-update gitlab-workhorse-update gitaly-update
gitlab-update: gitlab/.git/pull
cd ${gitlab_development_root}/gitlab && \
bundle install --without mysql production --jobs 4
ifeq ($(OFFLINE_UPDATE),)
@echo ""
@echo "------------------------------------------------------------"
@echo "Make sure Postgres is running otherwise db:migrate will fail"
@echo "------------------------------------------------------------"
@echo ""
cd ${gitlab_development_root}/gitlab && \
bundle exec rake db:migrate db:test:prepare && \
npm prune && \
npm install
bin/rake db:migrate db:test:prepare
else
support/migrate-rails
endif
cd ${gitlab_development_root}/gitlab && \
npm prune && \
npm install
 
gitlab-shell-update: gitlab-shell/.git/pull
cd ${gitlab_development_root}/gitlab-shell && \
bundle install --without production --jobs 4
 
gitlab/.git/pull:
ifeq ($(CI_CHECKOUT_SHA),)
cd ${gitlab_development_root}/gitlab && \
git checkout -- Gemfile.lock db/schema.rb && \
git stash && git checkout master && \
git pull --ff-only upstream master
else
cd ${gitlab_development_root}/gitlab && \
git fetch origin && \
git checkout -f $(CI_CHECKOUT_SHA)
endif
 
gitlab-shell/.git/pull:
cd ${gitlab_development_root}/gitlab-shell && \
Loading
Loading
@@ -155,9 +167,9 @@ redis: redis/redis.conf
redis/redis.conf:
sed "s|/home/git|${gitlab_development_root}|" $@.example > $@
 
postgresql: postgresql/data
postgresql: postgresql/data/PG_VERSION
 
postgresql/data:
postgresql/data/PG_VERSION:
${postgres_bin_dir}/initdb --locale=C -E utf-8 postgresql/data
support/bootstrap-rails
 
Loading
Loading
@@ -272,3 +284,13 @@ clean-config:
redis/redis.conf \
.ruby-version \
Procfile \
docker_build:
docker build --cache-from=ayufan/gitlab-development-kit -t $(docker_repo) .
docker_build_and_run: docker_build
-docker rm -f -v gdk
docker run -it --name=gdk --rm $(docker_repo) $(docker_cmd)
docker_build_and_push: docker_build
docker push $(docker_repo)
#!/bin/bash -l
set -xe
gem install gitlab-development-kit
gdk init
cd gitlab-development-kit
gdk install
#!/bin/bash -l
set -xe
export ENABLE_SPRING=true
cd gitlab-development-kit
make update \
OFFLINE_UPDATE=1 \
CI_CHECKOUT_SHA=$CI_CHECKOUT_SHA
gdk run
#!/usr/bin/env ruby
success = true
begin
foreman_pid = spawn('./run', 'db')
[
%W(bin/rake db:migrate),
%W(bin/rake db:test:prepare),
].each do |cmd|
success &&= system(*cmd, chdir: 'gitlab')
end
ensure
Process.kill('TERM', foreman_pid)
end
Process.wait(foreman_pid)
exit true if success
abort "#$0 failed"
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