diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index c67e288e..c4223755 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -21,6 +21,15 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index f357cb85..522dc88d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,12 +14,14 @@ builds: # Default: Project directory name binary: pingcli - # Custom ldflags. + # Custom environment variables to be set during the builds. + # Invalid environment variables will be ignored. + # For more info refer to: https://pkg.go.dev/cmd/go#hdr-Environment_variables # - # Default: '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser'. + # Default: os.Environ() ++ env config section. # Templates: allowed. - ldflags: - - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + env: + - CGO_ENABLED=0 # GOOS list to build for. # For more info refer to: https://golang.org/doc/install/source#environment @@ -96,8 +98,7 @@ checksum: disable: false brews: - - - # Git author used to commit to the repository. + - # Git author used to commit to the repository. commit_author: name: goreleaserbot email: bot@goreleaser.com @@ -158,3 +159,83 @@ brews: name: homebrew-tap token: "{{ .Env.GORELEASER_HOMEBREW_TAP_GITHUB_PAT}}" + +dockers: + # You can have multiple Docker images. + # Templates of the Docker image names. + # + # Templates: allowed. + - image_templates: + - "pingidentity/pingcli:{{ .Tag }}-amd64" + + # Docker build flags. + # + # Templates: allowed. + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + + # GOARCH of the built binaries/packages that should be used. + # Default: 'amd64'. + goarch: amd64 + + # Set the "backend" for the Docker pipe. + # + # Valid options are: docker, buildx, podman. + # + # Podman is a GoReleaser Pro feature and is only available on Linux. + # + # Default: 'docker'. + use: buildx + + # You can have multiple Docker images. + # Templates of the Docker image names. + # + # Templates: allowed. + - image_templates: + - "pingidentity/pingcli:{{ .Tag }}-arm64" + + # Docker build flags. + # + # Templates: allowed. + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + + # GOARCH of the built binaries/packages that should be used. + # Default: 'amd64'. + goarch: arm64 + + # Set the "backend" for the Docker pipe. + # + # Valid options are: docker, buildx, podman. + # + # Podman is a GoReleaser Pro feature and is only available on Linux. + # + # Default: 'docker'. + use: buildx + +docker_manifests: + # Name for the manifest. + # + # Templates: allowed. + - name_template: "pingidentity/pingcli:latest" + + # Image name to be added to this manifest. + # + # Templates: allowed. + image_templates: + - "pingidentity/pingcli:{{ .Tag }}-amd64" + - "pingidentity/pingcli:{{ .Tag }}-arm64" + + # Name for the manifest. + # + # Templates: allowed. + - name_template: "pingidentity/pingcli:{{ .Tag }}" + + # Image name to be added to this manifest. + # + # Templates: allowed. + image_templates: + - "pingidentity/pingcli:{{ .Tag }}-amd64" + - "pingidentity/pingcli:{{ .Tag }}-arm64" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..6b121499 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Use Alpine as the runtime image +FROM alpine:latest + +# Copy in repo +COPY pingcli /usr/local/bin/ + +# Set permissions for the binary +RUN chmod +x /usr/local/bin/pingcli + +# Set the entry point +ENTRYPOINT ["pingcli"] + +# Allow subcommands +CMD [] \ No newline at end of file diff --git a/README.md b/README.md index f4efc80c..f6da997b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,20 @@ The Ping CLI is a unified command line interface for configuring and managing Pi ## Install +#### Docker + +Use the [Ping CLI Docker image](https://hub.docker.com/r/pingidentity/pingcli) + +```text +Pull Image: +docker pull pingidentity/pingcli:latest + +Example Commands: +docker run + +docker run --version +``` + #### macOS/Linux - Homebrew Use PingIdentity's Homebrew tap to install Ping CLI