From dc812f58e1aeec3df43a9335dd43a5006ee96ed4 Mon Sep 17 00:00:00 2001 From: Late Night Defender Date: Sun, 19 Nov 2023 19:26:05 +0700 Subject: [PATCH] upgrade CI to use TTT woodpecker --- .woodpecker.yml | 18 ++++++++++++++++++ install.sh | 12 ++++++------ ttt-org.container | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..e457740 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,18 @@ +steps: + prepare: + image: bash + commands: + - systemctl --user stop ttt-org + - cp ttt-org.container ~/.config/containers/systemd + + container-build: + image: bash + commands: + - sed -i "s/DATE/$(date -I)/g" index.html + - sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html + - podman build -t ttt-org . + + container-deploy: + image: bash + commands: + - systemctl --user start ttt-org diff --git a/install.sh b/install.sh index 33ab4fd..d40fd55 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,10 @@ systemctl --user stop ttt-org -podman rm ttt-org --force -sed -i "s/DATE/$(date -I)/g" index.html -sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html - -podman build -t ttt-org . cp ttt-org.container ~/.config/containers/systemd systemctl --user daemon-reload + +sed -i "s/DATE/$(date -I)/g" index.html +sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html +podman build -t ttt-org . + + systemctl --user start ttt-org -podman run --name ttt-org -p 8084:80 -d ttt-org diff --git a/ttt-org.container b/ttt-org.container index f5a08ee..15722f6 100644 --- a/ttt-org.container +++ b/ttt-org.container @@ -4,7 +4,7 @@ Description=TechTransThai.org Website [Container] ContainerName=ttt-org Image=ttt-org -PublishPort=8084:80 +PublishPort=8089:80 [Service] Restart=always