Athento allows you to deploy custom code in a dedicated instance.
Among the code that can be deployed are:
- Operations: automations specific to the client's use case that can be executed on demand, from the product's Ui or from the API.
- Commands: programmatic processes that are usually executed massively.
- HTML Templates: to customize Athento's interface.
- API Hooks
- Tray masks: to make specific or complex queries.
To work with custom code, the following steps must be taken:
- Have a GIT repository
- Upload the code with the same structure that can be seen in the /var/www/athentose directory.
- Send an email to soporte@athento.com providing the URL of the GIT repository and providing read credentials, indicating on which instance the deployment of the custom code is requested.
- Occasionally, you can indicate the branch you want to use for the deployments and the frequency of automatic deployment.
How to deploy custom code for the first time
To deploy the custom code you must configure a new git config from the advanced administration (you can access directly with this link https://<DOMAIN>/aseadm/config/configgit/).
Once inside the config git, a new configuration must be added:
This will open a screen where the user will be able to add the necessary information to configure the new repository in the instance:
You must fill in the repository name, the url that will be https://bitbucket.org/athento/<repository_name>.git, the user name of the person doing the configuration, the application password (you can see how to get it here) and a brief description of the item.
Once the configuration is done, the "clone_git_repositories" command must be launched (here is how to do it). This command will check "Cloned", when the repository has been successfully cloned.
Finally, so that the updates of the repository are reflected in the instance, it is also necessary to launch the "update_custom" command that will update the custom code with the frequency that has been established when configuring it. This will open a screen where the user will be able to add the necessary information to configure the new repository in the instance:
Updates
Code updates will be performed automatically, usually every hour or less.
Therefore, it should be noted that any code uploaded to the main branch of the repository will be updated automatically. It is therefore recommended to use different branches for development and work with Pull Requests to merge the code into the main branch.
Developers are responsible for uploading the final code to the repository. Uploading code to the repository is not part of the support.
Occasionally, Athento may be asked to manually update the code in special cases. In these cases, Athento support will be limited to performing the following commands:
- "git pull", to deploy the new code.
- "./scripts/soft_reload.sh" to apply the changes.
Support tickets should be titled "Updating custom code in instance", clearly indicating the instance for which the update is requested.
How to deploy the code as a Django application
- Create project symlink in /var/www/athentose/athentose/athentose
- Configure the file /var/www/athentose/athentose/settings_config/custom/settings_custom_apps.py
Command example to create the symbolic link
ln -s /var/www/athentose/athentose/custom/MyApp /var/www/athentose/athentose
Example code for settings_custom_apps.py
CUSTOM_INSTALLED_APPS = ('MyApp', )
INSTALLED_APPS += CUSTOM_INSTALLED_APPS
Useful commands for uploading code to the repository
If you are working from a UAT environment on custom code, these commands are useful for uploading code to the repository:
git add: to add new files to version control.
git commit: to commit changes to the repository
git push: to upload changes to the repository
Some resources about GIT
- https://www.w3schools.com/git/
- https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners
Comments
0 comments
Please sign in to leave a comment.