Comments (11)
I made it work by specifying an entrypoint:
default:
image:
name: cytopia/ansible-lint:latest
entrypoint: ["/bin/sh", "-c"]
stages:
- lint
ansible-linter:
stage: lint
script:
- ansible-lint *.yaml
only:
- merge_requests
- master
from docker-ansible-lint.
FWIW - gitlab ci only requires an empty entrypoint.
You can just use:
entrypoint: ['']
And it'll work fine.
from docker-ansible-lint.
stages:
- lint
ansible-linter:
image: cytopia/ansible-lint
stage: lint
tags: ['generic']
script:
- echo $PATH
- pwd
- which ansible-lint
- ansible-lint inventories/bootstrap.yml
- ansible-lint inventories/configure.yml
Given the preceding gitlab-ci file, we still get the missing sh
lines:
WARNING: Couldn't open sh - No such file or directory
WARNING: Couldn't open sh - No such file or directory
I looked through the linked issues #17 and #18 but I don't quite see how they relate to this issue?
Could you elaborate on what the fix would be?
from docker-ansible-lint.
Can confirm setting the entrypoint works 👍
from docker-ansible-lint.
@Jamesking56 how does GitLab invoke it? Are you able to see the full run command?
from docker-ansible-lint.
Gitlab checks out the code repository inside a directory in /builds/<namespace>/<project name> and tries to cd into it.
From there it'll try to run the script
block with any elements passed to it
so given this config:
stages:
- lint
ansible-linter:
variables:
CI_DEBUG_TRACE: "true"
image: cytopia/ansible-lint
stage: lint
tags: ['generic']
script:
- ansible-lint inventories/playbook.yml
gitlab starts a docker container, checks out the code as mentioned above, tries to cd to the code directory and that is where it fails.
It never gets to the script block where the ansible-lint command is.
from docker-ansible-lint.
I am adding the option to have it run without any arguments by default (#17)
from docker-ansible-lint.
I have the same issue, running in gitlab too.
from docker-ansible-lint.
Thanks @ndegory Is this also working for @Jamesking56 , @DutchessNicole and @xmariopereira ?
Might also be related: cytopia/docker-yamllint#14
from docker-ansible-lint.
I will add this to the README
from docker-ansible-lint.
Thanks everyone for figuring this out :)
from docker-ansible-lint.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ansible-lint.