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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tools
Docker
Ansible
Commits
3499e8c1
Commit
3499e8c1
authored
5 years ago
by
Dmitriy Safronov
Browse files
Options
Downloads
Patches
Plain Diff
New CI
parent
fd44c5be
No related branches found
No related tags found
No related merge requests found
Pipeline
#278
failed
5 years ago
Stage: check
Stage: build
Stage: test
Stage: release
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+18
-9
18 additions, 9 deletions
.gitlab-ci.yml
Dockerfile
+0
-1
0 additions, 1 deletion
Dockerfile
with
18 additions
and
10 deletions
.gitlab-ci.yml
+
18
−
9
View file @
3499e8c1
...
...
@@ -9,6 +9,7 @@ variables:
## PIPELINE DEFINITION
stages
:
-
check
-
build
-
test
-
release
...
...
@@ -22,6 +23,18 @@ stages:
-
registry.cyberbrain.pw/docker/dind
before_script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
-
alias drr="docker run --rm -v \${PWD}:\${PWD} -w \${PWD}"
##########################################################################################################
#### CHECK SECTION
check
:
<<
:
*common
stage
:
check
variables
:
GIT_DEPTH
:
1
script
:
-
drr registry.cyberbrain.pw/tools/hadolint:latest hadolint --ignore DL3007 Dockerfile
##########################################################################################################
...
...
@@ -31,10 +44,9 @@ build:
stage
:
build
variables
:
GIT_DEPTH
:
1
DIRECTORY
:
'
.'
script
:
-
docker pull "${CI_REGISTRY_IMAGE}:latest" ||
true
-
docker build --cache-from "${CI_REGISTRY_IMAGE}:latest" -t "${CI_REGISTRY_IMAGE}:temp-${CI_PIPELINE_IID}" -f
"
./
${DIRECTORY}/Dockerfile" "./${DIRECTORY}"
-
docker build --cache-from "${CI_REGISTRY_IMAGE}:latest" -t "${CI_REGISTRY_IMAGE}:temp-${CI_PIPELINE_IID}" -f ./
Dockerfile .
-
docker push "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID"
##########################################################################################################
...
...
@@ -45,13 +57,11 @@ test:
stage
:
test
variables
:
GIT_STRATEGY
:
"
none"
GIT_DEPTH
:
0
script
:
-
docker pull "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID"
-
docker run --rm "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible --version
-
docker run --rm "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible -m ping localhost
-
docker run --rm "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible-lint --version
-
docker run --rm "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible-lint .
-
drr "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible --version
-
drr "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible -m ping localhost
-
drr "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible-lint --version
-
drr "${CI_REGISTRY_IMAGE}:temp-$CI_PIPELINE_IID" ansible-lint .
##########################################################################################################
...
...
@@ -61,7 +71,6 @@ release:
stage
:
release
variables
:
GIT_STRATEGY
:
"
none"
GIT_DEPTH
:
0
only
:
-
/^development$/
-
/^staging$/
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
0
−
1
View file @
3499e8c1
FROM
pipelinecomponents/ansible-lint
MAINTAINER
Dmitriy Safronov <zimniy@cyberbrain.pw>
ENV
LANG C.UTF-8
ARG
DEPENDENCIES_RUNTIME="git openssh-client"
...
...
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