Changing configuration
As was described in the Overview, all configuration is contained in a deployment. Therefore, changing configuration means changing a deployment and making it active.
The process of changing a deployment depends on your workflow. If you follow our recommendations you have the deployment stored in GIT. Then, you need to get the changes into the repository, either directly or via Pull Request.
Making the deployment active, e.g. installing it, consists of two parts. First you need to get the
deployment on the server. It’s good to have the deployments located in a single folder, e.g.
/opt/altworx/deployment/. Copy/clone the deployment into a new folder. Typically we use time as
identification, so copy the deployment in /opt/altworx/deployment/$(date +%s).
Note that it’s best to copy/clone the deployment each time instead of using git pull inside the
active deployment. Changing the active deployment is not recommended as it may lead to unexpected
behaviour. Always copy/clone and install if possible.
The next step is to install the deployment - make it the active one. To do that you need to use the enclosed install script.
The install script, install.sh, should be located in the root of your deployment. To install a
deployment you simply run it with a couple of parameters.
./install.sh \
--deploy-env "dev" \
--deploy-repo-src-path "/opt/altworx/deployment/1619510233" \
--deploy-current-path "/opt/altworx/deployment/current-settings" \
--deploy-repo-path "/opt/altworx/deployment/latest-deployment" \
--altworx-data-path "/var/altworx"
The options specify include:
--deploy-env- which environment to install--deploy-repo-src-path- the path to the deployment you want to install--deploy-current-path- a name of a link that is created to the active installed environment, e.g./opt/altworx/deployment/1619510233/dev. This needs to be same asIN_MACHINE_CONFIGSin.env.--deploy-repo-path- a name of the link that is created to the active installed deployment, e.g./opt/altworx/deployment/1619510233. This is only for your convenience, since there are usually utility scripts in that location, so you can easily access them via the link.--altworx-data-path- the path to the data directory. This needs to be same asIN_MACHINE_DATAin.env.--offline- optional, if present triggers an offline installation. During offline installation, Docker images are not downloaded from the Internet but rather loaded from disk.
Since the parameters don’t change, with the exception of --deploy-repo-src-path, it’s recommended
to put this into a script you can execute repeatedly. Create a script install-this-env.sh in the
deployment inside the respective environment (e.g. dev/install-this-env.sh). The script will be
copied to the machine with the deployment and you can use it to install the deployment. The script
can look something like this.
#!/usr/bin/env bash
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
deploy_repo_src_path=$(dirname $script_dir)
bash $deploy_repo_src_path/install.sh \
--deploy-env "dev" \
--deploy-repo-src-path "$deploy_repo_src_path" \
--deploy-current-path "/opt/altworx/deployment/current-settings" \
--deploy-repo-path "/opt/altworx/deployment/latest-deployment" \
--altworx-data-path "/var/altworx"
Now, after copying/cloning the repo you just run the script, e.g.
/opt/altworx/deployment/1619510233/dev/install-this-env.sh.
You can build your own CD automated pipeline using the tools of your choice. We don’t provide any further assistance in this regard, but you should have no problem, since the pipeline would only be using the steps above.