Commit f92915ec authored by zauberstuhl's avatar zauberstuhl

testing_ganggo; Implement PRREPO and PRSHA

GangGo can therefore use the github integration
see https://github.com/thefederationinfo/github-integration
parent 10a07568
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND noninteractive
ENV GOROOT /opt/go
ENV GOPATH $HOME/.golang
ENV PATH $PATH:$GOPATH/bin:$GOROOT/bin
ENV VERSION v0-alpha.42
ENV BIN updater.linux-amd64.alpha
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install curl
RUN mkdir /ganggo
WORKDIR /ganggo
RUN apt-get install -y curl git-core make gcc
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
RUN curl -LO https://github.com/ganggo/ganggo/releases/download/${VERSION}/${BIN}
RUN cd /opt && curl -LO https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz
RUN cd /opt && tar xvfs go1.9.4.linux-amd64.tar.gz
RUN rm /opt/go1.9.4.linux-amd64.tar.gz
RUN apt-get -y purge curl
RUN apt-get clean && apt-get autoclean
RUN go get -d github.com/ganggo/ganggo
WORKDIR $GOPATH/src/github.com/ganggo/ganggo
RUN chmod +x /ganggo/${BIN}
RUN make install
RUN make precompile
COPY start.sh /start.sh
COPY app.conf /ganggo/app.conf
COPY app.conf $GOPATH/src/github.com/ganggo/ganggo/conf/app.conf
CMD ["/bin/bash", "/start.sh"]
#!/bin/bash
cd /ganggo \
&& sed -i "s/NAME/$DATABASE/g" app.conf \
&& sed -i "s/PORT/$PORT/g" app.conf \
&& /ganggo/${BIN} -channel disable -mode dev
repo=$GOPATH/src/github.com/ganggo/ganggo
if [ ! -z ${PRSHA} ]; then
user=$(echo $PRREPO |cut -d'/' -f1)
userrepo=$(echo $PRREPO |cut -d'/' -f2)
wd=$repo
if [ "$userrepo" -eq "federation" ]; then
wd=$repo/vendor/github.com/ganggo/federation
fi
cd $wd \
&& git remote add custom https://github.com/$user/$userrepo.git \
&& git fetch custom \
&& git checkout $PRSHA \
&& git log -1
fi
sed -i "s/NAME/$DATABASE/g" $repo/conf/app.conf \
&& sed -i "s/PORT/$PORT/g" $repo/conf/app.conf \
&& revel run github.com/ganggo/ganggo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment