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

Поддержка dev env #14

Open
Laboratory opened this issue Feb 26, 2020 · 2 comments
Open

Поддержка dev env #14

Laboratory opened this issue Feb 26, 2020 · 2 comments

Comments

@Laboratory
Copy link

Сделайте пожалуйста чтобы vk-hosting-config.json можно было передавать параметром.
Есть необходимость деплоить в prod и dev приложение. И для этого использовать разные конфиг файлы.

@b-ponomarenko
Copy link

Поддерживаю, @Mobyman

@Laboratory
Copy link
Author

@b-ponomarenko
можно сделать так:

    "deploy:vk-prod": "./scripts/vk_deploy.sh prod",
    "deploy:vk-dev": "./scripts/vk_deploy.sh"

и сам скрипт

#!/bin/bash
#

file_name=vk-hosting-config.json
productionId=123
developmentId=456
id=$developmentId

if [[ "$1" == "prod" ]]; then
  id=$productionId
fi

cat >$file_name <<EOF
{
  "static_path": "build",
  "app_id": "$id",
  "endpoints": {
    "mvk": "index.html",
    "web": "index.html",
    "mobile": "index.html"
  }
}
EOF

yarn build
rm build/static/js/*.txt
./node_modules/.bin/vk-miniapps-deploy
rm vk-hosting-config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants