Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.7] Use the new Transifex client #9913

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
!Pipfile
!Pipfile.lock
!checks.mk
!ci/applications.yaml
!ci/applications-versions.yaml
!dependencies.mk
!build.mk
!commons
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:

- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt
- run: |
python3 -m venv /tmp/venv
/tmp/venv/bin/pip install c2cciutils==1.3.dev20220704113927
/tmp/venv/bin/c2cciutils-download-applications --applications-file=ci/applications.yaml \
--versions-file=ci/applications-versions.yaml

- name: Checks
run: c2cciutils-checks
Expand Down
25 changes: 25 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[main]
host = https://www.transifex.com

[o:camptocamp:p:geomapfish:r:c2cgeoportal_geoportal]
type = PO
source_file = geoportal/c2cgeoportal_geoportal/locale/c2cgeoportal_geoportal.pot
file_filter = geoportal/c2cgeoportal_geoportal/locale/<lang>/LC_MESSAGES/c2cgeoportal_geoportal.po

[o:camptocamp:p:geomapfish:r:c2cgeoportal_admin]
type = PO
source_file = admin/c2cgeoportal_admin/locale/c2cgeoportal_admin.pot
file_filter = admin/c2cgeoportal_admin/locale/<lang>/LC_MESSAGES/c2cgeoportal_admin.po

[o:camptocamp:p:ngeo:r:gmf-apps]
type = PO
file_filter = geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/{{cookiecutter.package}}_geoportal/locale/<lang>/LC_MESSAGES/{{cookiecutter.package}}_geoportal-client.po

[o:camptocamp:p:ngeo:r:ngeo]
type = PO
file_filter = geoportal/c2cgeoportal_geoportal/locale/<lang>/LC_MESSAGES/ngeo.po

[o:camptocamp:p:ngeo:r:webcomponent]
source_lang = en
type = KEYVALUEJSON
file_filter = geoportal/c2cgeoportal_geoportal/static/locales/<lang>.json
39 changes: 0 additions & 39 deletions .tx/config.mako

This file was deleted.

