Skip to content

Instantly share code, notes, and snippets.

@svilensabev
Last active November 27, 2019 10:14
Show Gist options
  • Save svilensabev/ab08286dcf8b7b1ffadebb1da484bce2 to your computer and use it in GitHub Desktop.
Save svilensabev/ab08286dcf8b7b1ffadebb1da484bce2 to your computer and use it in GitHub Desktop.
DevOps paper

DevOps


1. Provisioning staging VPS

Secure server

  • Firewall
  • SSH configuration
  • Fail2Ban

Install project requirements

  • Node.js
  • Docker
  • ...

Common server tweaks

  • Install various apt packages: vim, git, logrotate, etc
  • Create user and set sudo privileges
  • Set hostname

Initial deploy

  • Clone project repository
  • Create SSL certificates with LetsEncrypt
  • Configure nginx reverse proxy

Set backup/restore plan


2. Continuous Integration

When Pull Request is created

Pipeline

  • Build project in isolated environment
  • Import production database
  • Test project

3. Continuous Deployment

When PR is merged into staging branch

Pipeline

  • Build project in isolated environment
  • Import staging database
  • Test project
  • Deploy to staging server

--

Other possible integrations

  • Build docker image
  • Push docker image into public/private container repository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment