mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
updated build script
This commit is contained in:
parent
f580db3dc2
commit
1e28d0306b
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
.*
|
||||
*~
|
||||
/bin/
|
||||
/pkg/
|
||||
/main
|
||||
/pkg/tmp/
|
||||
!.git*
|
||||
|
||||
11
Makefile
11
Makefile
@ -1,13 +1,12 @@
|
||||
SHELL := /bin/bash
|
||||
|
||||
options:
|
||||
echo "you can clean | test | build | run"
|
||||
echo "you can clean | test | build | run | package"
|
||||
clean:
|
||||
rm -f bin/content-server
|
||||
build:
|
||||
make clean
|
||||
build: clean
|
||||
go build -o bin/content-server
|
||||
package: clean build
|
||||
cli/package.sh
|
||||
package: build
|
||||
pkg/build.sh
|
||||
test:
|
||||
go test -v github.com/foomo/contentserver/server/repo
|
||||
go test -v github.com/foomo/contentserver/server/repo
|
||||
|
||||
36
README.md
36
README.md
@ -1,7 +1,6 @@
|
||||
Content Server
|
||||
===========
|
||||
# Content Server
|
||||
|
||||
Serves content tree structures very quickly through a json socket api
|
||||
> Serves content tree structures very quickly through a json socket api
|
||||
|
||||
## Concept
|
||||
|
||||
@ -41,3 +40,34 @@ All you have to do is to provide a tree of content nodes as a JSON encoded RepoN
|
||||
|
||||
There is a PHP Proxy implementation for foomo in [Foomo.ContentServer](https://github.com/foomo/Foomo.ContentServer). Feel free to use it or to implement your own proxy in the language you love. The API should be easily to implement in every other framework and language, too.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
$ content-server --help
|
||||
|
||||
Usage of bin/content-server:
|
||||
-address="127.0.0.1:8081": address to bind host:port
|
||||
-logLevel="record": one of error, record, warning, notice, debug
|
||||
-protocol="tcp": what protocol to server for
|
||||
-vardir="127.0.0.1:8081": where to put my data
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
```
|
||||
$ git clone https://github.com/foomo/contentserver.git
|
||||
$ cd content-server
|
||||
$ make test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
|
||||
|
||||
1. Fork it
|
||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. Create new Pull Request
|
||||
|
||||
## License
|
||||
Copyright (c) foomo under the LGPL 3.0 license.
|
||||
@ -6,11 +6,12 @@ URL="http://www.foomo.org"
|
||||
DESCRIPTION="Serves content tree structures very quickly through a json socket api."
|
||||
LICENSE="LGPL-3.0"
|
||||
|
||||
ARCH="amd64"
|
||||
# get version
|
||||
VERSION=`bin/content-server --version | sed 's/content-server //'`
|
||||
|
||||
PACKAGE=`pwd`/pkg
|
||||
mkdir -p $PACKAGE
|
||||
# create temp dir
|
||||
TEMP=`pwd`/pkg/tmp
|
||||
mkdir -p $TEMP
|
||||
|
||||
package()
|
||||
{
|
||||
@ -19,13 +20,18 @@ package()
|
||||
TYPE=$3
|
||||
TARGET=$4
|
||||
|
||||
# copy license file
|
||||
cp LICENSE $LICENSE
|
||||
|
||||
# define source dir
|
||||
SOURCE=`pwd`/pkg/${TYPE}
|
||||
|
||||
# create build folder
|
||||
BUILD=`pwd`/${NAME}-${VERSION}
|
||||
mkdir -p $BUILD/usr/bin
|
||||
cp bin/${NAME} $BUILD/usr/bin/.
|
||||
BUILD=${TEMP}/${NAME}-${VERSION}
|
||||
#rsync -rv --exclude **/.git* --exclude /*.sh $SOURCE/ $BUILD/
|
||||
|
||||
# build binary
|
||||
GOOS=$OS GOARCH=$ARCH go build -o $BUILD/usr/bin/${NAME} contentserver.go
|
||||
GOOS=$OS GOARCH=$ARCH go build -o $BUILD/usr/local/bin/${NAME}
|
||||
|
||||
# create package
|
||||
fpm -s dir \
|
||||
@ -36,16 +42,17 @@ package()
|
||||
--license $LICENSE \
|
||||
--description "${DESCRIPTION}" \
|
||||
--architecture $ARCH \
|
||||
--package pkg \
|
||||
--package $TEMP \
|
||||
--url "${URL}" \
|
||||
-C $BUILD \
|
||||
.
|
||||
|
||||
# cleanup
|
||||
rm -rf $BUILD
|
||||
|
||||
# push
|
||||
package_cloud push $TARGET $PACKAGE/${NAME}_${VERSION}_${ARCH}.${TYPE}
|
||||
package_cloud push $TARGET $TEMP/${NAME}_${VERSION}_${ARCH}.${TYPE}
|
||||
|
||||
# cleanup
|
||||
rm -rf $TEMP
|
||||
rm $LICENSE
|
||||
}
|
||||
|
||||
package linux amd64 deb foomo/content-server/ubuntu/trusty
|
||||
Loading…
Reference in New Issue
Block a user