FROM docker.pkgs.xarth.tv/devtools/bionic/go1.15.6:latest

# Set Up GoPath
RUN mkdir -p /go/src \
  && mkdir -p /go/bin \
  && mkdir -p /go/pkg
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:$PATH

# Create folder for app code and move the files into it
RUN mkdir -p $GOPATH/src/code.justin.tv/qe/ci_trigger
ADD . $GOPATH/src/code.justin.tv/qe/ci_trigger

# Set the working directory to the source code folder
WORKDIR $GOPATH/src/code.justin.tv/qe/ci_trigger

RUN go build -o ci_trigger .

CMD ["/go/src/code.justin.tv/qe/ci_trigger/ci_trigger"]
