mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
added package deployment
This commit is contained in:
parent
fc0a837146
commit
365ae262fe
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,6 +1,6 @@
|
||||
.*
|
||||
*~
|
||||
/bin/*
|
||||
/bin/
|
||||
/pkg/
|
||||
/main
|
||||
/*.sublime-*
|
||||
!.git*
|
||||
|
||||
2
Makefile
2
Makefile
@ -7,5 +7,7 @@ clean:
|
||||
build:
|
||||
make clean
|
||||
go build -o bin/contentserver
|
||||
package:
|
||||
cli/package.sh
|
||||
test:
|
||||
go test -v github.com/foomo/contentserver/server/repo
|
||||
|
||||
21
Vagrantfile
vendored
Normal file
21
Vagrantfile
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.network :private_network, ip: "192.168.33.99"
|
||||
config.vm.network :forwarded_port, guest: 22, host: 2299
|
||||
|
||||
config.vbguest.no_remote = true
|
||||
config.vbguest.auto_update = false
|
||||
|
||||
config.vm.define 'trusty' do |instance|
|
||||
instance.vm.box = 'ubuntu/trusty64'
|
||||
end
|
||||
|
||||
config.vm.define 'precise' do |instance|
|
||||
instance.vm.box = 'ubuntu/precise64'
|
||||
end
|
||||
|
||||
config.vm.synced_folder ".", "/vagrant"
|
||||
|
||||
end
|
||||
54
cli/package.sh
Executable file
54
cli/package.sh
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
USER="foomo"
|
||||
NAME="content-server"
|
||||
URL="http://www.foomo.org"
|
||||
DESCRIPTION="Serves content tree structures very quickly through a json socket api"
|
||||
LICENSE="LGPL-3.0"
|
||||
|
||||
ARCH="amd64"
|
||||
VERSION=`bin/content-server --version | sed 's/content-server //'`
|
||||
|
||||
PACKAGE=`pwd`/pkg
|
||||
mkdir -p $PACKAGE
|
||||
|
||||
package()
|
||||
{
|
||||
OS=$1
|
||||
ARCH=$2
|
||||
TYPE=$3
|
||||
TARGET=$4
|
||||
|
||||
# create build folder
|
||||
BUILD=`pwd`/${NAME}-${VERSION}
|
||||
mkdir -p $BUILD/usr/bin
|
||||
cp bin/${NAME} $BUILD/usr/bin/.
|
||||
|
||||
# build binary
|
||||
make clean
|
||||
GOOS=$OS GOARCH=$ARCH go build -o $BUILD/usr/bin/${NAME} contentserver.go
|
||||
|
||||
# create package
|
||||
fpm -s dir \
|
||||
-t $TYPE \
|
||||
--name $NAME \
|
||||
--maintainer $USER \
|
||||
--version $VERSION \
|
||||
--license $LICENSE \
|
||||
--description "${DESCRIPTION}" \
|
||||
--architecture $ARCH \
|
||||
--package pkg \
|
||||
--url "${URL}" \
|
||||
-C $BUILD \
|
||||
.
|
||||
|
||||
# cleanup
|
||||
rm -rf $BUILD
|
||||
|
||||
# push
|
||||
package_cloud push $TARGET $PACKAGE/${NAME}_${VERSION}_${ARCH}.${TYPE}
|
||||
}
|
||||
|
||||
package linux amd64 deb foomo/content-server/ubuntu/trusty
|
||||
|
||||
#package linux amd64 rpm
|
||||
@ -3,10 +3,11 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/foomo/contentserver/server"
|
||||
"github.com/foomo/contentserver/server/log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/foomo/contentserver/server"
|
||||
"github.com/foomo/contentserver/server/log"
|
||||
)
|
||||
|
||||
const (
|
||||
Loading…
Reference in New Issue
Block a user