Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
dockerfile update
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Dec 3, 2019
1 parent b1432fa commit 2f7abad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 7 additions & 1 deletion Dockerfile
Expand Up @@ -4,7 +4,13 @@
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache git
WORKDIR /root/cloud-torrent
RUN git clone https://github.com/boypt/cloud-torrent.git .
ENV PATH=$HOME/go/bin:$PATH
RUN git clone https://github.com/boypt/cloud-torrent.git . && \
go get -v -u github.com/shuLhan/go-bindata/... && \
go get -v -t -d ./... && \
cd static && \
sh generate.sh

ENV GO111MODULE=on CGO_ENABLED=0
RUN go build -ldflags "-s -w -X main.VERSION=$(git describe --tags)" -o /usr/local/bin/cloud-torrent
############################
Expand Down
14 changes: 6 additions & 8 deletions static/generate.sh
@@ -1,12 +1,10 @@
#!/bin/bash
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd ${__dir}
#!/bin/sh
GITVER=$(git describe --tags)
sed -i "s/CLDVER/${GITVER}/g" \
${__dir}/files/index.html \
${__dir}/files/sub/magadded.html \
${__dir}/files/template/downloads.html \
${__dir}/files/css/app.css
files/index.html \
files/sub/magadded.html \
files/template/downloads.html \
files/css/app.css

go generate
git checkout -- ${__dir}/files
git checkout -- files

0 comments on commit 2f7abad

Please sign in to comment.