Skip to content
Snippets Groups Projects
Commit dd11d758 authored by Valery Sizov's avatar Valery Sizov
Browse files

Merge branch 'fix_build' into 'master'

Setup CI builds

Closes https://gitlab.com/gitlab-org/gitlab-elasticsearch-git/issues/5

See merge request !13
parents 2c6f3b9e 76a1be96
No related branches found
No related tags found
1 merge request!13Setup CI builds
Pipeline #
image: "ruby:2.3"
 
services:
- elasticsearch:latest
variables:
ELASTICSEARCH_HOST: "elasticsearch"
before_script:
- apt-get update -yqqq; apt-get -o dir::cache::archives="vendor/apt" install -y -qq --force-yes libicu-dev cmake
- gem install bundler # Bundler is not installed with the image
- bundle install -j $(nproc) # Install dependencies
 
rspec:
script:
- rspec spec
- rspec
PATH
remote: .
specs:
gitlab-elasticsearch-git (0.0.13)
gitlab-elasticsearch-git (0.0.15)
activemodel (~> 4.2)
activesupport (~> 4.2)
charlock_holmes (~> 0.7)
Loading
Loading
Loading
Loading
@@ -102,4 +102,4 @@ describe TestRepository do
expect(TestRepository.__elasticsearch__.search('test').results.count).to eq(4)
expect(repo.search('test')[:commits][:total_count]).to eq(2)
end
end
\ No newline at end of file
end
Loading
Loading
@@ -13,4 +13,4 @@ RSpec.configure do |config|
config.include ElasticHelper
config.include SeedHelper
config.before(:all) { ensure_seeds }
end
\ No newline at end of file
end
Loading
Loading
@@ -9,6 +9,7 @@ module ElasticHelper
end
 
def elastic_url
'http://localhost:9200/'
host = ENV['ELASTICSEARCH_HOST'] || 'localhost'
"http://#{host}:9200/"
end
end
\ No newline at end of file
end
require 'fileutils'
 
module SeedHelper
GITLAB_URL = "git@gitlab.com:gitlab-org/gitlab-elasticsearch-git-test.git"
GITLAB_URL = "https://gitlab.com/gitlab-org/gitlab-elasticsearch-git-test.git"
 
def ensure_seeds
if File.exists?(SUPPORT_PATH)
Loading
Loading
@@ -22,4 +22,4 @@ module SeedHelper
def git_env
{'GIT_TEMPLATE_DIR' => ''}
end
end
\ No newline at end of file
end
class TestRepository
include Elasticsearch::Git::Repository
 
CLIENT = Elasticsearch::Client.new(
host: (ENV['ELASTICSEARCH_HOST'] || 'localhost')
)
self.__elasticsearch__.client = CLIENT
def initialize(id = 'test_1')
@repo_id = id
end
 
def client_for_indexing
CLIENT
end
def repository_id
@repo_id
end
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