diff --git a/ci-root.nix b/ci-root.nix index 54f4e9a8fd..c789b35039 100644 --- a/ci-root.nix +++ b/ci-root.nix @@ -9,6 +9,11 @@ let prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; }); ciMachines = prefixAttrs "machine" depot.ops.nixos; ciPackages = prefixAttrs "pkg" depot.nix.pkgs; -in -pkgs.linkFarm "ci" (ciMachines ++ ciPackages) + + ciOther = prefixAttrs "other" { + twitterchiver = depot.go.twitterchiver; + twitterchiverDocker = depot.go.twitterchiver.dockerImage; + }; +in +pkgs.linkFarm "ci" (ciMachines ++ ciPackages ++ ciOther) diff --git a/default.nix b/default.nix index a0e093f50a..805f49b9f1 100644 --- a/default.nix +++ b/default.nix @@ -19,6 +19,7 @@ in fix (self: ops = import ./ops ch; nix = import ./nix ch; web = import ./web ch; + go = import ./go ch; lib = self.third_party.nixpkgs.lib; diff --git a/go/default.nix b/go/default.nix new file mode 100644 index 0000000000..ed3dc09233 --- /dev/null +++ b/go/default.nix @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +args: { + twitterchiver = import ./twitterchiver args; +} diff --git a/go/twitterchiver/archiver/Dockerfile b/go/twitterchiver/archiver/Dockerfile index d713a57269..2fb5c0b11d 100644 --- a/go/twitterchiver/archiver/Dockerfile +++ b/go/twitterchiver/archiver/Dockerfile @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# SPDX-License-Identifier: Apache-2.0 + FROM golang:1.13-buster as build RUN mkdir /go/src/app diff --git a/go/twitterchiver/archiver/archiver.go b/go/twitterchiver/archiver/archiver.go index 70f26f8aef..94f57e5788 100644 --- a/go/twitterchiver/archiver/archiver.go +++ b/go/twitterchiver/archiver/archiver.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2020 Luke Granger-Brown +// +// SPDX-License-Identifier: Apache-2.0 package main import ( diff --git a/go/twitterchiver/archiver/schema.sql b/go/twitterchiver/archiver/schema.sql index 43e0f78e3b..70299b2227 100644 --- a/go/twitterchiver/archiver/schema.sql +++ b/go/twitterchiver/archiver/schema.sql @@ -1,3 +1,7 @@ +-- SPDX-FileCopyrightText: 2020 Luke Granger-Brown +-- +-- SPDX-License-Identifier: Apache-2.0 + CREATE TABLE tweets ( id BIGINT NOT NULL, text TEXT NOT NULL, diff --git a/go/twitterchiver/default.nix b/go/twitterchiver/default.nix new file mode 100644 index 0000000000..af1bfe8f69 --- /dev/null +++ b/go/twitterchiver/default.nix @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: depot.third_party.buildGo.program { + name = "twitterchiver"; + srcs = [ ./archiver/archiver.go ]; + deps = [ + depot.third_party.gopkgs."github.com".dghubble.oauth1 + depot.third_party.gopkgs."github.com".jackc.pgx.v4 + ]; +} diff --git a/go/twitterchiver/go.mod b/go/twitterchiver/go.mod index af962fe27c..456af944e6 100644 --- a/go/twitterchiver/go.mod +++ b/go/twitterchiver/go.mod @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2020 Luke Granger-Brown +// +// SPDX-License-Identifier: Apache-2.0 + module github.com/lukegb/twitterchiver go 1.14 diff --git a/go/twitterchiver/go.sum.license b/go/twitterchiver/go.sum.license new file mode 100644 index 0000000000..2f3858abae --- /dev/null +++ b/go/twitterchiver/go.sum.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2020 Luke Granger-Brown +SPDX-License-Identifier: Apache-2.0