coralproject / ask

A better way for journalists to manage forms, submissions, and galleries. Because journalism needs everyone.
https://coralproject.net/products/ask.html
Other
42 stars 8 forks source link

Create RPM / DEB files for redistribution of apps #62

Closed edefikh-zz closed 8 years ago

edefikh-zz commented 8 years ago

We need to create a process for generating new binaries on our Jenkins CI and generating RPM/DEB files with new build.

edefikh-zz commented 8 years ago

I propose we create a Jenkins Job listed below for Xenia:

Setup basic environment:

wget https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz tar xfz go1.5.3.linux-amd64.tar.gz export GOPATH=$WORKSPACE/go export PATH=$PATH:$GOPATH/bin export GO15VENDOREXPERIMENT=1

export XENIA_MONGO_HOST=192.168.88.188:27017 export XENIA_MONGO_USER=coral-user export XENIA_MONGO_AUTHDB=coral export XENIA_MONGO_DB=coral

export XENIA_LOGGING_LEVEL=1 export XENIA_HOST=:4000

export XENIA_MONGO_PASS=123456

Setup Go tests go get -u github.com/golang/lint/golint

set +e go get github.com/coralproject/xenia set -e

cd "$GOPATH/src/github.com/coralproject/xenia/internal" go test ./... go vet ./...

cd "$GOPATH/src/github.com/coralproject/xenia/cmd" go test ./... go vet ./...

Create Go Build:

cd $GOPATH/src/github.com/coralproject/xenia/cmd/xenia go build cd $GOPATH/src/github.com/coralproject/xenia/cmd/xeniad BuildDate=date +"%Y-%m-%d" GIT_VER=git describe --always --dirty --tags go build -ldflags "-X main.GitVersion=${GIT_VER} -X main.GitRevision=${GIT_COMMIT} -X main.BuildDate=${BuildDate}"

Create deploy steps for Xenia server:

if [ -d "/opt/xenia" ]; then rm -rf /opt/xenia && mkdir /opt/xenia; else mkdir /opt/xenia; fi mkdir /opt/xenia/etc mkdir /opt/xenia/scripts cp /root/training /opt/xenia/scripts/xenia cp /etc/xenia/server.cfg /opt/xenia/etc cp /root/post-install /opt/xenia/scripts

Generate RPM file:

cp $GOPATH/src/github.com/coralproject/xenia/cmd/xenia/xenia /opt/xenia cp $GOPATH/src/github.com/coralproject/xenia/cmd/xeniad/xeniad /opt/xenia cd

fpm -s dir -t rpm -n xenia-pkg -v ${GIT_VER} --after-install /opt/xenia/scripts/post-install /opt/xenia

edefikh-zz commented 8 years ago

xenia-pkg-v0.2.0b_57_g01f7ce3-1.x86_64.rpm.zip

edefikh-zz commented 8 years ago

we will be working on RPM process after Makefile is complete, switching priorities per last weeks meet.

edefikh-zz commented 8 years ago

I have created RPM / DEB files for Pillar and shelf, will be uploading them from jenkins to nyt-builds S3 bucket this week

edefikh-zz commented 8 years ago

I created the first working deployment system for Shelf. Its logic is as follows

I will be testing this setup on Jenkins for the next week, if all is well, will proceed to package all apps this way.

edefikh-zz commented 8 years ago

Xenia RPM/ DEBs have been created working on Elkhorn

edefikh-zz commented 8 years ago

Cay and elkhorn RPMs are being finished this week

kgardnr commented 8 years ago

@jtnelson, we need to discuss this with you when you get a moment.