feat: forked xgettext-go
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
10
Dockerfile
10
Dockerfile
@ -1,15 +1,15 @@
|
||||
FROM golang:1.24-alpine AS build
|
||||
FROM golang:1.25-alpine AS build
|
||||
|
||||
RUN apk add git && \
|
||||
git clone https://github.com/snapcore/snapd/ /tmp/snapd/ && \
|
||||
cd /tmp/snapd/i18n/xgettext-go && \
|
||||
git clone https://git.coopcloud.tech/toolshed/xgettext-go /tmp/xgettext-go && \
|
||||
cd /tmp/xgettext-go && \
|
||||
go build
|
||||
|
||||
FROM golang:1.24-alpine
|
||||
FROM golang:1.25-alpine
|
||||
|
||||
WORKDIR /drone/src
|
||||
|
||||
COPY --from=build /tmp/snapd/i18n/xgettext-go/xgettext-go /bin/xgettext-go
|
||||
COPY --from=build /tmp/xgettext-go/xgettext-go /bin/xgettext-go
|
||||
COPY plugin.sh /plugin/plugin.sh
|
||||
|
||||
ENTRYPOINT ["/plugin/plugin.sh"]
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
[](https://build.coopcloud.tech/toolshed/drone-xgettext-go)
|
||||
|
||||
Use `xgettext-go` as a Drone plugin.
|
||||
Use the forked [`xgettext-go`](https://git.coopcloud.tech/toolshed/xgettext-go) as a Drone plugin.
|
||||
|
||||
!!! warning "Caution!"
|
||||
This is currently configured very specifically for use with Co-op Cloud abra. More customisability Coming Soon™, see #1
|
||||
@ -14,6 +14,7 @@ Use `xgettext-go` as a Drone plugin.
|
||||
- **in**: (default: `/drone/src`) The source directory to scan for source files
|
||||
- **out:** (default: `/drone/src/locales/default.pot`) The target directory in which to create a `pot` file.
|
||||
- **keyword:** (default: `gotext.Get`) The keyword to search for translatable strings.
|
||||
- **keyword-ctx:** (default: `gotext.GetC`) The keyword to search for translatable strings with context.
|
||||
- **comments_tag**: (default: disabled) "place comment blocks starting with TAG and prceding keyword lines in output file"
|
||||
|
||||
## Example
|
||||
|
@ -5,6 +5,7 @@ set -ex
|
||||
PLUGIN_IN=${PLUGIN_IN:-/drone/src/}
|
||||
PLUGIN_OUT=${PLUGIN_OUT:-/drone/src/locales/default.pot}
|
||||
PLUGIN_KEYWORD=${PLUGIN_KEYWORD:-gotext.Get}
|
||||
PLUGIN_KEYWORD_CTX=${PLUGIN_KEYWORD_CTX:-gotext.GetC}
|
||||
|
||||
run_xgettext_cmd() {
|
||||
echo "--- start command ---"
|
||||
@ -15,6 +16,7 @@ run_xgettext_cmd() {
|
||||
xgettext-go \
|
||||
-o "$PLUGIN_OUT" \
|
||||
--keyword="$PLUGIN_KEYWORD" \
|
||||
--keyword-ctx="$PLUGIN_KEYWORD_CTX" \
|
||||
--sort-output \
|
||||
${PLUGIN_COMMENTS_TAG:+--add-comments-tag=}${PLUGIN_COMMENTS_TAG}\
|
||||
$(find . -name "*.go" -not -path '*vendor*' | sort)
|
||||
|
Reference in New Issue
Block a user