[英]How to deploy an Angular8 application to google app engine using CI-CD process?
[英]How to deploy Angular multilanguage application on Google App Engine
我已經構建了我的Angular 8應用程序,支持angular/cli
和i18n multilanguage support
(英語,西班牙語,法語翻譯)。
這樣我可以多次構建我的應用程序,每種語言一個,構建保存在dist/my-app/en
, dist/my-app/es
, dist/my-app/fr
等等......
現在我想在谷歌應用引擎上部署我的應用程序,但我無法理解我應該做什么/配置部署我的應用程序的所有lang特定版本。
我已經在GAE上發布了我的默認(英文)版本並且它可以工作,但我不知道如何/在哪里部署所有其他版本(es,fr等)。
我應該使用調度文件嗎? 你最好的方法是什么?
謝謝!
您可以將dist/my-app
視為關於AppEngine的根文件夾。
要使用多個語言環境構建多個應用程序,請查看Angular官方文檔 。
每個href應設置為locale:
"baseHref": "/en/",
然后,更新app.yaml
和處理程序以提供所有子文件夾。
例如,這應該是這樣的:
handlers:
- url: /fr/(.+)
static_files: app/fr/index.html
upload: app/fr/index.html
- url: /en/(.+)
static_files: app/en/index.html
upload: app/en/index.html
- url: /(.+)
static_files: app/index.html
upload: app/index.html
- url: /
static_files: app/index.html
upload: app/index.html
但我不是處理程序regexp的專家,所以我可以對它進行優化。
部署文件夾應如下所示:
deploy
app.yaml
app
index.html // page to propose user to select locale or auto redirect
fr
index.html
bundles.js...
en
index.html
bundles.js...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.