-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #7 from zekroTJA/dev
release 1.4
- Loading branch information
Showing
22 changed files
with
12,588 additions
and
107 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 |
---|---|---|
|
@@ -20,7 +20,6 @@ private.* | |
vendor/* | ||
|
||
node_modules | ||
package-lock.json | ||
dist | ||
bin/* | ||
|
||
|
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
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,52 +1,31 @@ | ||
FROM golang:1.13 | ||
|
||
FROM golang:1.13 as build | ||
LABEL maintainer="zekro <contact@zekro.de>" | ||
|
||
#### PREPARINGS ##### | ||
|
||
# install node.js | ||
ARG RELEASE=TRUE | ||
RUN curl -sL https://deb.nodesource.com/setup_13.x | bash - &&\ | ||
apt-get install -y nodejs | ||
|
||
# install vue CLI | ||
RUN npm i -g @vue/cli | ||
|
||
# set workdir to go application dir | ||
WORKDIR /var/myrunes | ||
|
||
# add nessecary repository files | ||
ADD . . | ||
|
||
# ensure dependencies with go mod | ||
RUN go mod tidy | ||
|
||
# install web dependencies | ||
RUN cd web &&\ | ||
npm i | ||
|
||
npm ci | ||
RUN mkdir ./bin | ||
|
||
#### BUILD BACK END #### | ||
|
||
RUN go build \ | ||
-v -o /app/myrunes -ldflags "\ | ||
-X github.com/zekroTJA/myrunes/internal/static.Release=TRUE \ | ||
-X github.com/zekroTJA/myrunes/internal/static.Release=${RELEASE} \ | ||
-X github.com/zekroTJA/myrunes/internal/static.AppVersion=$(git describe --tags)" \ | ||
./cmd/server/*.go | ||
|
||
#### BUILD FRONT END #### | ||
|
||
RUN cd ./web &&\ | ||
npm run build &&\ | ||
cd .. &&\ | ||
mkdir -p /app/web &&\ | ||
cp -r ./web/dist /app/web/dist | ||
|
||
|
||
#### EXPOSE AND RUN SETTINGS #### | ||
FROM debian:stretch-slim AS final | ||
WORKDIR /app | ||
COPY --from=build /app . | ||
|
||
EXPOSE 8080 | ||
|
||
RUN mkdir -p /etc/myrunes | ||
|
||
CMD ["/app/myrunes", "-c", "/etc/myrunes/config.yml"] | ||
CMD ["/app/myrunes", "-c", "/etc/myrunes/config.yml", "-assets", "/app/web/dist"] |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
BRANCH=${TRAVIS_BRANCH} | ||
RELEASE=TRUE | ||
|
||
if [ "${BRANCH}" == "master" ]; then | ||
BRANCH=latest | ||
fi | ||
|
||
if [ "${BRANCH}" == "dev" ]; then | ||
BRANCH=canary | ||
RELEASE=FALSE | ||
fi | ||
|
||
docker build . -t zekro/myrunes:${BRANCH} --build-arg RELEASE=${RELEASE} | ||
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} | ||
docker push zekro/myrunes:${BRANCH} |
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package comparison | ||
|
||
import "strings" | ||
|
||
func IsTrue(s string) bool { | ||
return s == "1" || strings.ToLower(s) == "true" | ||
} |
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,5 +1,5 @@ | ||
/** @format */ | ||
|
||
module.exports = { | ||
presets: [ | ||
'@vue/app' | ||
] | ||
} | ||
presets: ['@vue/app'], | ||
}; |
Oops, something went wrong.