{% extends "base_template.html" %} {% block title %}{{ _('Deployments') }} - {{ _('Admin') }}{% endblock %} {% block head %} {% if refresh_seconds %}{% endif %} {% endblock %} {% block breadcrumb %} {% endblock %} {% block content %}
{{ _('This site follows a release channel. When a new release is published, the deployment agent backs up the database, replaces the web container and checks that the new version starts. If it does not, the agent puts the previous version and its database back.') }}
{{ _('The deployment agent only runs in production, next to the web container. There, splent product:deploy generates the shared secret and starts the agent.') }}
{{ _('To turn it on, set SPLENT_IMAGE in the product .env.deploy to the release channel the server should follow, for example %(example)s, and deploy again.', example='git.splent.io/splent-io/' ~ (SPLENT_APP or 'my_product') ~ ':stable') }}
{% elif connection == 'unreachable' %}{{ _('The site keeps running as usual. Only automatic updates are affected until the agent answers again.') }}
{{ _('Check that the agent container is running next to the web container. This page looks for it at %(url)s.', url=agent_url) }}
{% elif connection == 'refused' %}{{ _('AUTODEPLOY_SECRET must be the same for the web container and the agent. Run splent product:deploy again so both read it from the same .env.deploy.') }}
{% else %}{{ _('The agent and this feature may be of different versions. Deploying the product again brings them together.') }}
{% endif %} {% if error %}{{ error }}
{{ configured_image }}{{ status.message }}
{% if status.detail %}{{ status.detail }}
{{ problem }}{{ status.image }}{% else %}{{ _('Not set') }}{% endif %}{{ status.running_image }}{% else %}{{ _('Unknown') }}{% endif %}{{ status.pending_image }}{{ _('Check now looks for a new release right away and deploys it, even outside the update window. A release that failed before is never deployed again.') }}
| {{ _('When') }} | {{ _('Change') }} | {{ _('Features updated') }} | {{ _('Result') }} | {{ _('Duration') }} |
|---|---|---|---|---|
| {{ entry.time }} |
{{ entry.from_image or '?' }} → {{ entry.to_image or '?' }}
{% if entry.product_version %}{{ _('Product %(version)s', version=entry.product_version) }} {% endif %}
{% if entry.framework %}{{ _('Framework %(version)s', version=entry.framework) }} {% endif %}
|
{% if entry.features %}
|
{{ entry.result_label }}
{% if entry.reason %} {{ entry.reason }} {% endif %}
{% for problem in entry.problems %}{{ problem }} {% endfor %}
{% if entry.log_tail %}
{{ _('Last log lines of the new version') }}{{ entry.log_tail }}
|
{{ entry.duration }} |
{{ _('The agent backs up the database before every deploy and keeps the newest ones in its data volume. Each file is named after the time it was taken and the image the database belonged to.') }}
{% if status.backups %}{{ backup }}{{ _('A failed deploy is rolled back with its backup automatically. There is no button to roll back a deploy that worked, because restoring a backup later throws away everything written since. If you need to, do it on the server, after pausing automatic updates.') }}
docker cp {{ agent_host or 'PRODUCT_autodeploy' }}:/data/backups/BACKUP.sql.gz .docker stop {{ status.web_container or 'PRODUCT_web_deploy' }}docker exec {{ status.db_container or 'PRODUCT_db_deploy' }} bash -c 'MYSQL_PWD="$MARIADB_ROOT_PASSWORD" mariadb -uroot -e "DROP DATABASE IF EXISTS \`$MARIADB_DATABASE\`; CREATE DATABASE \`$MARIADB_DATABASE\`"'
gunzip -c BACKUP.sql.gz | docker exec -i {{ status.db_container or 'PRODUCT_db_deploy' }} bash -c 'MYSQL_PWD="$MARIADB_ROOT_PASSWORD" mariadb -uroot "$MARIADB_DATABASE"'{{ _('Deployment agent %(version)s', version=status.agent_version) }}
{% endif %} {% endif %} {% endblock %}