Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.3 KB

File metadata and controls

35 lines (24 loc) · 1.3 KB

Cut out the boring stuff

Every time that release time comes around, you get uncomfortable. You do not feel safe about deploying to production. Deploying by hand always feels like that nothing is entirely the same each time.

Guess it's time to script continuous delivery?

Hint: If you already know how to run your application on the server, it should be no different getting CI tool to do it for you, as it is, in fact, executing on the server!

Task

  • Start your CI service with docker-compose up -d in folder ci
  • Set up your server as a CI executor
  • Create a script that runs the application on your server.
  • Augment your script such that you can deploy multiple versions ( eg. development, staging, production ), depending on the PR branch name

Hint: Use ip address show docker0 | grep -oP 'inet \K[\d.]+' to get ip address of the machine Replace IP from ci/jenkins.yaml This is needed so that CI can connect to your VM as executor

Extra: Vulnerability Concerns

Your workflow now executes code on the server. You're in a public repository, because you've forked one, meaning that, anyone can fork your repository as well.

If you fork a repository, you can make changes, and pull-requests, and oh no... execute arbitrary code on your server? 😱

  • discus why this is/is not a problem.