- Add missing .PHONY targets to the Makefile for better build reliability
- Ensure HTTP response bodies are always read and closed in Jenkins post requests
- Replace custom response parsing with direct JSON unmarshalling in Jenkins post
- Set a default value for the Version variable
- Move ASCII art to a constant and reuse for CLI help template
- Improve dotenv loading error handling and logging in main
- Update repository link in CLI help output
- Add validation for required CLI parameters and authentication in run function
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add support for passing a remote trigger token to Jenkins jobs
- Update the Jenkins constructor to accept a token parameter
- Ensure the token is included as a query parameter when triggering jobs
- Improve error reporting by including response body in error messages
- Remove unnecessary logging and refactor build parameter logic
- Update tests to use the new Jenkins constructor and token handling
- Add CLI option for specifying a remote trigger token
- Extend plugin configuration to support remote token injection
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add a dedicated drone user and group for running the container
- Change file ownership of the drone-jenkins binary to the drone user
- Switch container execution to use the drone user instead of root
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
When triggering a Jenkins job, Jenkins API call returns 200 OK but drone-jenkins expects 201. So, the trigger succeeded but drone-jenkins returns false negative.
- Remove formatting and vetting targets from the Makefile
- Upgrade urfave/cli dependency from v1 to v2
- Update CLI flag definitions to use urfave/cli/v2 API, including new struct field names and flag aliasing
- Add indirect dependency on github.com/xrash/smetrics
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add context support to HTTP POST requests for improved cancellation and timeout handling
- Fix formatting of usage and commands help text in the CLI output
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update GitHub Actions to use newer versions for setup-go, checkout, golangci-lint, and codecov
- Change Go version specification to use "stable" and update test matrix to only "1.25"
- Rename the test job to testing
- Adjust hadolint to use a newer version and reference the Dockerfile at the root
- Modify go test command to enable race detection and test all packages
- Add a new Trivy security scan workflow for vulnerability, secret, and misconfiguration checks, including SARIF upload and log output
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add golangci-lint configuration with a custom set of enabled linters and formatters
- Exclude generated files and specific directories from linting and formatting
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Fix formatting of platform list in the README
- Update Docker base image from alpine:3.20 to alpine:3.22
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Rename `parameter` to `parameters` in CLI flags and environment variables
- Update function calls to use `parameters` instead of `parameter`
- Change struct field `Parameter` to `Parameters`
- Modify loop variable to iterate over `Parameters` instead of `Parameter`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add logging for URL path in the `trigger` function
- Remove commented-out form data encoding line
- Import the `log` package
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Comment out unused form data encoding in `post` method
- Remove redundant error logging in `post` method
- Add conditional URL path selection in `trigger` method based on parameters
- Add `parameter` flag to CLI options in `main.go`
- Include `parameter` in the `run` function configuration
- Import `net/url` package in `plugin.go`
- Add `Parameter` field to `plugin.go` struct
- Parse and add parameters to URL values in `Exec` method
- Pass parsed parameters to `trigger` method in `Exec` function
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add error handling for unexpected response codes in `post` method of `jenkins.go`
- Import `log` package in `plugin.go`
- Add logging for successful job trigger in `Exec` method of `plugin.go`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add `crypto/tls` import in `jenkins.go`
- Add `Client` field to `Jenkins` struct
- Modify `NewJenkins` function to accept an `insecure` parameter and configure HTTP client accordingly
- Update `sendRequest` method to use the `Client` field from the `Jenkins` struct
- Update tests in `jenkins_test.go` to include the `insecure` parameter in `NewJenkins` calls
- Add `insecure` flag to CLI options in `main.go`
- Add `Insecure` field to `Plugin` struct
- Update `Plugin.Exec` method to pass `Insecure` field to `NewJenkins`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add lint and testing badge to the README
- Remove build status badge from the README
- Remove Docker pulls badge from the README
- Remove microbadger badge from the README
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Replace `ioutil.ReadAll` with `io.ReadAll` in `jenkins.go`
- Ignore the return value of `godotenv.Load` in `main.go`
- Ignore the return value of `godotenv.Overload` in `main.go`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove Go 1.21 from the lint workflow
- Update Go version to 1.22 in go.mod
- Upgrade dependencies: `godotenv` to v1.5.1, `testify` to v1.9.0, `cli` to v1.22.15
- Add new indirect dependencies: `go-md2man/v2`, `go-spew`, `go-difflib`, `blackfriday/v2`, `yaml.v3`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Reorder imports in `jenkins_test.go` and `plugin_test.go` to move `assert` import to the end
- Remove unnecessary empty line in `plugin.go`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Change `GOFMT` tool from `gofmt` to `gofumpt`
- Remove DockerHub deployment configurations
- Add detection and setup for Go environment variables
- Add conditional flags and executable naming based on OS
- Update `fmt` and `fmt-check` targets to use `gofumpt`
- Remove `lint`, `misspell-check`, and `misspell` targets
- Update `test` target to remove dependency on `fmt-check`
- Change `install` and `build` targets to use `GOFILES` instead of `SOURCES`
- Update `$(EXECUTABLE)` target to output to `bin/`
- Remove various `release` and `docker` related targets
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Rename `testing` job to `test`
- Add matrix strategy to run tests on multiple OS and Go versions
- Replace `actions/checkout@v4` with `actions/setup-go@v5` for setting up Go
- Add caching for Go build and module files using `actions/cache@v4`
- Change test command from `make test` to `go test -v -covermode=atomic -coverprofile=coverage.out`
- Add flags to `codecov/codecov-action@v4` for OS and Go version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a new Dockerfile for multi-architecture support using Alpine 3.20
- Remove Dockerfile for linux.amd64
- Remove Dockerfile for linux.arm
- Remove Dockerfile for linux.arm64
- Remove Dockerfile for windows
- Remove Docker manifest template file
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add funding configuration file with multiple supported platforms
- Add Dependabot configuration for GitHub Actions and Go modules with weekly updates
- Add CodeQL analysis workflow for Go language
- Add Docker image build and push workflow for multiple platforms
- Add GoReleaser workflow for automated releases on tag push
- Add linting and testing workflow with Go setup, Dockerfile linting, and Codecov integration
Signed-off-by: appleboy <appleboy.tw@gmail.com>