From c492bd3fb61f6ef2af7a6f2182fd16127feec5c0 Mon Sep 17 00:00:00 2001 From: Mario Ranftl Date: Thu, 1 Feb 2024 10:24:37 +0100 Subject: [PATCH] persist bash-history between development container restarts/rebuild and downgrade github.com/ericlagergren/decimal@v0.0.0-20190420051523-6335edbaa640 --- CHANGELOG.md | 8 ++++++++ Dockerfile | 7 +++++++ docker-compose.yml | 7 +++++++ go.mod | 2 +- go.sum | 3 +-- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ce2bf11..4a33af95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ - The latest `master` is considered **stable** and should be periodically merged into our customer projects. - Please follow the update process in *[I just want to update / upgrade my project!](https://github.com/allaboutapps/go-starter/wiki/FAQ#i-just-want-to-update--upgrade-my-project)*. +## Unreleased + +## 2024-02-01 +- [Persist bash history in development container](https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history) (requires `./docker-helper.sh --rebuild`). + - Your commands are now persisted between your development container restarts / rebuilds, making it easier to re-run specific commands you've previously executed (e.g. that one go command you cannot remember). +- Hotfix [types.NullDecimal error](https://github.com/volatiletech/sqlboiler/issues/1234) by downgrading indirect `github.com/ericlagergren/decimal@v0.0.0-20190420051523-6335edbaa640`. + - Note that we do not pin it in direct dependencies, as this downgrade is already in [SQLBoilers master](https://github.com/volatiletech/sqlboiler/commit/bc59c158590800f7810cce241a12d572e898014f) anyways. + ## 2024-01-31 - Migration to Docker Compose V2 ([Docker Compose Docs](https://docs.docker.com/compose/reference/)), thx [@eklatzer](https://github.com/eklatzer) - Upgrade to [IntegreSQL v1.1.0](https://github.com/allaboutapps/integresql/blob/v1.1.0/CHANGELOG.md#v110) diff --git a/Dockerfile b/Dockerfile index 69b8f256..a4c1f9cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -173,6 +173,13 @@ RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \ # Note that this should be the final step after installing all build deps RUN mkdir -p /$GOPATH/pkg && chown -R $USERNAME /$GOPATH +# https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history +RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/home/$USERNAME/commandhistory/.bash_history" \ + && mkdir /home/$USERNAME/commandhistory \ + && touch /home/$USERNAME/commandhistory/.bash_history \ + && chown -R $USERNAME /home/$USERNAME/commandhistory \ + && echo "$SNIPPET" >> "/home/$USERNAME/.bashrc" + # $GOBIN is where our own compiled binaries will live and other go.mod / VSCode binaries will be installed. # It should always come AFTER our other $PATH segments and should be earliest targeted in stage "builder", # as /app/bin will the shadowed by a volume mount via docker-compose! diff --git a/docker-compose.yml b/docker-compose.yml index 8d480230..f9c61df0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,10 @@ services: - vscode-extensions:/home/development/.vscode-server/extensions - vscode-extensions-insiders:/home/development/.vscode-server-insiders/extensions + # https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history + # keep user development .bash_history between container restarts + - bash-history:/home/development/commandhistory + depends_on: - postgres - integresql @@ -157,3 +161,6 @@ volumes: # https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild vscode-extensions: vscode-extensions-insiders: + + # https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history + bash-history: diff --git a/go.mod b/go.mod index 9a1d791c..daf4a98d 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/denisenkom/go-mssqldb v0.12.3 // indirect - github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 // indirect + github.com/ericlagergren/decimal v0.0.0-20190420051523-6335edbaa640 // indirect github.com/fatih/color v1.14.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect diff --git a/go.sum b/go.sum index 58bbd2e3..52f916a3 100644 --- a/go.sum +++ b/go.sum @@ -163,9 +163,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ericlagergren/decimal v0.0.0-20190420051523-6335edbaa640 h1:VMAacqPM03GapxpfNORtKNl9o6Uws1BQYL54WjmolN0= github.com/ericlagergren/decimal v0.0.0-20190420051523-6335edbaa640/go.mod h1:mdYyfAkzn9kyJ/kMk/7WE9ufl9lflh+2NvecQ5mAghs= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=