-
Notifications
You must be signed in to change notification settings - Fork 36
Staging Server
These instructions more or less encompass setting up from scratch a server for staging deployments from the unstable
buendia apt suite. The staging.buendia.org
server is currently based on this setup.
Don't set a passphrase on the private key.
ssh-keygen -t ecdsa -b 256 -C "CircleCI deployment" -f buendia-deploy
tar cvf buendia_deploy_keys.tar buendia-deploy*
gpg -c buendia_deploy_keys.tar
git add buendia_deploy_keys.tar.gpg
git commit
rm buendia_deploy_keys.tar
Go to the SSH permissions configuration for this project in CircleCI and add the key there. Then update the deploy-staging
job in .circleci/config.yml with the key fingerprint.
First, we set up a droplet in Digital Ocean running Debian 9.7. Add a new SSH key and upload the public key in buendia-staging
.
Set the hostname to staging.buendia.org
or similar and then set the STAGING_HOST
variable in the CircleCI environment setup to same.
Then, log into the staging host as root and run the following:
adduser buendia
echo "buendia ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/10-buendia-user
cp -a .ssh ~buendia
chown -R buendia:buendia ~buendia
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
apt-get update
# Use buendia-github.list because buendia.list is overwritten by the buendia-* packages
echo "deb [trusted=yes] http://download.buendia.org/deb stable main java" \
>/etc/apt/sources.list.d/buendia-github.list
echo "deb [trusted=yes] http://download.buendia.org/deb unstable main java" \
>>/etc/apt/sources.list.d/buendia-github.list
apt-get update
apt-get upgrade
apt-get install -y buendia-server buendia-site-test-integration buendia-dashboard buendia-backup buendia-pkgserver
This host should now be ready for deployment from the deploy-staging
CircleCI job.
Back in your own working directory, clean up the unencrypted SSH keys.
rm -f buendia-staging buendia-staging.pub
The demo server hosted at demo.buendia.org
uses the same setup as above, but with the following change in the final package installation step:
apt-get install -y buendia-server buendia-site-cloud-demo buendia-dashboard buendia-update
Also, on demo.buendia.org
, the following was manually added to /var/www/html/index.html
:
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://demo.buendia.org:9000/openmrs/" />
</head>
</html>
The buendia-update
package is expected to keep this server running the latest packages from the unstable channel.
These instructions more or less encompass setting up from scratch a download server for buendia apt packages.
Follow the instructions above to create a new droplet in Digital Ocean and create a buendia user and give it sudo access. Set the DOWNLOAD_HOST
variable in CircleCI to the hostname (e.g. download.buendia.org
).
apt-get install nginx-light
sudo usermod -aG www-data buendia
Log out and log back in again.
sudo chmod g+wxs /var/www/html
sudo chgrp www-data /var/www/html
rm /var/www/html/index.nginx-debian.html
mkdir /var/www/html/deb
Open /etc/nginx/sites-enabled/default
and add autoindex on;
under the server
block.
cd ~
git clone https://github.com/projectbuendia/builds
About the software
System Overview
Client Application
Server Application
Server Platform
Development practices
GitHub Usage
Java Style
Testing
Releases
For field users and testers
Software Install and Configuration
Upon Receiving Your Gear
Setting Up a Tablet
Setting Up a Server
Setting Up an Access Point
Reference Configuration