升级 Docker 镜像
info
在升级之前,请查看发布说明!
- Docker
在YML文件所在的目录中,拉取新的镜像:
docker compose pull
使用docker compose up
重新启动容器。要在后台运行容器,请添加-d
标志:
docker compose up -d
Pull the new changes from the git repository, checkout the new version and then build the new release:
git pull
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
mix deps.get --only prod
npm install --prefix ./assets && npm run deploy --prefix ./assets
rm -rf _build
MIX_ENV=prod mix do phx.digest, release --overwriteMost upgrades requires to run new database migrations. If so continue with the following command:
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
Note, you may need to include environment variables when running this step:
DATABASE_USER=teslamate DATABASE_PASS=super_secret_password DATABASE_NAME=teslamate DATABASE_HOST=localhost MQTT_HOST=your_MQTT_host(HomeAssistant in my case) _build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
Finally, re-import the Grafana dashboards:
LOGIN="user:pass" ./grafana/dashboards.sh restore
Pull the new changes from the git repository, checkout the new version and then build the new release:
bash
git pull
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
mix deps.get --only prod
npm install --prefix ./assets && npm run deploy --prefix ./assets
rm -rf _build
export MIX_ENV=prod
mix do phx.digest, release --overwriteMost upgrades requires to run new database migrations. If so continue with the following command:
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
Note: you may need to include environment variables as part of this step:
DATABASE_USER=teslamate DATABASE_PASS=super_secret_password DATABASE_NAME=teslamate DATABASE_HOST=localhost MQTT_HOST=your_MQTT_host(HomeAssistant in my case) _build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
Finally, re-import the Grafana dashboards:
bash
export LOGIN="user:pass"
./grafana/dashboards.sh restore