🛳️Deployment
Some notes on various deployment scenarios whilst using Gitamic.
Authentication
When building your application in its production environment or running it through a pipeline, you will likely need to install its dependencies, and this may include Gitamic.
When that happens, Composer will need to authenticate against the private repository in order to install Gitamic.
You probably don't want to be doing this manually in a terminal every time – and thanks to Composer, you don't have to!
How you authenticate will depend on how you deploy:
Laravel Forge has built-in support for private package repository authentication.
Repository URL:
gitamic.composer.shUsername: Your Anystack email address
Password: Your license key (which depends on how you purchased it)
Create a COMPOSER_AUTH Environment Variable with the JSON structure that Composer expects, e.g.
{"http-basic":{"HOSTNAME":{"username":"USERNAME","password":"PASSWORD"}}}Replace the placeholders with the following values:
HOSTNAME:gitamic.composer.shUSERNAME: Your Anystack email addressPASSWORD: Your license key (which depends on how you purchased it)
For compatibility, remove all spaces and line breaks.
Any of the following methods should work. You only need to pick one.
auth.json
auth.jsonYou can create an auth.json file in your project or in a global auth.json that stores these credentials.
Do not commit your auth.json file to git
COMPOSER_AUTH
COMPOSER_AUTHCreate a COMPOSER_AUTH environment variable similarly to the approach used for Netlify.
You can set this environment variable in your shell config file or you can create it on-the-fly as part of your composer CLI commands:
COMPOSER_AUTH={JSON} composer install ...See the Netlify example for what to replace the {JSON} placeholder with
Auto-deployment
If you're using Gitamic to push commits from a server that is also the target for automated deployments, when you push from Gitamic it might trigger a redundant deployment back to the environment that is the source of those changes.
To prevent this, in your deployment script, you will need to write a statement that exits the deployment when it detects that Gitamic initiated the commit.
For example, if you use Laravel Forge (and you haven't customised the git commiter name - see Setup), you could add the following to the beginning of your deploy script, which inspects the author of the commit and stops the process before it begins:
[[ "$FORGE_DEPLOY_AUTHOR" == "Gitamic" ]] && echo "Commit by $FORGE_DEPLOY_AUTHOR" && exit 0
# The rest of your deployment script...However, the specific approach you should use will depend on your unique setup.
Last updated
Was this helpful?