-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from Bitspark/skip-checks
Skip checks
- Loading branch information
Showing
2 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
FROM golang:1.11 | ||
ARG slVersion | ||
ARG slBuildTime | ||
### Checkout UI, Lib and Examples and Build UI | ||
FROM node:8.12 | ||
WORKDIR /slang/ | ||
|
||
LABEL maintainer="[email protected]" | ||
# Clone examples, libs and ui | ||
RUN git clone https://github.com/Bitspark/slang-examples.git examples && \ | ||
git clone https://github.com/Bitspark/slang-lib.git lib && \ | ||
git clone https://github.com/Bitspark/slang-ui.git ui | ||
|
||
LABEL version="1" | ||
# Checkout latest lib release | ||
RUN cd lib && \ | ||
git checkout $(git describe --tags `git rev-list --tags --max-count=1`) | ||
|
||
WORKDIR /go/src/slang | ||
COPY . . | ||
# Checkout and build latest UI release | ||
RUN cd ui && \ | ||
git checkout $(git describe --tags `git rev-list --tags --max-count=1`) && \ | ||
npm install && \ | ||
./node_modules/@angular/cli/bin/ng build --base-href /app/ --prod --output-path=dist | ||
|
||
RUN go get -d -v ./... | ||
|
||
ENV ldFlagVersion "-X main.Version=${slVersion}" | ||
ENV ldFlagBuildTime "-X main.BuildTime=${slBuildTime}" | ||
ENV ldFlags "${ldFlagVersion} ${ldFlagBuildTime}" | ||
### Build daemon | ||
FROM golang:1.11 | ||
WORKDIR /go/src/slang | ||
|
||
RUN echo $ldFlags | ||
COPY . . | ||
RUN go get -d -v ./... && \ | ||
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o slangd ./cmd/slangd | ||
|
||
RUN env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "${ldFlags}" -o slangd ./cmd/slangd | ||
|
||
### Gather UI, lib and daemon and run daemon | ||
FROM alpine | ||
LABEL maintainer="[email protected]" | ||
LABEL version="1" | ||
WORKDIR /root/slang/ | ||
|
||
RUN apk --no-cache add ca-certificates | ||
WORKDIR "/root/slang/" | ||
ENV USER root | ||
ENV SLANG_PATH "/root/slang/" | ||
COPY --from=0 /go/src/slang/slangd . | ||
COPY --from=0 /slang/examples/examples projects/examples | ||
COPY --from=0 /slang/lib/slang lib/slang/ | ||
COPY --from=0 /slang/ui/dist ui/ | ||
COPY --from=1 /go/src/slang/slangd . | ||
|
||
EXPOSE 5149 | ||
EXPOSE 50001-50099 | ||
|
||
ENTRYPOINT ["/root/slang/slangd", "--only-daemon"] | ||
ENTRYPOINT ["/root/slang/slangd", "--only-daemon", "--skip-checks"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters