-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpush-update.sh
More file actions
executable file
·25 lines (20 loc) · 928 Bytes
/
Copy pathpush-update.sh
File metadata and controls
executable file
·25 lines (20 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Get the current date and time
dt=$(date '+%Y-%m-%d %H:%M')
# Substitute current date/time into config.toml's buildDate parameter. Works in OSX, may need alteration in Linux?
sed -i'.bak' -e "s/buildDate = .*/buildDate = '${dt}'/" config.toml
# Make sure we are using the current Git branch
current=`git symbolic-ref --short -q HEAD`
git checkout ${current}
# Compile the site before copying to the new image
hugo --ignoreCache --minify --debug --verbose
# hugo --ignoreCache --ignoreVendor --minify --debug --verbose
echo "Hugo compilation is complete."
# Build a new Docker image
echo "Starting docker image build..."
docker image build -f push-update-Dockerfile --no-cache -t static-landing-update .
echo "...docker image build is complete."
# Tag the new image and push it to Docker Hub
docker login
docker tag static-landing-update mcfatem/static-landing:latest
docker push mcfatem/static-landing:latest