Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tools
Docker
Ansible
Commits
57e12db4
Commit
57e12db4
authored
Apr 11, 2020
by
Dmitriy Safronov
Browse files
Options
Downloads
Patches
Plain Diff
Build with local docker images. Tests
parent
7af45a29
No related branches found
No related tags found
3 merge requests
!3
Development
,
!2
Development
,
!1
Development
Pipeline
#172
failed
Apr 11, 2020
Stage: build
Stage: test
Stage: release
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+30
-13
30 additions, 13 deletions
.gitlab-ci.yml
with
30 additions
and
13 deletions
.gitlab-ci.yml
+
30
−
13
View file @
57e12db4
...
@@ -7,36 +7,55 @@ variables:
...
@@ -7,36 +7,55 @@ variables:
##########################################################################################################
##########################################################################################################
##
#
PIPELINE DEFINITION
## PIPELINE DEFINITION
stages
:
stages
:
-
build
-
build
-
test
-
release
-
release
##########################################################################################################
##########################################################################################################
### BUILD SECTION
### COMMON SECTION
.common
:
&common
image
:
registry.cyberbrain.pw/docker/docker
services
:
-
registry.cyberbrain.pw/docker/dind
before_script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
##########################################################################################################
#### BUILD SECTION
build
:
build
:
<<
:
*common
stage
:
build
stage
:
build
image
:
docker:latest
services
:
-
docker:dind
variables
:
variables
:
GIT_DEPTH
:
1
GIT_DEPTH
:
1
DIRECTORY
:
'
.'
DIRECTORY
:
'
.'
before_script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script
:
script
:
-
docker build -t "${CI_REGISTRY_IMAGE}:temp-${CI_PIPELINE_IID}" -f "./${DIRECTORY}/Dockerfile" "./${DIRECTORY}"
-
docker build -t "${CI_REGISTRY_IMAGE}:temp-${CI_PIPELINE_IID}" -f "./${DIRECTORY}/Dockerfile" "./${DIRECTORY}"
-
docker push "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID"
-
docker push "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID"
##########################################################################################################
##########################################################################################################
### RELEASE SECTION
#### TEST SECTION
test
:
<<
:
*common
stage
:
test
image
:
"
${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID"
variables
:
GIT_STRATEGY
:
"
none"
GIT_DEPTH
:
0
script
:
-
ansible-lint --version
-
ansible-lint .
##########################################################################################################
#### RELEASE SECTION
release
:
release
:
<<
:
*common
stage
:
release
stage
:
release
image
:
docker:latest
services
:
-
docker:dind
variables
:
variables
:
GIT_STRATEGY
:
"
none"
GIT_STRATEGY
:
"
none"
GIT_DEPTH
:
0
GIT_DEPTH
:
0
...
@@ -44,8 +63,6 @@ release:
...
@@ -44,8 +63,6 @@ release:
-
/^development$/
-
/^development$/
-
/^staging$/
-
/^staging$/
-
/^master$/
-
/^master$/
before_script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script
:
script
:
-
export VERSION_OLD=temp-$CI_PIPELINE_IID
-
export VERSION_OLD=temp-$CI_PIPELINE_IID
-
export VERSION_NEW=$CI_COMMIT_REF_SLUG
-
export VERSION_NEW=$CI_COMMIT_REF_SLUG
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment