Skip to content

Commit

Permalink
feat: change the CLI tool name to publiccode-parser (#156)
Browse files Browse the repository at this point in the history
Fix #124.
  • Loading branch information
bfabio committed Nov 11, 2023
1 parent dc3e449 commit 838cf7b
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pcvalidate/pcvalidate
publiccode-parser/publiccode-parser
.vscode
.history
.DS_Store
8 changes: 4 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ before:
- go generate ./...
builds:
-
id: pcvalidate
binary: pcvalidate
main: ./pcvalidate/pcvalidate.go
id: publiccode-parser
binary: publiccode-parser
main: ./publiccode-parser/publiccode_parser.go
ldflags:
- -s -w -X main.version={{.Version}} -X main.date={{.Date}}
env:
Expand Down Expand Up @@ -46,7 +46,7 @@ dockers:
goos: linux
goarch: amd64
ids:
- pcvalidate
- publiccode-parser
skip_push: false
dockerfile: Dockerfile.goreleaser
image_templates:
Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
#

# Accept the Go version for the image to be set as a build argument.
ARG GO_VERSION=1.16-alpine
ARG GO_VERSION=1.18-alpine

FROM golang:${GO_VERSION} as build
FROM docker.io/golang:${GO_VERSION} as build

WORKDIR /go/src

COPY . .

RUN cd pcvalidate && \
go build -ldflags="-s -w" pcvalidate.go
RUN cd publiccode-parser && go build -ldflags="-s -w"

FROM alpine:3
FROM docker.io/alpine:3

COPY --from=build /go/src/pcvalidate/pcvalidate /usr/local/bin/pcvalidate
COPY --from=build /go/src/publiccode-parser/publiccode-parser /usr/local/bin/publiccode-parser

ENTRYPOINT ["/usr/local/bin/pcvalidate"]
# Keep the old name for backward compatibility
RUN ln -s /usr/local/bin/publiccode-parser /usr/local/bin/pcvalidate

ENTRYPOINT ["/usr/local/bin/publiccode-parser"]
CMD ["files/publiccode.yml"]
5 changes: 3 additions & 2 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#
FROM alpine:3

COPY pcvalidate /usr/local/bin/pcvalidate
COPY publiccode-parser /usr/local/bin/publiccode-parser
RUN ln -s /usr/local/bin/publiccode-parser /usr/local/bin/pcvalidate

# git and openssh-client are needed by CircleCI when using
# publiccode-parser-orb, which uses this image.
RUN apk --no-cache add git openssh-client

ENTRYPOINT ["/usr/local/bin/pcvalidate"]
ENTRYPOINT ["/usr/local/bin/publiccode-parser"]
CMD ["files/publiccode.yml"]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ publiccode := parser.PublicCode

## Validation from command line

This repository also contains `pcvalidate` which can be used for validating a
`publiccode.yml` from the command line.
The `publiccode-parser` binary which be used for validating a `publiccode.yml`
from the command line.

To get the latest development version use:

```shell
go install github.com/italia/publiccode-parser-go/v3/pcvalidate@latest
pcvalidate mypubliccode.yml
go install github.com/italia/publiccode-parser-go/v3/publiccode-parser@latest
publiccode-parser mypubliccode.yml
```

To get the latest stable version go to the [release page](https://github.com/italia/publiccode-parser-go/releases/latest)
and grab the one for your arch.

Run `pcvalidate --help` for the available command line flags.
Run `publiccode-parser --help` for the available command line flags.

The tool returns 0 in case of successful validation, 1 otherwise.

Expand Down
1 change: 1 addition & 0 deletions pcvalidate
File renamed without changes.
File renamed without changes.

0 comments on commit 838cf7b

Please sign in to comment.