Commit 4720da84 authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-04-10' into 'master'

CE upstream - 2018-04-10 20:31 UTC

Closes gitlab-development-kit#335

See merge request gitlab-org/gitlab-ee!5316
parents e20ca10a 2d8e027f
......@@ -321,6 +321,9 @@ GEM
rubyntlm (~> 0.5)
globalid (0.4.1)
activesupport (>= 4.2.0)
goldiloader (2.0.1)
activerecord (>= 4.2, < 5.2)
activesupport (>= 4.2, < 5.2)
gollum-grit_adapter (1.0.1)
gitlab-grit (~> 2.7, >= 2.7.1)
gollum-lib (4.2.7)
......@@ -878,7 +881,7 @@ GEM
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
slack-notifier (1.5.1)
spinach (0.10.1)
spinach (0.8.10)
colorize
gherkin-ruby (>= 0.3.2)
json
......@@ -1072,6 +1075,7 @@ DEPENDENCIES
gitlab-markup (~> 1.6.2)
gitlab-styles (~> 2.3)
gitlab_omniauth-ldap (~> 2.0.4)
goldiloader (~> 2.0)
gollum-lib (~> 4.2)
gollum-rugged_adapter (~> 0.4.4)
gon (~> 6.1.0)
......
......@@ -13,16 +13,16 @@
* 3. Merge request widget
* 4. Commit widget
*/
import axios from '../../lib/utils/axios_utils';
import Flash from '../../flash';
import icon from '../../vue_shared/components/icon.vue';
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
import Icon from '../../vue_shared/components/icon.vue';
import LoadingIcon from '../../vue_shared/components/loading_icon.vue';
import tooltip from '../../vue_shared/directives/tooltip';
export default {
components: {
loadingIcon,
icon,
LoadingIcon,
Icon,
},
directives: {
......@@ -88,9 +88,8 @@
},
fetchJobs() {
this.$http.get(this.stage.dropdown_path)
.then(response => response.json())
.then((data) => {
axios.get(this.stage.dropdown_path)
.then(({ data }) => {
this.dropdownContent = data.html;
this.isLoading = false;
})
......@@ -98,8 +97,7 @@
this.closeDropdown();
this.isLoading = false;
const flash = new Flash('Something went wrong on our end.');
return flash;
Flash('Something went wrong on our end.');
});
},
......
#!/usr/bin/env ruby
# Remove this block when removing rails5? code.
gemfile = %w[1 true].include?(ENV["RAILS5"]) ? "Gemfile.rails5" : "Gemfile"
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
......
require './spec/support/sidekiq'
Gitlab::Seeder.quiet do
User.seed do |s|
s.id = 1
s.name = 'Administrator'
s.email = 'admin@example.com'
s.notification_email = 'admin@example.com'
s.username = 'root'
s.password = '5iveL!fe'
s.admin = true
s.confirmed_at = DateTime.now
end
User.create!(
name: 'Administrator',
email: 'admin@example.com',
username: 'root',
password: '5iveL!fe',
admin: true,
confirmed_at: DateTime.now
)
print '.'
end
import _ from 'underscore';
import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import stage from '~/pipelines/components/stage.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
describe('Pipelines stage component', () => {
let StageComponent;
let component;
let mock;
beforeEach(() => {
mock = new MockAdapter(axios);
StageComponent = Vue.extend(stage);
component = new StageComponent({
propsData: {
stage: {
status: {
group: 'success',
icon: 'icon_status_success',
title: 'success',
},
dropdown_path: 'foo',
component = mountComponent(StageComponent, {
stage: {
status: {
group: 'success',
icon: 'icon_status_success',
title: 'success',
},
updateDropdown: false,
dropdown_path: 'path.json',
},
}).$mount();
updateDropdown: false,
});
});
afterEach(() => {
component.$destroy();
mock.restore();
});
it('should render a dropdown with the status icon', () => {
......@@ -31,23 +39,11 @@ describe('Pipelines stage component', () => {
});
describe('with successfull request', () => {
const interceptor = (request, next) => {
next(request.respondWith(JSON.stringify({ html: 'foo' }), {
status: 200,
}));
};
beforeEach(() => {
Vue.http.interceptors.push(interceptor);
});
afterEach(() => {
Vue.http.interceptors = _.without(
Vue.http.interceptors, interceptor,
);
mock.onGet('path.json').reply(200, { html: 'foo' });
});
it('should render the received data', (done) => {
it('should render the received data', done => {
component.$el.querySelector('button').click();
setTimeout(() => {
......@@ -60,20 +56,8 @@ describe('Pipelines stage component', () => {
});
describe('when request fails', () => {
const interceptor = (request, next) => {
next(request.respondWith(JSON.stringify({}), {
status: 500,
}));
};
beforeEach(() => {
Vue.http.interceptors.push(interceptor);
});
afterEach(() => {
Vue.http.interceptors = _.without(
Vue.http.interceptors, interceptor,
);
mock.onGet('path.json').reply(500);
});
it('should close the dropdown', () => {
......@@ -86,33 +70,18 @@ describe('Pipelines stage component', () => {
});
describe('update endpoint correctly', () => {
const updatedInterceptor = (request, next) => {
if (request.url === 'bar') {
next(request.respondWith(JSON.stringify({ html: 'this is the updated content' }), {
status: 200,
}));
}
next();
};
beforeEach(() => {
Vue.http.interceptors.push(updatedInterceptor);
});
afterEach(() => {
Vue.http.interceptors = _.without(
Vue.http.interceptors, updatedInterceptor,
);
mock.onGet('bar.json').reply(200, { html: 'this is the updated content' });
});
it('should update the stage to request the new endpoint provided', (done) => {
it('should update the stage to request the new endpoint provided', done => {
component.stage = {
status: {
group: 'running',
icon: 'running',
title: 'running',
},
dropdown_path: 'bar',
dropdown_path: 'bar.json',
};
Vue.nextTick(() => {
......@@ -121,7 +90,7 @@ describe('Pipelines stage component', () => {
setTimeout(() => {
expect(
component.$el.querySelector('.js-builds-dropdown-container ul').textContent.trim(),
).toEqual('this is the updated content');
).toEqual('this is the updated content');
done();
});
});
......
......@@ -50,9 +50,9 @@ stages:
build:
stage: build
image: docker:git
image: docker:stable-git
services:
- docker:dind
- docker:stable-dind
variables:
DOCKER_DRIVER: overlay2
script:
......@@ -76,12 +76,12 @@ test:
- branches
codequality:
image: docker:latest
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:dind
- docker:stable-dind
script:
- setup_docker
- codeclimate
......@@ -90,12 +90,12 @@ codequality:
performance:
stage: performance
image: docker:latest
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:dind
- docker:stable-dind
script:
- setup_docker
- performance
......@@ -109,25 +109,37 @@ performance:
kubernetes: active
sast:
image: docker:latest
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:dind
- docker:stable-dind
script:
- setup_docker
- sast
artifacts:
paths: [gl-sast-report.json]
dependency_scanning:
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- setup_docker
- dependency_scanning
artifacts:
paths: [gl-dependency-scanning-report.json]
sast:container:
image: docker:latest
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:dind
- docker:stable-dind
script:
- setup_docker
- sast_container
......@@ -324,7 +336,6 @@ production:
fi
docker run --env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}" \
--env SAST_DISABLE_REMOTE_CHECKS="${SAST_DISABLE_REMOTE_CHECKS:-false}" \
--volume "$PWD:/code" \
--volume /var/run/docker.sock:/var/run/docker.sock \
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
......@@ -335,6 +346,20 @@ production:
esac
}
function dependency_scanning() {
case "$CI_SERVER_VERSION" in
*-ee)
docker run --env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}" \
--volume "$PWD:/code" \
--volume /var/run/docker.sock:/var/run/docker.sock \
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
;;
*)
echo "GitLab EE is required"
;;
esac
}
function deploy() {
track="${1-stable}"
name="$CI_ENVIRONMENT_SLUG"
......@@ -355,10 +380,16 @@ production:
if [[ "$track" == "stable" ]]; then
# for stable track get number of replicas from `PRODUCTION_REPLICAS`
eval new_replicas=\$${env_slug}_REPLICAS
if [[ -z "$new_replicas" ]]; then
new_replicas=$REPLICAS
fi
service_enabled="true"
else
# for all tracks get number of replicas from `CANARY_PRODUCTION_REPLICAS`
eval new_replicas=\$${env_track}_${env_slug}_REPLICAS
if [[ -z "$new_replicas" ]]; then
eval new_replicas=\${env_track}_REPLICAS
fi
fi
if [[ -n "$new_replicas" ]]; then
replicas="$new_replicas"
......
Markdown is supported
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