10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ RUN \
pipenv sync --system --clear --dev && \
rm --recursive --force /tmp/* /root/.cache/*

ENV PATH=/root/.local/bin/:${PATH}

WORKDIR /opt/c2cgeoportal
COPY ci/applications*.yaml ./
RUN \
python3 -m venv venv && \
venv/bin/pip install c2cciutils==1.3.dev20220704113927 && \
venv/bin/c2cciutils-download-applications --applications-file=applications.yaml --versions-file=applications-versions.yaml && \
rm -rf venv

COPY bin/npm-packages /usr/bin/
COPY geoportal/package.json /opt/c2cgeoportal/geoportal/
WORKDIR /opt/c2cgeoportal/geoportal
Expand Down
36 changes: 0 additions & 36 deletions bin/transifex-init

This file was deleted.

2 changes: 2 additions & 0 deletions ci/applications-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://docs.renovatebot.com/modules/datasource/#github-releases-datasource
transifex/cli: v1.2.0 # github-releases
13 changes: 13 additions & 0 deletions ci/applications.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/c2cciutils/master/c2cciutils/schema-applications.json

transifex/cli:
type: tar
get-file-name: tx-linux-amd64.tar.gz
tar-file-name: tx
to-file-name: tx
finish-commands:
- - chmod
- +x
- tx
- - tx
- --version
21 changes: 10 additions & 11 deletions dependencies.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export TX_VERSION = $(shell echo $(MAJOR_VERSION) | awk -F . '{{print $$1"_"$$2}}')
TX_DEPENDENCIES = $(HOME)/.transifexrc .tx/config

LANGUAGES = fr de it
Expand Down Expand Up @@ -29,17 +28,17 @@ dependencies: $(TRANSIFEX_PO_FILES)
$(HOME)/.transifexrc:
mkdir --parent $(dir $@)
echo "[https://www.transifex.com]" > $@
echo "api_hostname = https://api.transifex.com" >> $@
echo "rest_hostname = https://rest.api.transifex.com" >> $@
echo "hostname = https://www.transifex.com" >> $@
echo "username = c2c" >> $@
echo "password = c2cc2c" >> $@
echo "token =" >> $@
echo "token = 1/dc02578696187cc29e4e6486f8611fdbfe60b235" >> $@

.PHONY: transifex-send
transifex-send: $(TX_DEPENDENCIES) \
geoportal/c2cgeoportal_geoportal/locale/c2cgeoportal_geoportal.pot \
admin/c2cgeoportal_admin/locale/c2cgeoportal_admin.pot
tx push --source --resource=geomapfish.c2cgeoportal_geoportal-$(TX_VERSION)
tx push --source --resource=geomapfish.c2cgeoportal_admin-$(TX_VERSION)
tx push --branch=$(MAJOR_VERSION) --source --resources=geomapfish.c2cgeoportal_geoportal
tx push --branch=$(MAJOR_VERSION) --source --resources=geomapfish.c2cgeoportal_admin

geoportal/c2cgeoportal_geoportal/locale/en/LC_MESSAGES/c2cgeoportal_geoportal.po: geoportal/c2cgeoportal_geoportal/locale/c2cgeoportal_geoportal.pot
mkdir --parent $(dir $@)
Expand All @@ -53,35 +52,35 @@ admin/c2cgeoportal_admin/locale/en/LC_MESSAGES/c2cgeoportal_admin.po: admin/c2cg

geoportal/c2cgeoportal_geoportal/locale/%/LC_MESSAGES/c2cgeoportal_geoportal.po: $(TX_DEPENDENCIES)
mkdir --parent $(dir $@)
tx pull --language $* --resource geomapfish.c2cgeoportal_geoportal-$(TX_VERSION) --force
tx pull --branch=$(MAJOR_VERSION) --languages=$* --resources=geomapfish.c2cgeoportal_geoportal --force
sed -i 's/[[:space:]]\+$$//' $@
test -s $@

.PRECIOUS: geoportal/c2cgeoportal_geoportal/locale/%/LC_MESSAGES/ngeo.po
geoportal/c2cgeoportal_geoportal/locale/%/LC_MESSAGES/ngeo.po: $(TX_DEPENDENCIES)
mkdir --parent $(dir $@)
tx pull --language $* --resource ngeo.ngeo-$(TX_VERSION) --force
tx pull --branch=$(MAJOR_VERSION) --languages=$* --resources=ngeo.ngeo --force
sed -i 's/[[:space:]]\+$$//' $@
test -s $@

admin/c2cgeoportal_admin/locale/%/LC_MESSAGES/c2cgeoportal_admin.po: $(TX_DEPENDENCIES)
mkdir --parent $(dir $@)
tx pull --language $* --resource geomapfish.c2cgeoportal_admin-$(TX_VERSION) --force
tx pull --branch=$(MAJOR_VERSION) --languages=$* --resources=geomapfish.c2cgeoportal_admin --force
sed -i 's/[[:space:]]\+$$//' $@
test -s $@

.PRECIOUS: geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/{{cookiecutter.package}}_geoportal/locale/%/LC_MESSAGES/{{cookiecutter.package}}_geoportal-client.po
geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/{{cookiecutter.package}}_geoportal/locale/%/LC_MESSAGES/{{cookiecutter.package}}_geoportal-client.po: \
$(TX_DEPENDENCIES)
mkdir --parent $(dir $@)
tx pull --language $* --resource ngeo.gmf-apps-$(TX_VERSION) --force
tx pull --branch=$(MAJOR_VERSION) --languages=$* --resources=ngeo.gmf-apps --force
sed -i 's/[[:space:]]\+$$//' $@
test -s $@

.PRECIOUS: geoportal/c2cgeoportal_geoportal/static/locales/%.json
geoportal/c2cgeoportal_geoportal/static/locales/%.json: $(TX_DEPENDENCIES)
mkdir --parent $(dir $@)
tx pull --language $* --resource ngeo.webcomponent-$(TX_VERSION) --force
tx pull --branch=$(MAJOR_VERSION) --languages=$* --resources=ngeo.webcomponent --force
touch $@

geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/{{cookiecutter.package}}_geoportal/locale/en/LC_MESSAGES/{{cookiecutter.package}}_geoportal-client.po:
Expand Down
14 changes: 7 additions & 7 deletions doc/developer/build_release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Create a new release
Vocabulary
----------

On this page, we use the word ``version`` for a major version of MapFish
Geoportal (2.0), and the word ``release`` for each step in this version
On this page, we use the word ``version`` for a major version of GeoMapFish
(2.0), and the word ``release`` for each step in this version
(2.0.0rc1, 2.0.0, 2.0.1, ...).

``MapFish Geoportal`` is the pack that includes ngeo and c2cgeoportal;
Expand All @@ -32,7 +32,7 @@ On branch creation (start of the integration phase):

On release creation:

* Reset the changelog
* Reset the change log
* Do the tags
* Publish it
* Create the new demo
Expand Down Expand Up @@ -254,8 +254,8 @@ Use the ``ngeo`` package linked to the branch
In ``c2cgeoportal`` new version branch, in the file ``geoportal/package.json``, set the ``ngeo`` version to
``version-<new version>-latest``.

Reset the changelog
-------------------
Reset the change log
--------------------

On the ``c2cgeoportal`` new version branch:

Expand Down Expand Up @@ -294,7 +294,7 @@ On the <new_version> branch disable version check by adding in the ``ci/config.y
Backport label
--------------

Create the new backport label named ``backport_<new_version>``.
Create the new back port label named ``backport_<new_version>``.

Protect branch
--------------
Expand Down Expand Up @@ -323,4 +323,4 @@ Use the new demo

On ``ngeo`` master branch change all the URL
from ``https://geomapfish-demo-<new version>.camptocamp.com``
to ``https://geomapfish-demo-<next version>.camptocamp.com``.
to ``https://geomapfish-demo-<next version>.camptocamp.com``.