Commit da43b546 authored by Arthur Diniz's avatar Arthur Diniz

Adds Docker Hub Image deploy

Signed-off-by: Arthur Diniz's avatarArthur Diniz <arthurbdiniz@gmail.com>
parent d3755262
Pipeline #47377926 passed with stages
in 53 minutes
......@@ -6,12 +6,16 @@ before_script:
- ./script/silent-quick-start
- bundle exec rake db:migrate RAILS_ENV=test
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
stages:
# FIXME Selenium tests are randomly failing and this avoid other tests to run.
- smoke-tests
- all-tests
- code-quality
- push-docker-hub
.cache: &cache
cache:
key: "$CI_BUILD_REF_NAME"
......@@ -60,6 +64,7 @@ cucumber-1:
<<: *cache
script: SLICE=1/2 bundle exec rake cucumber
stage: all-tests
cucumber-2:
<<: *retriable
<<: *cache
......@@ -71,26 +76,31 @@ selenium-1:
<<: *cache
script: SLICE=1/6 bundle exec rake selenium
stage: all-tests
selenium-2:
<<: *retriable
<<: *cache
script: SLICE=2/6 bundle exec rake selenium
stage: all-tests
selenium-3:
<<: *retriable
<<: *cache
script: SLICE=3/6 bundle exec rake selenium
stage: all-tests
selenium-4:
<<: *retriable
<<: *cache
script: SLICE=4/6 bundle exec rake selenium
stage: all-tests
selenium-5:
<<: *retriable
<<: *cache
script: SLICE=5/6 bundle exec rake selenium
stage: all-tests
selenium-6:
<<: *retriable
<<: *cache
......@@ -104,21 +114,25 @@ plugins-1:
<<: *cache
script: SLICE=1/5 bundle exec rake test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
stage: all-tests
plugins-2:
<<: *retriable
<<: *cache
script: SLICE=2/5 bundle exec rake test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
stage: all-tests
plugins-3:
<<: *retriable
<<: *cache
script: SLICE=3/5 bundle exec rake test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
stage: all-tests
plugins-4:
<<: *retriable
<<: *cache
script: SLICE=4/5 bundle exec rake test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
stage: all-tests
plugins-5:
<<: *retriable
<<: *cache
......@@ -134,7 +148,7 @@ cypress:
rubocop:
<<: *cache
script:
- rubocop
- rubocop
stage: code-quality
allow_failure: true
......@@ -150,10 +164,10 @@ code_quality:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
script:
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths:
- gl-code-quality-report.json
......@@ -162,3 +176,17 @@ code_quality:
stage: code-quality
only:
- tags
docker_push:
<<: *retriable
image: docker:latest
stage: push-docker-hub
services:
- docker:dind
before_script:
- echo "${CI_REGISTRY_PASSWORD}" | docker login --username "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
script:
- docker build -f config/docker/prod/Dockerfile -t $IMAGE_TAG .
- docker push $IMAGE_TAG
only:
- tags
\ No newline at end of file
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