aboutsummaryrefslogtreecommitdiff
path: root/src/infrastructure/scripts/cicd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/infrastructure/scripts/cicd.sh')
-rwxr-xr-xsrc/infrastructure/scripts/cicd.sh42
1 files changed, 28 insertions, 14 deletions
diff --git a/src/infrastructure/scripts/cicd.sh b/src/infrastructure/scripts/cicd.sh
index 662abd5..dd6c534 100755
--- a/src/infrastructure/scripts/cicd.sh
+++ b/src/infrastructure/scripts/cicd.sh
@@ -21,28 +21,42 @@ help() {
SHA the repository SHA to checkout (default: main)
- Run a "guix system reconfigure" as root via "sudo -i". If a -U
- flag is given, perform a "guix pull" (in root profile) prior to
- the reconfigure. The user must be able to become the "deployer"
- user, either via "sudo reconfigure" or by being member of the
- "become-deployer" group.
+ Do a CI/CD run of the project called NAME, located at
+ /srv/git/$NAME.git. If -n is given, only build, otherwise
+ also do the deploy when the build is successfull.
+
+ A "build" consists of:
+ - doing a fresh clone of the project on a temporary directory;
+ - checkout the project to version $SHA;
+ - when a "manifest.scm" file exists in the root of the project,
+ use it to launch a containerized Guix shell; otherwise use a
+ fallback template for a containerized Guix shell;
+ - build the "dev" target of the Makefile via "make dev".
+
+ A "deploy" consists of:
+ - copying the "description" metadata file to
+ /srv/git/$NAME.git/description, in order to update the project
+ repository's description;
+ - upgrading the "pre-receive" Git hook, so that future runs are
+ affected by it;
+ - copying the "public/" directory that the "dev" target built to
+ the /srv/www/s/$NAME/ directory, so that the projects "public/"
+ directory is accessible via the web address
+ "https://euandre.org/s/$NAME/".
+
+ This command must be ran as root.
Examples:
- Reconfigure the system:
+ Build and deploy the "remembering" project on the default branch:
- $ reconfigure
+ $ sudo cicd remembering
- Build the system on a custom SHA, but don't switch to it:
+ Build the "urubu" project on a specific commit, but don't deploy:
- $ reconfigure -n 916dafc092f797349a54515756f2c8e477326511
-
-
- Update and upgrade:
-
- $ reconfigure -U
+ $ sudo cicd -n urubu 916dafc092f797349a54515756f2c8e477326511
EOF
}