惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

abyss.fish thoughts

abyss * your_dotfiles_are_not_a_distro abyss * tree-style_invite_systems_reduce_AI_slop abyss * all_eyes_on_minneapolis j3s.sh j3s.sh j3s.sh j3s.sh j3s.sh j3s.sh j3s.sh j3s.sh j3s.sh
j3s.sh
2024-04-09 · via abyss.fish thoughts

↵return

my deployment platform is a shell script

another pufferfish drawn by rekka

my deployment platform is a shell script 2024-04-09 like many people, i fell in love with free software because i could install it. i'd come home from work and install a bunch of software. what fun! tee hee! a playground and i'm the prince! but eventually, relentlessly, it all starts to feel more like a horror show. proxmox needs an upgrade! *SPOOKY WIND* how the fuck does k8s work again?? *SPOOKY CRICKETS* promql *EXISTENTIAL SCREAM* i'm too old now - i'm more fickle with my time. i like things that work for years with as little interaction from me as possible. when it comes to my own projects, i always prioritize maintainability. to that end, i built a little deployment system that i run on a single virtual machine - it's a shell script! i run it every minute via cron. here's the script, in its entirety: #!/bin/sh println() { printf "%s\n" "$1" >> /root/gocicd.log } die() { printf "%s\n" "$1" >> /root/gocicd.log exit 1 } cd /root for project in $(ls go-cicd); do cd "/root/go-cicd/$project" >> /root/gocicd.log 2>&1 git fetch origin >> /root/gocicd.log 2>&1 if git status | grep -q behind; then println "$(date): building $project" git merge origin/main || git merge origin/master || die "could not merge $project" go build || die "could not build $project" mv "$project" "/usr/local/bin/$project" cat <<EOF >/etc/init.d/$project" #!/sbin/openrc-run supervisor="supervise-daemon" command="/usr/local/bin/$project" directory="/root/go-cicd/$project" EOF service "$project" restart fi done whenever i make an upstream change to any of my tracked projects, it is cloned, built, and running within 60 seconds. this gives me a lot of joy. the blog post you're reading right now was deployed using this system (j3s.sh is a go application). this has worked for many years with no maintenance at all! my script will never: - go down - require an upgrade - force me to migrate - surprise me - keep me up at night all of this makes jes very happy. digging in a little, the contents of the go-cicd dir look like this: $ ls go-cicd/ existentialcrisis.sh jackal nekobot j3s.sh vore neoarkbot these are all of my "tracked projects". to start tracking a new project, i only need to clone a repository: $ cd go-cicd $ git clone git.j3s.sh/newproject now whenever a new commit is made to git.j3s.sh/newproject, it is deployed within 60 seconds. ez. here's a little taste of the log file: $ tail -n 5 go-cicd.log Thu Feb 8 00:13:12 UTC 2024: building vore Fri Feb 9 22:08:25 UTC 2024: building vore Mon Apr 8 02:07:00 UTC 2024: building j3s.sh Mon Apr 8 02:59:00 UTC 2024: building j3s.sh Tue Apr 9 21:11:00 UTC 2024: building vore cool! i wonder what happened in march. (oh, i moved to Virginia, right) i recognize that this script is pretty limited. it can only deploy golang applications to my alpine system, but that's exactly the point i'm trying to prove: a little, specific solution might be easier to maintain and straight up more enjoyable than a larger, more general system. i spent maybe 10 minutes writing this script in December of 2021, and i'm proud of how reliable it has been. consider keeping your little things little. it worked for little old me. until next time, with love from virginia, lil jes

follow me on mastodon or bluesky!

last updated 2024-04-09T00:00:00.000Z