1 import ./make-test-python.nix (
5 meta.maintainers = with pkgs.lib.maintainers; [ marie natsukium ];
14 endpoint = "http://localhost:3000";
16 gitAuthor = "Renovate <renovate@example.com>";
19 RENOVATE_TOKEN = "/etc/renovate-token";
22 environment.systemPackages = [
23 config.services.forgejo.package
29 settings.server.HTTP_PORT = 3000;
35 return machine.succeed(f"cd /var/lib/forgejo && sudo --user=forgejo GITEA_WORK_DIR=/var/lib/forgejo GITEA_CUSTOM=/var/lib/forgejo/custom gitea {command}")
37 machine.wait_for_unit("forgejo.service")
38 machine.wait_for_open_port(3000)
40 machine.systemctl("stop forgejo.service")
42 gitea("admin user create --username meow --email meow@example.com --password meow")
44 machine.systemctl("start forgejo.service")
45 machine.wait_for_unit("forgejo.service")
46 machine.wait_for_open_port(3000)
48 accessToken = gitea("admin user generate-access-token --raw --username meow --scopes all | tr -d '\n'")
50 machine.succeed(f"tea login add --name default --user meow --token '{accessToken}' --password meow --url http://localhost:3000")
51 machine.succeed("tea repo create --name kitty --init")
52 machine.succeed("git config --global user.name Meow")
53 machine.succeed("git config --global user.email meow@example.com")
54 machine.succeed(f"git clone http://meow:{accessToken}@localhost:3000/meow/kitty.git /tmp/kitty")
55 machine.succeed("echo '{ \"name\": \"meow\", \"version\": \"0.1.0\" }' > /tmp/kitty/package.json")
56 machine.succeed("git -C /tmp/kitty add /tmp/kitty/package.json")
57 machine.succeed("git -C /tmp/kitty commit -m 'add package.json'")
58 machine.succeed("git -C /tmp/kitty push origin")
60 machine.succeed(f"echo '{accessToken}' > /etc/renovate-token")
61 machine.systemctl("start renovate.service")
63 machine.succeed("tea pulls list --repo meow/kitty | grep 'Configure Renovate'")
64 machine.succeed("tea pulls merge --repo meow/kitty 1")
66 machine.systemctl("start renovate.service")