Files
gitea-deployment-service/test-deployment.mjs
2026-02-18 22:49:54 +01:00

37 lines
1.2 KiB
JavaScript

import { readFileSync } from 'node:fs';
const json = JSON.parse(readFileSync('test-payload.json'));
if (json.after.match(/^0+$/)) {
// This is test deployment - for now we will simply replace with 'HEAD'
}
console.log(json.after, json.repository.ssh_url);
// git --git-dir=/srv/docker/gitea.efforting.tech/gitea-data/git/repositories/mikael-lovqvist/websperiments.git worktree add /srv/deploy/<repo> <commit-sha>
// /srv/docker/gitea.efforting.tech/gitea-data/git/repositories/mikael-lovqvist/websperiments.git
/*
git clone --mirror /srv/docker/gitea.efforting.tech/gitea-data/git/repositories/mikael-lovqvist/websperiments.git
git --git-dir=/srv/docker/gitea.efforting.tech/gitea-data/git/repositories/mikael-lovqvist/websperiments.git archive refs/heads/main | tar -x -C /srv/http/sites.efforting.tech/mikael-lovqvist/websperiments
ubuntu@vps-a0ce290a:/srv/http/sites.efforting.tech$ sudo -u www-data mkdir -p mikael-lovqvist/websperiments
ubuntu@vps-a0ce290a:/srv/http/sites.efforting.tech$ sudo -u www-data git --git-dir=/srv/docker/gitea.efforting.tech/gitea-data/git/repositories/mikael-lovqvist/websperiments.git archive refs/heads/main | sudo -u www-data tar -x -C /srv/http/sites.efforting.tech/mikael-lovqvist/websperiments
*/