...@@ -16,6 +16,9 @@ To have: ...@@ -16,6 +16,9 @@ To have:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/10586) in GitLab 12.4. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/10586) in GitLab 12.4.
CAUTION: **Caution:**
This is a [**beta** feature](https://about.gitlab.com/handbook/product/#beta) and is not ready yet for production use at any scale.
**Secondary** nodes can replicate files stored on the **primary** node regardless of **Secondary** nodes can replicate files stored on the **primary** node regardless of
whether they are stored on the local filesystem or in object storage. whether they are stored on the local filesystem or in object storage.
... ...
......
...@@ -318,6 +318,17 @@ There are also two edge cases worth mentioning: ...@@ -318,6 +318,17 @@ There are also two edge cases worth mentioning:
`test` and `deploy` are allowed to be used as job's stage by default. `test` and `deploy` are allowed to be used as job's stage by default.
1. If a job doesn't specify a `stage`, the job is assigned the `test` stage. 1. If a job doesn't specify a `stage`, the job is assigned the `test` stage.
#### `.pre` and `.post`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/31441) in GitLab 12.4.
The following stages are available to every pipeline:
- `.pre`, which is guaranteed to always be the first stage in a pipeline.
- `.post`, which is guaranteed to always be the last stage in a pipeline.
User-defined stages are executed after `.pre` and before `.post`.
### `stage` ### `stage`
`stage` is defined per-job and relies on [`stages`](#stages) which is defined `stage` is defined per-job and relies on [`stages`](#stages) which is defined
...@@ -330,6 +341,10 @@ stages: ...@@ -330,6 +341,10 @@ stages:
- test - test
- deploy - deploy
job 0:
stage: .pre
script: make something useful before build stage
job 1: job 1:
stage: build stage: build
script: make build dependencies script: make build dependencies
...@@ -345,6 +360,10 @@ job 3: ...@@ -345,6 +360,10 @@ job 3:
job 4: job 4:
stage: deploy stage: deploy
script: make deploy script: make deploy
job 5:
stage: .post
script: make something useful at the end of pipeline
``` ```
#### Using your own Runners #### Using your own Runners
... ...
......
# Cluster Environments **(PREMIUM)** # Cluster Environments **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/13392) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.3. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/13392) for group-level clusters in [GitLab Premium](https://about.gitlab.com/pricing/) 12.3.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/14809) for instance-level clusters in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4.
Cluster environments provide a consolidated view of which CI [environments](../../ci/environments.md) are Cluster environments provide a consolidated view of which CI [environments](../../ci/environments.md) are
deployed to the Kubernetes cluster and it: deployed to the Kubernetes cluster and it:
... ...
......
...@@ -407,6 +407,7 @@ module QA ...@@ -407,6 +407,7 @@ module QA
module DockerRun module DockerRun
autoload :Base, 'qa/service/docker_run/base' autoload :Base, 'qa/service/docker_run/base'
autoload :LDAP, 'qa/service/docker_run/ldap' autoload :LDAP, 'qa/service/docker_run/ldap'
autoload :NodeJs, 'qa/service/docker_run/node_js'
autoload :GitlabRunner, 'qa/service/docker_run/gitlab_runner' autoload :GitlabRunner, 'qa/service/docker_run/gitlab_runner'
end end
end end
... ...
......
# frozen_string_literal: true # frozen_string_literal: true
require 'tmpdir'
module QA module QA
module Runtime module Runtime
module Fixtures module Fixtures
...@@ -18,6 +20,19 @@ module QA ...@@ -18,6 +20,19 @@ module QA
parse_body(response)[:content] parse_body(response)[:content]
end end
def with_fixtures(fixtures)
dir = Dir.mktmpdir
fixtures.each do |file_def|
path = File.join(dir, file_def[:file_path])
FileUtils.mkdir_p(File.dirname(path))
File.write(path, file_def[:content])
end
yield dir
ensure
FileUtils.remove_entry(dir)
end
private private
def api_client def api_client
... ...
......
# frozen_string_literal: true
module QA
module Service
module DockerRun
class NodeJs < Base
def initialize(volume_host_path)
@image = 'node:12.11.1-alpine'
@name = "qa-node-#{SecureRandom.hex(8)}"
@volume_host_path = volume_host_path
super()
end
def publish!
# When we run the tests via gitlab-qa, we use docker-in-docker
# which means that host of a volume mount would be the host that
# started the gitlab-qa QA container (e.g., the CI runner),
# not the gitlab-qa container itself. That means we can't
# mount a volume from the file system inside the gitlab-qa
# container.
#
# Instead, we copy the files into the container.
shell <<~CMD.tr("\n", ' ')
docker run -d --rm
--network #{network}
--hostname #{host_name}
--name #{@name}
--volume #{@volume_host_path}:/home/node
#{@image} sh -c "sleep 60"
CMD
shell "docker cp #{@volume_host_path}/. #{@name}:/home/node"
shell "docker exec -t #{@name} sh -c 'cd /home/node && npm publish'"
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controller do describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Admin::UsersController, '(JavaScript fixtures)', type: :controller do describe Admin::UsersController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Admin::ApplicationSettingsController, '(JavaScript fixtures)', type: :controller do describe Admin::ApplicationSettingsController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller do describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::BranchesController, '(JavaScript fixtures)', type: :controller do describe Projects::BranchesController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::ClustersController, '(JavaScript fixtures)', type: :controller do describe Projects::ClustersController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::CommitController, '(JavaScript fixtures)', type: :controller do describe Projects::CommitController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :controller do describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'Groups (JavaScript fixtures)', type: :controller do describe 'Groups (JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller do describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'Labels (JavaScript fixtures)' do describe 'Labels (JavaScript fixtures)' do
... ...
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :controller do describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :controller do
... ...
......