From 0a3aba37580b268a735808eb28df4607e2cbd25d Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sat, 30 Sep 2023 19:08:15 +0100 Subject: [PATCH] feat: replace the older script with a nix flake, gitlab pipeline incoming shortly --- flake.lock | 59 +++++++++++++++++++++++++++++++++++++ flake.nix | 20 +++++++++++++ update-renew-from-github.sh | 23 --------------- 3 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 update-renew-from-github.sh diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..128e4d5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1695837737, + "narHash": "sha256-KcqmJ5hNacLuE7fkz5586kp/vt4NLo6+Prq3DMgrxpQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "517501bcf14ae6ec47efd6a17dda0ca8e6d866f9", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..105ef01 --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "Skynet Almnui Renew"; + + inputs = { + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; + in rec { + # `nix build` + defaultPackage = pkgs.stdenv.mkDerivation { + name = "skynet-website-renew"; + src = self; + installPhase = "mkdir -p $out; cp -R src/* $out"; + }; + } + ); +} \ No newline at end of file diff --git a/update-renew-from-github.sh b/update-renew-from-github.sh deleted file mode 100644 index 45b60ce..0000000 --- a/update-renew-from-github.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh -e - -# keep the files in renew up to date with git repo -# this script will be called from a cronjob every 7 days -# cwalsh 2020-10-10 - -# ensure we are in the correct directory -cd /var/www/html/renew - -# check the repo is available -git ls-remote http://github.com/ULCompSoc/skynet.ie-renew.git -q || { echo 'Repo not available' ; exit 1; } - -# delete all files in directory except for this script -ls | grep -v update-renew-from-github.sh | xargs rm -rf -- - -# clone renew directory -git clone http://github.com/ULCompSoc/skynet.ie-renew.git - -# copy files from git repo to main directory -cp -r skynet.ie-renew/* . - -# remove the git repo from the directory -rm -rf skynet.ie-renew