make output/build artifact
This commit is contained in:
parent
8a029686d8
commit
cf51968fb9
|
@ -5,6 +5,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: |
|
- run: |
|
||||||
make test
|
make dist
|
||||||
# - store_artifacts:
|
- store_artifacts:
|
||||||
# path: output
|
path: output
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
fediverse-archive
|
fediverse-archive
|
||||||
|
output/
|
||||||
|
|
23
Makefile
23
Makefile
|
@ -1,9 +1,13 @@
|
||||||
VERSION := $(shell git rev-parse --short HEAD)
|
VERSION := $(shell git rev-parse --short HEAD)
|
||||||
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
|
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||||
|
BUILDTIMEFILENAME := $(shell date -u '+%Y%m%d-%H%M%SZ')
|
||||||
BUILDUSER := $(shell whoami)
|
BUILDUSER := $(shell whoami)
|
||||||
BUILDHOST := $(shell hostname -s)
|
BUILDHOST := $(shell hostname -s)
|
||||||
BUILDARCH := $(shell uname -m)
|
BUILDARCH := $(shell uname -m)
|
||||||
|
|
||||||
|
FN := fediverse-archive
|
||||||
|
IMAGENAME := sneak/$(FN)
|
||||||
|
|
||||||
GOLDFLAGS += -X main.Version=$(VERSION)
|
GOLDFLAGS += -X main.Version=$(VERSION)
|
||||||
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
|
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
|
||||||
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
|
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
|
||||||
|
@ -13,18 +17,25 @@ GOFLAGS = -ldflags "$(GOLDFLAGS)"
|
||||||
default: rundebug
|
default: rundebug
|
||||||
|
|
||||||
rundebug: build
|
rundebug: build
|
||||||
./fediverse-archive -debug
|
./$(FN) -debug
|
||||||
|
|
||||||
run: build
|
run: build
|
||||||
./fediverse-archvie
|
./$(FN)
|
||||||
|
|
||||||
build: ./fediverse-archive
|
build: ./$(FN)
|
||||||
|
|
||||||
./fediverse-archive: *.go
|
./$(FN): *.go
|
||||||
go build -o $@ $(GOFLAGS) .
|
go build -o $@ $(GOFLAGS) .
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
go fmt *.go
|
go fmt *.go
|
||||||
|
|
||||||
test:
|
test: build-docker-image
|
||||||
docker build -t sneak/fediverse-archive .
|
|
||||||
|
build-docker-image:
|
||||||
|
docker build -t $(IMAGENAME) .
|
||||||
|
|
||||||
|
dist: build-docker-image
|
||||||
|
-mkdir -p ./output
|
||||||
|
docker run --rm --entrypoint cat $(IMAGENAME) /bin/$(FN) > output/$(FN)
|
||||||
|
docker save $(IMAGENAME) | bzip2 > output/$(BUILDTIMEFILENAME).$(FN).tbz2
|
||||||
|
|
|
@ -12,6 +12,9 @@ const mastodonIndexUrl = "https://instances.social/list.json?q%5Busers%5D=&q%5Bs
|
||||||
|
|
||||||
var foreverago = time.Now().Add((-1 * 86400 * 365 * 100) * time.Second)
|
var foreverago = time.Now().Add((-1 * 86400 * 365 * 100) * time.Second)
|
||||||
|
|
||||||
|
// check with indices only hourly
|
||||||
|
var INDEX_CHECK_INTERVAL = time.Second * 60 * 60
|
||||||
|
|
||||||
// thank fuck for https://mholt.github.io/json-to-go/ otherwise
|
// thank fuck for https://mholt.github.io/json-to-go/ otherwise
|
||||||
// this would have been a giant pain in the dick
|
// this would have been a giant pain in the dick
|
||||||
type MastodonIndexResponse struct {
|
type MastodonIndexResponse struct {
|
||||||
|
@ -105,7 +108,7 @@ func (i *InstanceLocator) Locate() {
|
||||||
log.Debug().Str("lastpleromaupdate", i.pleromaIndexLastRefresh.Format(time.RFC3339)).Send()
|
log.Debug().Str("lastpleromaupdate", i.pleromaIndexLastRefresh.Format(time.RFC3339)).Send()
|
||||||
i.locateMastodon()
|
i.locateMastodon()
|
||||||
i.locatePleroma()
|
i.locatePleroma()
|
||||||
time.Sleep(30 * time.Second)
|
time.Sleep(120 * time.Second)
|
||||||
i.instanceReport()
|
i.instanceReport()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue