diff --git a/.drone.yml b/.drone.yml index 9b1de4d..8c9ba07 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,9 +12,9 @@ steps: - name: docker image: plugins/docker settings: - repo: registry.while-false.de/blog username: stephan password: eRFJ1R7UNo5zv1FFvLzv + repo: registry.while-false.de/blog tags: - 'latest' - '1.3.0' \ No newline at end of file diff --git a/content/blog/003-writing-articles/drone-ci.png b/content/blog/003-writing-articles/drone-ci.png new file mode 100644 index 0000000..f7022a7 Binary files /dev/null and b/content/blog/003-writing-articles/drone-ci.png differ diff --git a/content/blog/003-writing-articles/index.md b/content/blog/003-writing-articles/index.md index a9a8306..2e03bdc 100644 --- a/content/blog/003-writing-articles/index.md +++ b/content/blog/003-writing-articles/index.md @@ -70,6 +70,7 @@ steps: - name: build image: node:alpine commands: + - npm install - npx gatsby build - name: docker @@ -83,15 +84,17 @@ steps: - '1.3.0' ``` -For now I only require two steps: +For now I only require three steps: -1. build the gatsby project -2. build the new docker image and push it to the registry +1. install node.js dependencies +2. build the gatsby project +3. build the new docker image and push it to the registry An additional benefit of the drone build is this beatiful badge, every project has nowadays, conveniently prepared as markdown: + [![Build Status](https://drone.while-false.de/api/badges/stephan/blog/status.svg)](https://drone.while-false.de/stephan/blog) -```markdown -[![Build Status](https://drone.while-false.de/api/badges/stephan/blog/status.svg)](https://drone.while-false.de/stephan/blog) -``` + +Also, It has nice visualization of the build process with logs for debugging in case it's needed: +![Drone-CI UI](./drone-ci.png) Then, the last required step is to update the running container to the new version. The event on which to react would be the upload to the registry. There are some ways to handle this myself using webhooks, but as with the build trigger I decided to take a route a little more convenient: use [Watchtower](https://containrrr.github.io/watchtower). I tried watchtower before and don't feel comfortable blindly updating every container I run, so I [configure it to just watch the one blog container and update that automatically](https://containrrr.github.io/watchtower/container-selection/). As I am the only one pushing updates of the image for the blog I can take precautions when I know something will break.