Commit ae25e009 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-10-09

parents 1bb8dc76 cf7aea84
......@@ -502,6 +502,7 @@ export default {
v-if="!model.isFolder"
class="environment-name table-mobile-content">
<a
class="qa-environment-link"
:href="environmentPath"
>
{{ model.name }}
......
......@@ -216,7 +216,7 @@
= _('Metrics')
= nav_link(controller: :environments, action: [:index, :folder, :show, :new, :edit, :create, :update, :stop, :terminal]) do
= link_to project_environments_path(@project), title: _('Environments'), class: 'shortcuts-environments' do
= link_to project_environments_path(@project), title: _('Environments'), class: 'shortcuts-environments qa-operations-environments-link' do
%span
= _('Environments')
......
- if environment.external_url && can?(current_user, :read_environment, environment)
= link_to environment.external_url, target: '_blank', rel: 'noopener noreferrer', class: 'btn external-url has-tooltip', title: s_('Environments|Open live environment') do
= link_to environment.external_url, target: '_blank', rel: 'noopener noreferrer', class: 'btn external-url has-tooltip qa-view-deployment', title: s_('Environments|Open live environment') do
= sprite_icon('external-link')
View deployment
# GitHub import
>**Note:**
>
> - [Introduced][ce-10308] in GitLab 9.1.
> - You need a personal access token in order to retrieve and import GitHub
> projects. You can get it from: https://github.com/settings/tokens
> - You also need to pass an username as the second argument to the rake task
> which will become the owner of the project.
> - You can also resume an import with the same command.
> [Introduced]( https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10308) in GitLab 9.1.
In order to retrieve and import GitHub repositories, you will need a
[GitHub personal access token](https://github.com/settings/tokens).
A username should be passed as the second argument to the rake task
which will become the owner of the project. You can resume an import
with the same command.
Bear in mind that the syntax is very specific. Remove any spaces within the argument block and
before/after the brackets. Also, Some shells (e.g., zsh) can interpret the open/close brackets
(`[]`) separately. You may need to either escape the brackets or use double quotes.
## Importing multiple projects
To import a project from the list of your GitHub projects available:
```bash
# Omnibus installations
sudo gitlab-rake import:github[access_token,root,foo/bar]
sudo gitlab-rake "import:github[access_token,root,foo/bar]"
# Installations from source
bundle exec rake import:github[access_token,root,foo/bar] RAILS_ENV=production
bundle exec rake "import:github[access_token,root,foo/bar]" RAILS_ENV=production
```
In this case, `access_token` is your GitHub personal access token, `root`
is your GitLab username, and `foo/bar` is the new GitLab namespace/project that
will get created from your GitHub project. Subgroups are also possible: `foo/foo/bar`.
## Importing a single project
To import a specific GitHub project (named `foo/github_repo` here):
```bash
# Omnibus installations
sudo gitlab-rake import:github[access_token,root,foo/bar,foo/github_repo]
sudo gitlab-rake "import:github[access_token,root,foo/bar,foo/github_repo]"
# Installations from source
bundle exec rake import:github[access_token,root,foo/bar,foo/github_repo] RAILS_ENV=production
bundle exec rake "import:github[access_token,root,foo/bar,foo/github_repo]" RAILS_ENV=production
```
[ce-10308]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10308
......@@ -97,7 +97,10 @@ POST /projects/:id/repository/files/:file_path
```
```bash
curl --request POST --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fprojectrb%2E?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20content&commit_message=create%20a%20new%20file'
curl --request POST --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' --header "Content-Type: application/json" \
--data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
"content": "some content", "commit_message": "create a new file"}' \
'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb'
```
Example response:
......@@ -129,7 +132,10 @@ PUT /projects/:id/repository/files/:file_path
```
```bash
curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file'
curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' --header "Content-Type: application/json" \
--data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
"content": "some content", "commit_message": "update file"}' \
'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb'
```
Example response:
......@@ -171,7 +177,10 @@ DELETE /projects/:id/repository/files/:file_path
```
```bash
curl --request DELETE --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&commit_message=delete%20file'
curl --request DELETE --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' --header "Content-Type: application/json" \
--data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
"commit_message": "delete file"}' \
'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb'
```
Parameters:
......
......@@ -201,6 +201,11 @@ module QA
end
module Operations
module Environments
autoload :Index, 'qa/page/project/operations/environments/index'
autoload :Show, 'qa/page/project/operations/environments/show'
end
module Kubernetes
autoload :Index, 'qa/page/project/operations/kubernetes/index'
autoload :Add, 'qa/page/project/operations/kubernetes/add'
......
......@@ -9,6 +9,7 @@ module QA
element :link_pipelines
element :pipelines_settings_link, "title: _('CI / CD')"
element :operations_kubernetes_link, "title: _('Kubernetes')"
element :operations_environments_link
element :issues_link, /link_to.*shortcuts-issues/
element :issues_link_text, "Issues"
element :merge_requests_link, /link_to.*shortcuts-merge_requests/
......@@ -40,6 +41,14 @@ module QA
end
end
def click_operations_environments
hover_operations do
within_submenu do
click_element(:operations_environments_link)
end
end
end
def click_operations_kubernetes
hover_operations do
within_submenu do
......
# frozen_string_literal: true
module QA
module Page
module Project
module Operations
module Environments
class Index < Page::Base
view 'app/assets/javascripts/environments/components/environment_item.vue' do
element :environment_link
end
def go_to_environment(environment_name)
wait(reload: false) do
find(element_selector_css(:environment_link), text: environment_name).click
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module Page
module Project
module Operations
module Environments
class Show < Page::Base
view 'app/views/projects/environments/_external_url.html.haml' do
element :view_deployment
end
def view_deployment(&block)
new_window = window_opened_by { click_element(:view_deployment) }
within_window(new_window, &block) if block
end
end
end
end
end
end
end
......@@ -65,6 +65,16 @@ module QA
expect(pipeline).to have_build('test', status: :success, wait: 600)
expect(pipeline).to have_build('production', status: :success, wait: 1200)
end
Page::Menu::Side.act { click_operations_environments }
Page::Project::Operations::Environments::Index.perform do |index|
index.go_to_environment('production')
end
Page::Project::Operations::Environments::Show.perform do |show|
show.view_deployment do
expect(page).to have_content('Hello World!')
end
end
end
end
end
......
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