Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
Matjaž Horvat 78bc9de847
Drop version from docker-compose.yml, because it is obsolete (#3184)
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
2024-04-23 10:56:18 +02:00
Eemeli Aro 06d0ed5b32
Use postgres:15 instead of custom postgres:13.4 build for dev env (#3170) 2024-04-09 16:41:26 +02:00
Eemeli Aro 9faea69c20
Set `tabWidth: 2` in Prettier config (#2438)
* chore: Update Prettier config, setting tabWidth:2

* style: Apply updated Prettier styles

If you need to rebase work past this style change, do as follows:

0. Consider this to be commit `commitA`, replacing that with its id in the following.
1. To make sure mistakes aren't fatal, assign a second branch to your current work.
2. Rebase your branch on the commit immediately before this one, commitA~
3. Run the following command at the root of the repo:

    git rebase --strategy-option=theirs \
      --exec 'npx prettier --write . && git add -u && git commit --amend --no-edit' \
      commitA

That will take a short while esp. if you have multiple commits,
as it runs Prettier on everything for every commit.
If you've deleted files, the rebase may drop down to interactive mode
and have you `git rm` as appropriate, then `git rebase --continue`.

You should end up with just your changes in your branch,
prettily formatted. To validate that,
apply the same Prettier config change to your original branch,
reformat the files with `npm run prettier`,
and then compare the results with the rebased branch.

* chore: Clean up lint configs
2022-03-03 09:46:35 +01:00
Eemeli Aro 9fc9430cc7
Refactor the frontend build (#2437)
* feat!(frontend): Drop react-scripts

* chore(frontend): Add missing dependency on escape-html

* refactor(frontend): Use ~ to prefix paths from src/ root

* chore(frontend): Add & configure jest & ts-jest

* chore(frontend): Fix bugs & tests revealed by updated jest, skipping EntityDetails

* chore(frontend): Add ESLint as explicit dev dependency; satisfy linter

* chore(frontend): Clean up dependencies, using caret ^ range for all

* chore(frontend): Switch from yarn to npm & configure as a workspace

Prettier & ESLint dependencies are now defined in the root package.json

Changing package management means that many path & minor updates are
simultaneously applied via the caret ^ ranges.

The local/pontoon-frontend Docker image now uses node:16 as a base
and /app/frontend rather than /frontend for its contents & workdir,
in order to accommodate the changed topography.

* chore: Collect devDependencies in root package.json

* chore(tag-admin): Move Babel config to repo root

* feat(frontend): Adjust public/ for being served as Django static files

* chore(frontend): Add build with Rollup

* feat(pontoon): Drop frontend proxy, server static files normally, add pipeline for frontend

* chore(server): Add dependencies via pontoon/package.json; clean up Dockerfile

* chore: Add build:prod targets for frontend & tag-admin

frontend image droapped from Dockerfile as unused

styled-components updated to v5 to avoid a broken import in v4.

* chore: Add watch targets for workspaces & root, using concurrently

* chore: Code review & CI-identified fixes

* chore: Refresh lockfiles, dropping frontend/yaml.lock

* chore: Add /bin/watch.sh to watch all builds; refactor `make run`

* ci: Fix frontend TS test CLI args due to yarn -> npm change

* chore: Use `npm start` rather than `npm run watch`

* chore(pontoon): Mark django-pipeline JS dependencies as devDependencies

* refactor: Rename frontend/ as translate/
2022-03-02 16:10:42 +01:00
Eemeli Aro d26c91487e
Handle the `tags/admin/` client as an npm workspace at `/tag-admin/` (#2430)
* Move tag-admin sources & tests to /tag-admin/src/

Import paths are modified to use relative, fully qualified file names.

* Configure tag-admin as an npm workspace

* Fix build & CI issues

Consistently call 'npm ci' and 'npm run build' where appropriate

* Apply lint & style rules to tag-admin/webpack.config.js

* Fix permissions for /tag-admin/ in Dockerfile

* ci: Rename "non-frontend-js" action as "tag-admin"

* docs(tag-admin): Add README
2022-02-16 16:47:32 +02:00
David Zamora 5db135f986
Fix #2372 - Update docker-compose version number (#2381)
Docker won't start up since the use of the property
target: and the mismatch with the version of the
docker-compose.yml (version: "2"). The minimum version
required to use target: is 2.3.

Changing the value of the version to 2.3 of the docker-compose.yml will
allow for the docker containers to start up.

Co-authored-by: david.zamora <m0YSvMxa9KoGTFEOf50L>
2021-12-01 12:14:13 +01:00
Eemeli Aro 623d7bbb39
Add a separate frontend container (#1996)
* refactor: Rename build-frontend make task as build-tagadmin

* feat: Split frontend app into its own container

* chore: Include static frontend build in webapp for compatibility

* chore: Run all tests on `make test`; add `make test-webapp`

* refactor: Rename "webapp" as "server"

* refactor: Use fronted build stage rather than duplicated Dockerfile

* chore: Rename run_server -> server_run also in docker/k8s-first-steps

* chore: Run ESLint & Prettier tasks also in frontend

* chore: Use new `make ci` to test & lint both frontend & server

Based on `make test-server`, that now only runs server tests.
2021-09-30 15:02:01 +02:00
Eemeli Aro bf35f68f4b
chore(docker): Persist dev env postgres data in a named volume (#2001) 2021-09-02 11:19:51 +02:00
Axel Hecht 278e49fa04
Fix bug 1683619 - Migrate automation from Travis to GitHub Actions (#1784)
Also:
* Refactor requirements to allow only linting reqs to be installed.
* Expose requirements to docker, so pip-compile can be run there.
* Remove codecov dependency in docker container
* Add coverage for frontend
2020-12-22 13:16:25 +01:00
Jarek 504b941f28
Fix bug 1530988 - Enable downloading l10n files if project config is used (#1657)
Also: fix the content-type for zip files
2020-09-28 09:53:29 +02:00
Adrian Gaudebert cf627b9645 Bug 1600344 - Only build and run Python 3 on docker. 2020-01-28 17:33:52 +01:00
Adrian Gaudebert e5817a3f63
No bug - Upgrade react-scripts to latest version. (#1520) 2019-12-23 12:22:14 +01:00
Adrian Gaudebert 10f17aef70 No bug: Dockerfile rewrite (#1463)
Rework docker file into a single file, remove gosu, simplify instructions, and reduce build time.
2019-11-06 08:34:44 +01:00
Aniruddha Basak 5bb924d411 Fix bug-1541260: [python3] Add a service in docker-compose with Python 3 as the default interpreter (#1255) 2019-04-16 15:00:23 +02:00
Adrian Gaudebert f3fcf088b7
No bug - Enable running only changed frontend tests. (#1183)
This requires the container to have git, and the local .git folder. With those, running tests with jest automatically only runs the tests that have changed since the last commit.
2019-01-31 14:48:07 +01:00
Adrian Gaudebert 67c22a3356
Fix bug 1478066 - Use volumes instead of symlinks in docker dev envir… (#1024)
* Fix bug 1478066 - Use volumes instead of symlinks in docker dev environment.

* Use docker-compose everywhere possible.
This also removes the new useless run_tests_in_docker.sh file, that was quite inconsistent with our use of the Makefile. Everything is a lot more streamlined and simple now.
2018-07-25 14:56:14 +02:00
Adrian Gaudebert 43becde477
Fix bug 1473330 - Translate.Next architecture (#989)
* Add React frontend for Translate app.
This has been set up using create-react-app.

* Integrate new Translate app into django.
This provides a working prod and dev environment. In production, django will serve the index.html file as a template, and files built by webpack will be collected and distributed with other django static files. In development, all requests are proxied to the dev webpack server, allowing all dev niceties to be used.

* Add support for websockets.

* Add a bit of documentation specific to our use case.

* Add redux for state management.

* Show a very basic list of entities.

* Enable absolute path import.

* Add links to various resources.

* Rearchitecture code into modules.

All features should be self-contained into a module in src/modules/. All code that is shared amongst several modules should go into a module in src/core/.

* Remove unused assets.

* Add some architecture documentation.

* Add Flow to current code for type checking.

* Add unit testing with jest, enzyme and sinon.

* Extend documentation, talk about type checking, modules, and list tools we use.

* Move CSS rules closer to actual component.

* Add django-waffle and hide translate.next behind a switch.

* Better structure for the README file.

* Build and test frontend in travis.

* Of course it is better if dependencies are installed.

* Use pushd to run commands in frontend.

* Configure eslint and fix errors.

* Add more code comments.

* Improve documentation around local dev and Flow.

* Add tests for the Translate view.

* Improve documentation.

* Fix serving static files for development.

* Integrate Translate.Next with out docker setup.

* Remove debug.

* Use DEV instead of DEBUG.

* Much review.
          Many comments.
    Wow better!

* Flatter module public interfaces.

* Import correctly from modules.

* Fix docker webapp run.
2018-07-18 11:39:52 +02:00
Adrian Gaudebert 9edab37cde
Fix bug 1456846 - Fix docker dev environment. (#942)
* Fix bug 1456846 - Fix docker dev environment.

This commit ensures that:
 - the assets/ folder is always created
 - dependencies (Python and node) do not pollute the user's repository. They are now installed in a different folder inside the container
 - webpack takes resources from the right place, and puts bundles in the right folder

This looks like a small patch but it was actually fairly complex. The reason is that our Dockerfile is made for a production deployment, meaning that it builds all the resources it needs to run in place. That's fine. However, when we run locally for development, using docker-compose, we override the /app folder with the user's local folder. That means all resources built during `make build` are lost.
This patch puts those resources in a different folder, and then links to that folder from the user's repository. This allows to keep a clean production build process, while having a working dev environment, and a clean local folder.
2018-05-09 14:45:48 +02:00
Ryan Northey 8d03d6a0cc Touch Bug 1440940: Docker postgres collations #866
- Add pontoon-postgres Dockerfile
- Use pontoon-postgres in docker-compose
2018-02-26 18:26:31 +00:00
Adrian Gaudebert b5206f6e86 Fixes bug 1376813 - THIS... IS... DOCKER! (#623)
* Fixes bug 1376813 - THIS... IS... DOCKER! [WIP]

* Review comments, and fixed some issues.

* Added a first documentation.

* Fixed requirements.

* Added instruction to load a dump file into postgres.

* Added commands to run tests, and related documentation.

* Updated documentation for documentation and dependencies.

* Remove and create pontoon database before loading a dump.

* review comments.

* Fixed documentation.
2017-07-24 18:45:58 +02:00
Michael Kelly 9b22f5ba34 Fix bug 1185698: Remove Docker environment.
Removes Docker-specific files and updates the documentation to remove references
to Docker.
2015-08-06 17:46:10 -07:00
Michael Kelly b315ac5659 Remove Git-specific auth and use local keys for Docker.
Removes the git-specific username/password authentication and instead
assumes that SSH keys will already be set up for git/svn/hg to use.
Modifies the docker container to mount the user's SSH keys into the
container so that the VCS sync management commands run using the user's
local keys.

This isn't a significant change in security mainly because previously
the user's local keys were being used anyway since the app was run
locally instead of being run in a container.
2015-05-28 09:57:02 -07:00
Michael Kelly e8adb8bf67 Authenticate via HTTP Basic Auth for git. 2015-05-06 14:06:23 -07:00
Matjaž Horvat 0551cda4e1 Set default logging level to INFO, override in DEV 2015-05-06 20:44:53 +02:00
Michael Kelly 3c9a192a36 Switch back to manage.py for dev server.
Fixes an issue where static files were being collected every request and
weren't updating properly. Now we use the runserver command that serves
up static files automatically.

Also moves the STATIC_ROOT outside of the share volume, avoiding issues
with accidentally editing the collected static files instead of the
canonical ones.
2015-04-27 21:44:51 -07:00
Michael Kelly caeb9ce6de Switch to PostgresSQL. 2015-04-23 13:07:12 -07:00
Michael Kelly d2fa5bbd23 Fix and document small issue around SITE_URL. 2015-04-21 20:45:36 -07:00
Michael Kelly 3ee543d03c Use docker to build development instance of site. 2015-04-13 16:23:00 -04:00