Skip to content

Commit

Permalink
Add go.mod/go.sum
Browse files Browse the repository at this point in the history
This fixes build issues with:

 * go-bindata, which attempted a go get ...
 * pinning ikeikeikeike/go-sitemap-generator to 1.0.1 instead of master
 * replace all go-get with go build -o tmpbin/
  • Loading branch information
sheenobu committed Jan 8, 2019
1 parent a686b61 commit 4090e3a
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,5 +5,6 @@
build
config.ini
*.db
/tmp

bindata.go
1 change: 0 additions & 1 deletion Dockerfile
Expand Up @@ -10,7 +10,6 @@ COPY . .
RUN make assets
RUN make install
RUN make ui
RUN make deps

RUN mkdir /stage && \
cp -R /go/bin \
Expand Down
55 changes: 24 additions & 31 deletions Makefile
@@ -1,37 +1,37 @@
GITREV=`git describe --tags | cut -c 2-`
LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'"

GOCMD=go
GOCMD=env GO111MODULE=on go
GOINSTALL=$(GOCMD) install $(LDFLAGS)
GOBUILD=$(GOCMD) build $(LDFLAGS)
GOTEST=$(GOCMD) test $(LDFLAGS)
GOGET=$(GOCMD) get
BINARY_NAME=writefreely
DOCKERCMD=docker
IMAGE_NAME=writeas/writefreely
TMPBIN=./tmp

all : build

build: assets deps
build: assets
cd cmd/writefreely; $(GOBUILD) -v -tags='sqlite'

build-linux: deps
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GOGET) -u github.com/karalabe/xgo; \
fi
xgo --targets=linux/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
$(TMPBIN):
mkdir -p $(TMPBIN)

build-windows: deps
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GOGET) -u github.com/karalabe/xgo; \
fi
xgo --targets=windows/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
$(TMPBIN)/xgo: $(TMPBIN)
$(GOBUILD) -o $(TMPBIN)/xgo github.com/karalabe/xgo

build-darwin: deps
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GOGET) -u github.com/karalabe/xgo; \
fi
xgo --targets=darwin/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
$(TMPBIN)/go-bindata: $(TMPBIN)
$(GOBUILD) -o $(TMPBIN)/go-bindata github.com/jteeuwen/go-bindata/go-bindata

build-linux: $(TMPBIN)/xgo
$(TMPBIN)/xgo --targets=linux/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely

build-windows: $(TMPBIN)/xgo
$(TMPBIN)/xgo --targets=windows/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely

build-darwin: $(TMPBIN)/xgo
$(TMPBIN)/xgo --targets=darwin/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely

build-docker :
$(DOCKERCMD) build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) .
Expand All @@ -43,9 +43,6 @@ run: dev-assets
$(GOINSTALL) -tags='sqlite' ./...
$(BINARY_NAME) --debug

deps :
$(GOGET) -tags='sqlite' -v ./...

install : build
cmd/writefreely/$(BINARY_NAME) --gen-keys
cd less/; $(MAKE) install $(MFLAGS)
Expand Down Expand Up @@ -76,20 +73,16 @@ release-docker :
ui : force_look
cd less/; $(MAKE) $(MFLAGS)

assets : generate
go-bindata -pkg writefreely -ignore=\\.gitignore schema.sql sqlite.sql

dev-assets : generate
go-bindata -pkg writefreely -ignore=\\.gitignore -debug schema.sql sqlite.sql
assets : $(TMPBIN)/go-bindata
$(TMPBIN)/go-bindata -pkg writefreely -ignore=\\.gitignore schema.sql sqlite.sql

generate :
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GOGET) -u github.com/jteeuwen/go-bindata/...; \
fi
dev-assets : $(TMPBIN)/go-bindata
$(TMPBIN)/go-bindata -pkg writefreely -ignore=\\.gitignore -debug schema.sql sqlite.sql

clean :
-rm -rf build
-rm -rf tmp
cd less/; $(MAKE) clean $(MFLAGS)

force_look :
force_look :
true
55 changes: 55 additions & 0 deletions go.mod
@@ -0,0 +1,55 @@
module github.com/writeas/writefreely

require (
github.com/Unknwon/com v0.0.0-20181010210213-41959bdd855f // indirect
github.com/Unknwon/i18n v0.0.0-20171114194641-b64d33658966 // indirect
github.com/beevik/etree v1.0.1 // indirect
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737 // indirect
github.com/captncraig/cors v0.0.0-20180620154129-376d45073b49 // indirect
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/fatih/structs v1.1.0 // indirect
github.com/go-macaron/cache v0.0.0-20151013081102-561735312776 // indirect
github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191 // indirect
github.com/go-macaron/session v0.0.0-20181205003248-092353907b3c // indirect
github.com/go-sql-driver/mysql v1.4.1
github.com/gogits/gogs v0.11.79
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 // indirect
github.com/gogs/go-libravatar v0.0.0-20161120025154-cd1abbd55d09 // indirect
github.com/gogs/gogs v0.11.79 // indirect
github.com/gorilla/feeds v1.1.0
github.com/gorilla/mux v1.6.2
github.com/gorilla/schema v1.0.2
github.com/gorilla/sessions v1.1.3
github.com/guregu/null v3.4.0+incompatible
github.com/ikeikeikeike/go-sitemap-generator v1.0.1+incompatible
github.com/imdario/mergo v0.3.6 // indirect
github.com/jteeuwen/go-bindata v3.0.7+incompatible // indirect
github.com/karalabe/xgo v0.0.0-20181007145344-72da7d1d3970 // indirect
github.com/kylemcc/twitter-text-go v0.0.0-20180726194232-7f582f6736ec
github.com/manifoldco/promptui v0.3.2
github.com/mattn/go-sqlite3 v1.10.0
github.com/mcuadros/go-version v0.0.0-20180611085657-6d5863ca60fa // indirect
github.com/microcosm-cc/bluemonday v1.0.2
github.com/mitchellh/go-wordwrap v1.0.0
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/writeas/activity v0.1.2-0.20181116004047-126007f8df70
github.com/writeas/go-strip-markdown v0.0.0-20180226051418-6e12ec30f699
github.com/writeas/go-webfinger v0.0.0-20190106002315-85cf805c86d2
github.com/writeas/httpsig v0.0.0-20180701155151-b11faad21af2
github.com/writeas/impart v1.1.0
github.com/writeas/monday v0.0.0-20181024183321-54a7dd579219
github.com/writeas/nerds v0.0.0-20170323014327-3d35bb996a1f
github.com/writeas/openssl-go v0.0.0-20180626225423-b9436c10029a // indirect
github.com/writeas/saturday v0.0.0-20170402010311-f455b05c043f
github.com/writeas/slug v1.2.0
github.com/writeas/web-core v0.0.0-20181224184821-4cb17a6518fd
github.com/writefreely/go-nodeinfo v0.0.0-20181217062058-1ce249450d5e
gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e // indirect
gopkg.in/clog.v1 v1.2.0 // indirect
gopkg.in/ini.v1 v1.41.0
gopkg.in/macaron.v1 v1.3.2 // indirect
gopkg.in/redis.v2 v2.3.2 // indirect
)

0 comments on commit 4090e3a

Please sign in to comment.