hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
612 stars 124 forks source link

Add: build target to Makefile & builder to Dockerfile #214

Open cuppett opened 2 years ago

cuppett commented 2 years ago

Looking at this project and wanted to get started. Hoping these couple adds make it easier for newcomers to build the project, experiment or get more consistent container builds.

donalddewulf commented 2 years ago

Any chance we can get this merged?

estahn commented 2 years ago

@cuppett Thanks for your submission. The only concern would be if this breaks the release process, but I can deal with this down the line. Always good to simplify things.

@donalddewulf Thanks for the nudge. Its being auto-merged once the GitHub action checks are done.

estahn commented 2 years ago

@cuppett Apologies, there was an issue with the CI pipeline not testing the code correctly. I reverted your PR as it breaks the release and image scan actions.

cuppett commented 2 years ago

Sure. What was the issue/error? Anything you want me to resolve?

On Wed, Mar 30, 2022, 7:44 AM Enrico Stahn @.***> wrote:

@cuppett https://github.com/cuppett Apologies, there was an issue with the CI pipeline not testing the code correctly. I reverted your PR as it breaks the release and image scan actions.

— Reply to this email directly, view it on GitHub https://github.com/hipages/php-fpm_exporter/issues/214#issuecomment-1083036581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB2SIEV26OMEL4TLJZD7XTVCQ477ANCNFSM5RD5P5MA . You are receiving this because you were mentioned.Message ID: @.***>

estahn commented 2 years ago

We're using goreleaser for the release process. The CI step uses goreleaser release --rm-dist --snapshot to build an image that can be checked for security vulnerabilities. This step fails with the following error message:

Step 2/17 : WORKDIR /workspace
 ---> Running in ca9433f8ba86
Removing intermediate container ca9433f8ba86
 ---> 3058893f804b
Step 3/17 : COPY go.mod go.mod
COPY failed: file not found in build context or excluded by .dockerignore: stat go.mod: file does not exist

see https://github.com/hipages/php-fpm_exporter/runs/5752709253?check_suite_focus=true

cuppett commented 2 years ago

Oh, I see what's going on. It already has the binaries built (outside the container) and likely removes the go.mod file. Definitely don't want to build it twice. I can leave the Dockerfile changes out of the PR and just have the tiny Makefile change or create a separate Dockerfile.build where the multi-stage build is to not conflict with the original one but still provide the benefit. Opinions?

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 2.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: