Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuilt Docker images not reading configuration correctly #55

Open
georgearnall opened this issue Jan 31, 2021 · 1 comment
Open

Prebuilt Docker images not reading configuration correctly #55

georgearnall opened this issue Jan 31, 2021 · 1 comment

Comments

@georgearnall
Copy link

georgearnall commented Jan 31, 2021

Does this project still work?
Edit: I tried running the repo using npm run start and this works as expected. I think the docker image is old. I rebuilt it without docker and it appears to run fine.

# Installs docker
# RUN apk add --update --no-cache docker py-pip
# RUN apk add bash bash-doc bash-completion
# RUN pip install docker-compose

Does the docker container still work ?
I tried to run it on docker using my own script and it didn't work. I tried cloning the repo and using docker-compose and that didn't work either.

Payload:

{
  "push_data": {},
  "repository": {
    "repo_name": "maccyber/tagtest:prod"
  }
}

Response:

maccyber/tagtest:prod does not exist in scripts/index.js

Configuration:

const scripts = {
  'maccyber/testhook': 'hello.sh parameter1 parameter2',
  'maccyber/maccyber.io': 'maccyber.io.sh',
  'maccyber/tagtest:prod': 'tag.sh', // repo/image:tag
  'maccyber/fail': 'fail.sh',
  'anshkathuria/tagtest:release-[0-9.]+': 'tag.sh'
}

module.exports = (repoName, tag) => {
  const hook = Object.keys(scripts)
    .find(key => {
      const regex = new RegExp(`^${key}$`, 'gm')
      const image = tag ? `${repoName}:${tag}` : repoName
      const match = image.match(regex)

      return match && match[0] === image
    })

  return scripts[hook]
}
@georgearnall
Copy link
Author

georgearnall commented Jan 31, 2021

I forked your repo and fixed the issue, I'm not 100% sure what was causing it but after I rebuilt the image it started working as expected. I upgraded to the latest version of node and fixed an issue with spaces in the paths.

https://github.com/georgearnall/micro-dockerhub-hook

I'm going to use my image for now but I might submit a pull request if you're happy with the fixes. All the tests still pass.

I also fixed this issue: https://travis-ci.org/github/maccyber/micro-dockerhub-hook/builds/753184709

@georgearnall georgearnall changed the title Does this project still work ? maccyber/tagtest:prod does not exist in scripts/index.js Docker images not reading configuration correctly Jan 31, 2021
@georgearnall georgearnall changed the title Docker images not reading configuration correctly Prebuilt Docker images not reading configuration correctly Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant