diff options
author | Mike Crute <mike@crute.us> | 2021-04-04 17:36:30 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2021-04-04 17:40:41 +0000 |
commit | 1dc15b897a1bbad8380211f3c36e9179255e792c (patch) | |
tree | 622fb246caee8371b77f0d91aae6829ddbde1ef2 /.bashrc_local_home | |
parent | 2534a4a3fa74b834b8e14c52def164eca8d5cf57 (diff) | |
download | dotfiles-1dc15b897a1bbad8380211f3c36e9179255e792c.tar.bz2 dotfiles-1dc15b897a1bbad8380211f3c36e9179255e792c.tar.xz dotfiles-1dc15b897a1bbad8380211f3c36e9179255e792c.zip |
Add alpine site builder
Diffstat (limited to '.bashrc_local_home')
-rw-r--r-- | .bashrc_local_home | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/.bashrc_local_home b/.bashrc_local_home index 5ba75d5..40d56b3 100644 --- a/.bashrc_local_home +++ b/.bashrc_local_home | |||
@@ -40,6 +40,36 @@ function alpine-build | |||
40 | } | 40 | } |
41 | export -f alpine-build | 41 | export -f alpine-build |
42 | 42 | ||
43 | function alpine-website | ||
44 | { | ||
45 | local image_name="alpine:edge" | ||
46 | local update_file="$HOME/.cache/alpine-build-pull" | ||
47 | |||
48 | # Pull image if no image update timestamp file | ||
49 | if [ ! -f "$update_file" ]; then | ||
50 | touch "$update_file" | ||
51 | docker pull "$image_name" | ||
52 | fi | ||
53 | |||
54 | # Pull image if we haven't pulled it in at least 3 days | ||
55 | if [ $(( $(date +%s) - $(stat -c "%Y" "$update_file") )) -gt 259200 ]; then | ||
56 | touch "$update_file" | ||
57 | docker pull "$image_name" | ||
58 | fi | ||
59 | |||
60 | docker run -ti --rm --detach-keys=ctrl-@ \ | ||
61 | --privileged \ | ||
62 | -p 8080:8080 \ | ||
63 | -v $HOME/bin:/opt/home-bin:ro \ | ||
64 | -v $HOME/.abuild:/abuild-keys:ro \ | ||
65 | -v $HOME/repos/third_party/aports:/aports \ | ||
66 | -v $HOME/.gitconfig:/opt/.gitconfig \ | ||
67 | -v $HOME/.gitconfig-personal:/opt/.gitconfig-personal \ | ||
68 | -v $HOME/repos/third_party/alpine-mksite:$HOME/alpine-mksite \ | ||
69 | "$image_name" /opt/home-bin/aport-bootstrap.sh | ||
70 | } | ||
71 | export -f alpine-website | ||
72 | |||
43 | export TERM_BG_SHADE="dark" | 73 | export TERM_BG_SHADE="dark" |
44 | 74 | ||
45 | alias mfi-ssh="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -l admin " | 75 | alias mfi-ssh="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -l admin " |