<feed xmlns='http://www.w3.org/2005/Atom'>
<title>server/secrets/terraform.tfstate, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>http://euandre.org/git/server/atom?h=main</id>
<link rel='self' href='http://euandre.org/git/server/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://euandre.org/git/server/'/>
<updated>2019-05-26T14:51:51Z</updated>
<entry>
<title>Automate provisioning and deployment of VPS</title>
<updated>2019-05-26T14:51:51Z</updated>
<author>
<name>EuAndreh</name>
<email>eu@euandre.org</email>
</author>
<published>2019-05-26T14:51:51Z</published>
<link rel='alternate' type='text/html' href='http://euandre.org/git/server/commit/?id=da00227813b1fbeebae8c90e2122a8b73acb1af9'/>
<id>urn:sha1:da00227813b1fbeebae8c90e2122a8b73acb1af9</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Update .tfstate files</title>
<updated>2019-05-25T18:59:35Z</updated>
<author>
<name>EuAndreh</name>
<email>eu@euandre.org</email>
</author>
<published>2019-05-25T18:59:35Z</published>
<link rel='alternate' type='text/html' href='http://euandre.org/git/server/commit/?id=3e5a29a103533600c408922c84a111688782dfd3'/>
<id>urn:sha1:3e5a29a103533600c408922c84a111688782dfd3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Check-in Terraform .tfstate files using git-crypt</title>
<updated>2019-05-25T16:17:12Z</updated>
<author>
<name>EuAndreh</name>
<email>eu@euandre.org</email>
</author>
<published>2019-05-25T16:17:12Z</published>
<link rel='alternate' type='text/html' href='http://euandre.org/git/server/commit/?id=afb4f9f97a339a75fee83748d1a3cdae23bd9d27'/>
<id>urn:sha1:afb4f9f97a339a75fee83748d1a3cdae23bd9d27</id>
<content type='text'>
</content>
</entry>
</feed>
