0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-11-21 23:50:40 +00:00

Merge pull request #27 from drone-plugins/python3-upgrade

Upgrade to python3
This commit is contained in:
Thomas Boerger 2019-09-12 08:01:13 +02:00 committed by GitHub
commit 9b66664807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 15 deletions

View File

@ -5,10 +5,10 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
RUN apk add --no-cache bash git curl rsync openssh-client py-pip py-requests python2-dev libffi-dev libressl-dev libressl build-base && \
pip install -U pip && \
pip install ansible==2.8.2 && \
apk del python2-dev libffi-dev libressl-dev build-base
RUN apk add --no-cache bash git curl rsync openssh-client py3-pip py3-requests python3-dev libffi-dev libressl-dev libressl build-base && \
pip3 install -U pip && \
pip3 install ansible==2.8.4 && \
apk del python3-dev libffi-dev libressl-dev build-base
ADD release/linux/amd64/drone-ansible /bin/
ENTRYPOINT ["/bin/drone-ansible"]

View File

@ -5,10 +5,10 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
RUN apk add --no-cache bash git curl rsync openssh-client py-pip py-requests python2-dev libffi-dev libressl-dev libressl build-base && \
pip install -U pip && \
pip install ansible==2.8.2 && \
apk del python2-dev libffi-dev libressl-dev build-base
RUN apk add --no-cache bash git curl rsync openssh-client py3-pip py3-requests python3-dev libffi-dev libressl-dev libressl build-base && \
pip3 install -U pip && \
pip3 install ansible==2.8.4 && \
apk del python3-dev libffi-dev libressl-dev build-base
ADD release/linux/arm/drone-ansible /bin/
ENTRYPOINT ["/bin/drone-ansible"]

View File

@ -5,10 +5,10 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
RUN apk add --no-cache bash git curl rsync openssh-client py-pip py-requests python2-dev libffi-dev libressl-dev libressl build-base && \
pip install -U pip && \
pip install ansible==2.8.2 && \
apk del python2-dev libffi-dev libressl-dev build-base
RUN apk add --no-cache bash git curl rsync openssh-client py3-pip py3-requests python3-dev libffi-dev libressl-dev libressl build-base && \
pip3 install -U pip && \
pip3 install ansible==2.8.4 && \
apk del python3-dev libffi-dev libressl-dev build-base
ADD release/linux/arm64/drone-ansible /bin/
ENTRYPOINT ["/bin/drone-ansible"]

View File

@ -173,20 +173,25 @@ func (p *Plugin) vaultPass() error {
}
func (p *Plugin) playbooks() error {
var playbooks []string
var (
playbooks []string
)
for _, p := range p.Config.Playbooks {
files, err := filepath.Glob(p)
// can there be a invalid glob pattern that still is a valid file name?
// just add it back to the list and let ansible return error out instead.
if err != nil {
playbooks = append(playbooks, p)
continue
}
playbooks = append(playbooks, files...)
}
if len(playbooks) == 0 {
return errors.New("failed to find playbook files")
}
p.Config.Playbooks = playbooks
return nil
}