Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 2.47 KB

README.md

File metadata and controls

53 lines (41 loc) · 2.47 KB

summittdweller-landing-page

This project defines the landing page for my summittdweller.com server.

Deploying this Site

This site is intended to be deployed using my docker-bootstrap approach, and the command stream used to launch the page on my DigitalOcean Docker droplet is:

NAME=summittdweller-landing-page
HOST=summittdweller.com
IMAGE="summittdweller/summittdweller-landing"
docker container run -d --name ${NAME} \
    --label traefik.backend=${NAME} \
    --label traefik.docker.network=web \
    --label "traefik.frontend.rule=Host:${HOST}" \
    --label traefik.port=80 \
    --label com.centurylinklabs.watchtower.enable=true \
    --network web \
    --restart always \
    ${IMAGE}

Updating This Site

The process of adding a site, or any addition/change, to this page is pretty straightforward...

cd ~/Projects/summittdweller-landing-page
docker image build -t new-img .
docker login
docker tag new-img summittdweller/summittdweller-landing:latest
docker push summittdweller/summittdweller-landing:latest

Watchtower should automagically take care of the rest!

An Even Easier Update

Not long ago I added the Atom Shell Commands package to my Atom config, added a command named Push a Static Update, and pointed that command at the push_update.sh script that is now part of this project. That bash script, does just a few things, and it reads like this:

#!/bin/bash
cd ~/Projects/summittdweller-landing-page
perl -i.bak -lpe 'BEGIN { sub inc { my ($num) = @_; ++$num } } s/(build = )(\d+)/$1 . (inc($2))/eg' config.toml
docker image build -t landing-update .
docker login
docker tag landing-update mcfatem/summittdweller-landing:latest
docker push mcfatem/summittdweller-landing:latest

The perl... line runs a text substitution that opens the project's config.toml file, parses it looking for a string that matches build = followed by an integer. The substitution increments that interger by one and puts the result back into an updated config.toml file. The result is eventually the Build 14, or whatever number, that you see just below the site title and descriptions.

The rest of the push_update.sh script is responsible for building a new docker image, logging in to Docker Hub, tagging the new image as the :latest version of summittdweller-landing, and pushing that new tagged image to my Docker Hub account where Watchtower can do its thing.