-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update guides-translations.md for CircleCI 2.0
Ref: #350
- Loading branch information
1 parent
0a3f0ec
commit 92f95df
Showing
1 changed file
with
43 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,38 +225,51 @@ CROWDIN_DOCUSAURUS_PROJECT_ID=YOUR_CROWDIN_PROJECT_ID CROWDIN_DOCUSAURUS_API_KEY | |
|
||
You can automate pulling down and uploading translations for your files using the [CircleCI](https://circleci.com) web continuous integration service. | ||
|
||
First, update the `circle.yml` file in your project directory to include steps to upload English files to be translated and download translated files using the Crowdin CLI. Here is an example `circle.yml` file: | ||
First, update the `.circleci/config.yml` file in your project directory to include steps to upload English files to be translated and download translated files using the Crowdin CLI. Here is an example `.circleci/config.yml` file: | ||
|
||
```yaml | ||
machine: | ||
node: | ||
version: 6.10.3 | ||
npm: | ||
version: 3.10.10 | ||
test: | ||
override: | ||
- "true" | ||
deployment: | ||
website: | ||
branch: master | ||
commands: | ||
# configure git user | ||
- git config --global user.email "[email protected]" | ||
- git config --global user.name "Website Deployment Script" | ||
- echo "machine github.com login test-site-bot password $GITHUB_TOKEN" > ~/.netrc | ||
# install Docusaurus and generate file of English strings | ||
- cd website && npm install && npm run write-translations && cd .. | ||
# crowdin install | ||
- sudo apt-get install default-jre | ||
- wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb | ||
- sudo dpkg -i crowdin.deb | ||
# translations upload/download | ||
- crowdin --config crowdin.yaml upload sources --auto-update -b master | ||
- crowdin --config crowdin.yaml download -b master | ||
# build and publish website | ||
- cd website && GIT_USER=test-site-bot npm run publish-gh-pages | ||
# If you only want circle to run on direct commits to master, you can uncomment this out | ||
# and uncomment the filters: *filter-only-master down below too | ||
# | ||
# aliases: | ||
# - &filter-only-master | ||
# branches: | ||
# only: | ||
# - master | ||
version: 2 | ||
jobs: | ||
deploy-website: | ||
docker: | ||
# specify the version you desire here | ||
- image: circleci/node:8.11.1 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Deploying to GitHub Pages | ||
command: | | ||
git config --global user.email "<GITHUB_USERNAME>@users.noreply.github.com" | ||
git config --global user.name "<YOUR_NAME>" | ||
echo "machine github.com login <GITHUB_USERNAME> password $GITHUB_TOKEN" > ~/.netrc | ||
# install Docusaurus and generate file of English strings | ||
- cd website && yarn install && yarn run write-translations && cd .. | ||
# crowdin install | ||
- sudo apt-get install default-jre | ||
- wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb | ||
- sudo dpkg -i crowdin.deb | ||
# translations upload/download | ||
- crowdin --config crowdin.yaml upload sources --auto-update -b master | ||
- crowdin --config crowdin.yaml download -b master | ||
# build and publish website | ||
cd website && GIT_USER=<GIT_USER> yarn run publish-gh-pages | ||
workflows: | ||
version: 2 | ||
build_and_deploy: | ||
jobs: | ||
- deploy-website: | ||
# filters: *filter-only-master | ||
``` | ||
|
||
The `crowdin` command uses the `crowdin.yaml` file generated with the `examples` script. It should be placed in your project directory to configure how and what files are uploaded/downloaded. | ||
|