From fa191366f0de8e9ec3248b43f676e48814bd47bb Mon Sep 17 00:00:00 2001 From: Victoria Olivia Date: Fri, 25 Sep 2020 09:31:47 -0300 Subject: [PATCH 1/8] add env-sample file in order to describe all samples that we will have in our projects --- .env-sample | 1 + .idea/modules.xml | 8 +++ .idea/template-go-application.iml | 9 ++++ .idea/vcs.xml | 6 +++ .idea/workspace.xml | 84 +++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 .env-sample create mode 100644 .idea/modules.xml create mode 100644 .idea/template-go-application.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.env-sample b/.env-sample new file mode 100644 index 0000000..566e803 --- /dev/null +++ b/.env-sample @@ -0,0 +1 @@ +HOSTNAME= diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..567b2aa --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/template-go-application.iml b/.idea/template-go-application.iml new file mode 100644 index 0000000..5e764c4 --- /dev/null +++ b/.idea/template-go-application.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..11bebde --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1601036758195 - - - - - - - - - - true - - - - - - - - \ No newline at end of file From 0ba148ceb6796bd71e04d608cc19f293eb3e8d79 Mon Sep 17 00:00:00 2001 From: victoriavilasb Date: Fri, 25 Sep 2020 11:16:24 -0300 Subject: [PATCH 7/8] add .env as a docker arg --- .gitignore | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- Makefile | 7 +------ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f1a9c11..3fc8480 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +### Go ### # Binaries for programs and plugins *.exe *.exe~ @@ -14,5 +15,48 @@ # Dependency directories (remove the comment below to include it) # vendor/ -.env -.idea +### Go Patch ### +/vendor/ +/Godeps/ + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + + +### Intellij+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +### Ignore .env +.env \ No newline at end of file diff --git a/Makefile b/Makefile index 186d736..fbc2c8d 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,3 @@ -include .env -export $(shell sed 's/=.*//' .env) - -GOPATH=$(shell go env GOPATH) - APP_NAME := template-go-application API_PORT := 8080 GO_VERSION := 1.15 @@ -11,7 +6,7 @@ define docker_run @docker run -it --rm \ -v "$$(pwd):/app" \ -p $(API_PORT):$(API_PORT) \ - -e VAR=foo \ + --env-file .env \ --name $(APP_NAME) \ -w "/app" \ golang:$(GO_VERSION) $1 From 98c1f5f20352a3536f62fda785c2e6d33d1595d6 Mon Sep 17 00:00:00 2001 From: victoriavilasb Date: Fri, 25 Sep 2020 11:32:01 -0300 Subject: [PATCH 8/8] add the hole gitignore file --- .env-sample | 2 +- .gitignore | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 196 insertions(+), 3 deletions(-) diff --git a/.env-sample b/.env-sample index 469e645..9a790b6 100644 --- a/.env-sample +++ b/.env-sample @@ -1 +1 @@ -ENV_SAMPLE= +VAR=foo diff --git a/.gitignore b/.gitignore index 3fc8480..1a8ec9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Created by https://www.gitignore.io/api/go,vim,xcode,linux,macos,windows,intellij+all,visualstudiocode +# Edit at https://www.gitignore.io/?templates=go,vim,xcode,linux,macos,windows,intellij+all,visualstudiocode + ### Go ### # Binaries for programs and plugins *.exe @@ -30,10 +33,64 @@ .idea/**/dictionaries .idea/**/shelf +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + # Gradle .idea/**/gradle.xml .idea/**/libraries +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser ### Intellij+all Patch ### # Ignores the whole .idea folder and all .iml files @@ -41,12 +98,83 @@ .idea/ +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + ### macOS ### # General .DS_Store .AppleDouble .LSOverride +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist + +# Auto-generated tag files +tags + +# Persistent undo +[._]*.un~ + +# Coc configuration directory +.vim + ### VisualStudioCode ### .vscode/* !.vscode/settings.json @@ -58,5 +186,70 @@ # Ignore all local history of files .history -### Ignore .env -.env \ No newline at end of file +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### Xcode ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Xcode Patch +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno + +### Xcode Patch ### +**/xcshareddata/WorkspaceSettings.xcsettings + +*manager + +### .env +.env + +# End of https://www.gitignore.io/api/go,vim,xcode,linux,macos,windows,intellij+all,visualstudiocode \ No newline at end of file