Skip to content

Commit 14720bc

Browse files
author
Aldo Borrero
committed
feat: initial commit
0 parents  commit 14720bc

23 files changed

+1089
-0
lines changed

.editorconfig

Whitespace-only changes.

.gitignore

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Go template
3+
# Binaries for programs and plugins
4+
*.exe
5+
*.exe~
6+
*.dll
7+
*.so
8+
*.dylib
9+
10+
# Test binary, built with `go test -c`
11+
*.test
12+
13+
# Output of the go coverage tool, specifically when used with LiteIDE
14+
*.out
15+
16+
# Dependency directories (remove the comment below to include it)
17+
# vendor/
18+
19+
### JetBrains template
20+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
21+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
22+
23+
# User-specific stuff
24+
.idea/**/workspace.xml
25+
.idea/**/tasks.xml
26+
.idea/**/usage.statistics.xml
27+
.idea/**/dictionaries
28+
.idea/**/shelf
29+
30+
# Generated files
31+
.idea/**/contentModel.xml
32+
33+
# Sensitive or high-churn files
34+
.idea/**/dataSources/
35+
.idea/**/dataSources.ids
36+
.idea/**/dataSources.local.xml
37+
.idea/**/sqlDataSources.xml
38+
.idea/**/dynamic.xml
39+
.idea/**/uiDesigner.xml
40+
.idea/**/dbnavigator.xml
41+
42+
# Gradle
43+
.idea/**/gradle.xml
44+
.idea/**/libraries
45+
46+
# Gradle and Maven with auto-import
47+
# When using Gradle or Maven with auto-import, you should exclude module files,
48+
# since they will be recreated, and may cause churn. Uncomment if using
49+
# auto-import.
50+
# .idea/artifacts
51+
# .idea/compiler.xml
52+
# .idea/modules.xml
53+
# .idea/*.iml
54+
# .idea/modules
55+
# *.iml
56+
# *.ipr
57+
58+
# CMake
59+
cmake-build-*/
60+
61+
# Mongo Explorer plugin
62+
.idea/**/mongoSettings.xml
63+
64+
# File-based project format
65+
*.iws
66+
67+
# IntelliJ
68+
out/
69+
70+
# mpeltonen/sbt-idea plugin
71+
.idea_modules/
72+
73+
# JIRA plugin
74+
atlassian-ide-plugin.xml
75+
76+
# Cursive Clojure plugin
77+
.idea/replstate.xml
78+
79+
# Crashlytics plugin (for Android Studio and IntelliJ)
80+
com_crashlytics_export_strings.xml
81+
crashlytics.properties
82+
crashlytics-build.properties
83+
fabric.properties
84+
85+
# Editor-based Rest Client
86+
.idea/httpRequests
87+
88+
# Android studio 3.1+ serialized cache file
89+
.idea/caches/build_file_checksums.ser
90+
91+
# Created by https://www.gitignore.io/api/go
92+
# Edit at https://www.gitignore.io/?templates=go
93+
94+
### Go ###
95+
# Binaries for programs and plugins
96+
bin/
97+
*.exe
98+
*.exe~
99+
*.dll
100+
*.so
101+
*.dylib
102+
103+
# Test binary, built with `go test -c`
104+
*.test
105+
106+
# Output of the go coverage tool, specifically when used with LiteIDE
107+
*.out
108+
109+
# Dependency directories (remove the comment below to include it)
110+
# vendor/
111+
112+
### Go Patch ###
113+
/vendor/
114+
/Godeps/
115+
116+
# End of https://www.gitignore.io/api/go

.idea/.gitignore

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM golang:1.13.7-alpine AS binary
2+
3+
ENV WORKDIR /go/src/github.com/41North/kompoze
4+
5+
WORKDIR $WORKDIR
6+
7+
RUN apk -U add openssl git
8+
9+
COPY . $WORKDIR
10+
11+
RUN go install $WORKDIR/cmd/kompoze/main.go
12+
13+
FROM alpine:3.10
14+
15+
COPY --from=binary /go/bin/main /usr/local/bin/kompoze
16+
17+
RUN chmod +x /usr/local/bin/kompoze
18+
19+
ENTRYPOINT ["kompoze"]
20+
CMD ["--help"]

LICENSE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
===============
3+
4+
Copyright (c) 2020 41North
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

Makefile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.SILENT :
2+
.PHONY : deps install build build-prod
3+
4+
PROJECT_NAME=$(shell basename "$(PWD)")
5+
6+
GO_BASE=$(shell pwd)
7+
GO_BIN=$(GO_BASE)/bin
8+
9+
VERSION:=1.0.0
10+
LDFLAGS:=-s -w -X main.VERSION=$(TAG)
11+
12+
all: install
13+
14+
deps:
15+
go mod download
16+
17+
install:
18+
go install ./cmd/$(PROJECT_NAME)/main.go
19+
20+
build:
21+
go build -ldflags="-X main.VERSION=$(VERSION)" -o $(GO_BIN)/$(PROJECT_NAME) ./cmd/$(PROJECT_NAME)/main.go
22+
23+
build-prod:
24+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $(GO_BIN)/$(PROJECT_NAME) ./cmd/$(PROJECT_NAME)/main.go
25+
26+
docker:
27+
docker build -t 41north/kompoze:"$(VERSION)" .
28+
docker build -t 41north/kompoze:latest .
29+
30+
docker-push:
31+
docker push 41north/kompoze:"$(VERSION)"
32+
docker push 41north/kompoze:latest
33+
34+
dist-clean:
35+
rm -rf dist
36+
rm -f docker-templates-*.tar.gz
37+
38+
dist: dist-clean deps
39+
mkdir -p dist/alpine-linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -a -tags netgo -installsuffix netgo -o dist/alpine-linux/amd64/docker-templates
40+
mkdir -p dist/linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/linux/amd64/docker-templates
41+
mkdir -p dist/linux/386 && GOOS=linux GOARCH=386 go build -ldflags "$(LDFLAGS)" -o dist/linux/386/docker-templates
42+
mkdir -p dist/linux/armel && GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "$(LDFLAGS)" -o dist/linux/armel/docker-templates
43+
mkdir -p dist/linux/armhf && GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "$(LDFLAGS)" -o dist/linux/armhf/docker-templates
44+
mkdir -p dist/darwin/amd64 && GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/darwin/amd64/docker-templates
45+
46+
release: dist
47+
tar -cvzf dockerize-alpine-linux-amd64-$(TAG).tar.gz -C dist/alpine-linux/amd64 docker-templates
48+
tar -cvzf dockerize-linux-amd64-$(TAG).tar.gz -C dist/linux/amd64 docker-templates
49+
tar -cvzf dockerize-linux-386-$(TAG).tar.gz -C dist/linux/386 docker-templates
50+
tar -cvzf dockerize-linux-armel-$(TAG).tar.gz -C dist/linux/armel docker-templates
51+
tar -cvzf dockerize-linux-armhf-$(TAG).tar.gz -C dist/linux/armhf docker-templates
52+
tar -cvzf dockerize-darwin-amd64-$(TAG).tar.gz -C dist/darwin/amd64 docker-templates

0 commit comments

Comments
 (0)