Skip to content

Commit

Permalink
[website] Fix website docker build (apache#2291)
Browse files Browse the repository at this point in the history
* [website] Fix website integration with crowdin

 ### Motivation

Crowdin integration requires API key. The API key is set at CI,
however it is not propagated into the docker image that we are
using for building the website. So Crowdin was not able to download
translations.

```shell
$ crowdin --config ../crowdin.yaml upload sources --auto-update -b master
Project identifier is empty
Project key is empty
Done in 0.46s.
yarn run v1.7.0
warning package.json: No license field
$ crowdin --config ../crowdin.yaml download -b master
Project identifier is empty
Project key is empty
Done in 0.47s.
yarn run v1.7.0
```

 ### Changes

Pass Crowdin related environment settings from host to docker.

* add back missing comment
  • Loading branch information
sijie authored Aug 2, 2018
1 parent 25e98f4 commit b7267e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site2/tools/docker-build-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ CI_USER=$(id -u)
CI_GROUP=$(id -g)

# crowdin keys
CROWDIN_DOCUSAURUS_PROJECT_ID=${CROWDIN_DOCUSAURUS_PROJECT_ID:-apache-pulsar}
CROWDIN_DOCUSAURUS_PROJECT_ID=${CROWDIN_DOCUSAURUS_PROJECT_ID:-"apache-pulsar"}
CROWDIN_DOCUSAURUS_API_KEY=${CROWDIN_DOCUSAURUS_API_KEY:-UNSET}

DOCKER_CMD="docker run -i -e CI_USER=$CI_USER -e CI_GROUP=$CI_GROUP -v $ROOT_DIR:/pulsar $IMAGE"
DOCKER_CMD="docker run -i -e CI_USER=$CI_USER -e CI_GROUP=$CI_GROUP -e CROWDIN_DOCUSAURUS_PROJECT_ID=${CROWDIN_DOCUSAURUS_PROJECT_ID} -e CROWDIN_DOCUSAURUS_API_KEY=${CROWDIN_DOCUSAURUS_API_KEY} -v $ROOT_DIR:/pulsar $IMAGE"

$DOCKER_CMD bash -l -c 'cd /pulsar/site2/website && yarn && yarn run crowdin-upload && yarn run crowdin-download && yarn build && node ./scripts/replace.js && cp -R ./build/pulsar /pulsar/generated-site/content/staging'

0 comments on commit b7267e6

Please sign in to comment.