Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ansible
docker
Commits
9006639a
Commit
9006639a
authored
7 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
- Added Tox env to import role to Ansible Galaxy.
- Updated Jenkinsfile to use Tox.
parent
0dacdea4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Jenkinsfile
+21
-8
21 additions, 8 deletions
Jenkinsfile
tox.ini
+5
-0
5 additions, 0 deletions
tox.ini
with
26 additions
and
8 deletions
Jenkinsfile
+
21
−
8
View file @
9006639a
/*
Jenkins pipeline for testing an Ansible role.
Required software on the agent:
- Python 2.7.
- Tox.
- Vagrant.
- Virtualbox.
*/
pipeline
{
agent
any
environment
{
VBOX_HWVIRTEX
=
off
}
stages
{
stage
(
'install'
)
{
steps
{
sh
'git submodule update --init'
sh
'virtualenv example'
sh
'. example/bin/activate && pip install -r tests/requirements.txt'
sh
'. example/bin/activate && ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles'
sh
'. example/bin/activate && molecule dependency'
sh
'git submodule update --init --recursive'
}
}
stage
(
'test'
)
{
steps
{
sh
'. example/bin/activate && pre-commit run --all-files'
// sh '. example/bin/activate && molecule test --platform all'
parallel
(
'pre-commit'
:
{
sh
'tox -e pre-commit'
}
'molecule'
:
{
sh
'tox'
}
)
}
}
}
post
{
success
{
sh
'
. example/bin/activate && ansible-galaxy
import
-v
'
sh
'
tox -e
import'
}
}
}
This diff is collapsed.
Click to expand it.
tox.ini
+
5
−
0
View file @
9006639a
...
...
@@ -24,3 +24,8 @@ commands =
sh
-c
"ansible-galaxy
install
git+file://$(pwd),$(git
rev-parse
--abbrev-ref
HEAD)
-p
.molecule/roles"
molecule
dependency
pre-commit
run
--all-files
[testenv:import]
envdir
=
{toxinidir}/.tox/molecule
deps
=
-rtests/requirements.txt
commands
=
ansible-galaxy import -v
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