aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci/deploy.sh (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-06-05Remove ansible-lintEuAndreh1-6/+6
It wasn't trivial to configure: Ansible tried to work on /homeless-shelter :facepalm:
2019-06-05Use specific known keys for connecting with the backup serverEuAndreh1-2/+3
2019-06-05Change permission of borg client keyEuAndreh1-0/+1
2019-06-05Uncomment phases from provision.shEuAndreh1-13/+13
I was letting it be commented during iteration, it shouldn't have been committed this way.
2019-06-05TODOs.orgEuAndreh1-13/+14
2019-06-05Use Ansible instead of Bash for provisioningEuAndreh1-5/+8
The deployment is not quite working, and I'm unable to test right now: DigitalOcean is returning 503 for my requests. As of this commit, I can run =ansible-playbook provider.yml= more than once and it will actually be idempotent. Notes: - SSH fingerprint are now taken from the public key file instead of manually supplying it in the terraform template using the =digitalocean_ssh_key= resource; - use Ansible instead of ad-hoc Bash scripts for provisioning the Droplets created by Terraform; - use the =filename.env.extension= to create the concrete files in CI; - use the =user_data= to add the know SSH key pair to the newly created Droplet; - add =rotate-ssh-keys.sh= utils;
2019-05-28Split $VPS_COMMIT_SHA variable declaration for exportingEuAndreh1-1/+2
ShellCheck offense.
2019-05-28Rotate SSH key and use correct VPS_COMMIT_SHA on provisioningEuAndreh1-4/+5
2019-05-28Configure git for vps-state repo in ./scripts/ci/setup.shEuAndreh1-2/+0
2019-05-28Add git config metadata to enable commiting in CIEuAndreh1-0/+2
2019-05-28Fix mixed usage of $PLAN_FILE variableEuAndreh1-4/+5
Split $PLAN_FILE into $PLAN_FILE_NAME and $PLAN_FILE_PATH.
2019-05-28Store plan file in vps-state tooEuAndreh1-4/+18
2019-05-28Fix shell.nix path in nix-shell custom shebangEuAndreh1-1/+1
2019-05-28Split scripts into CI and VPS boxEuAndreh1-1/+2
2019-05-28Remove git rev-parse from .envrcEuAndreh1-1/+1
2019-05-28Add backup routing before possibly tearing down machineEuAndreh1-2/+5
Create a new backup entry before running =terraform apply=, which may (or may not) destroy the current machine. This shouldn't be an issue for the backup itself, since all of the data should be stored in a separate Block Storage Volume, but we can take advantage of the sevices already needing to be taken down in order to perform a full backup of the data.
2019-05-27WIP: take a backup during deploymentEuAndreh1-2/+3
Before possibly tearing down the machine, while all services are stopped (after the =docker-compose down= command), create a new backup with the current data. The backup tag should include the commit SHA of the deployment.
2019-05-26Run terraform init before running terraform applyEuAndreh1-0/+1
2019-05-26ci dbgEuAndreh1-0/+1
2019-05-26Fix missing argument to sshEuAndreh1-1/+1
2019-05-26Specify shell type to ShellCheck in nix-shell shebang filesEuAndreh1-0/+1
2019-05-26Use more robust Bash cd approachEuAndreh1-1/+1
2019-05-26Use nix-shell shebang to run CI scriptsEuAndreh1-1/+2
2019-05-26Prepare builds.sr.ht CI environment before running build tasksEuAndreh1-5/+0
Make content of .envrc available to subsequent build jobs.
2019-05-26Unlock with git-crypt in setup phaseEuAndreh1-8/+2
2019-05-26Disable shellcheck 2139 offenseEuAndreh1-0/+1
2019-05-26Remove extra newline at "Done.\n" messagesEuAndreh1-5/+5
2019-05-26Fix unexpected shell scapingEuAndreh1-1/+1
2019-05-26Automate provisioning and deployment of VPSEuAndreh1-0/+36
In order to perform that I had to remove Terraform's =.tfstate= files from the repository. Terraform does support "backends" for storing the state files, but I settled for storing it on a separate repo (vps-state). For now it solves the state management problem: - it has history of states; - all state files are GPG encrypted; - there's no coordination however, but only the CI should perform a deploy in order to avoid race conditions. I had to add GPG and SSH keys to sr.ht to achieve that: - SSH public key to my profile to authorize it to push to vps-state repo; - SSH private key to the secret builds.sr.ht environment to enable push to the repository from the pipeline; - GPG public key to git-crypt to make it possible for the pipeline to unlock the encrypted content; - GPG private key to the secret builds.sr.ht environment to enable decrypting git-crypt content from the pipeline. In order to avoid divergent environment from local and CI, the ./provision.sh script is ran through nix-shell.
2019-05-25Remove provisioning from TerraformEuAndreh1-24/+0
2019-05-25Use apt_wait before interacting with apt-getEuAndreh1-3/+20
2019-05-25Move provisioning code into provision.shEuAndreh1-0/+7