diff --git a/.devcontainer/bin/download-go-mod b/.devcontainer/bin/setup-dev-env similarity index 63% rename from .devcontainer/bin/download-go-mod rename to .devcontainer/bin/setup-dev-env index 90973dfad..1ea3e9de2 100755 --- a/.devcontainer/bin/download-go-mod +++ b/.devcontainer/bin/setup-dev-env @@ -1,7 +1,11 @@ #!/usr/bin/env bash -main() { - declare PLUGIN_NAME="$1" +install-go-devtools() { + go install github.com/go-delve/delve/cmd/dlv@latest + go install honnef.co/go/tools/cmd/staticcheck@latest +} + +install-go-mods() { local plugin_root="/root/go/src/github.com/dokku/dokku/plugins" export GO111MODULE=off @@ -22,4 +26,17 @@ main() { popd >/dev/null || true } +setup-ci() { + local dokku_root="/root/go/src/github.com/dokku/dokku" + pushd "$plugin_root" >/dev/null || true + make ci-dependencies setup-deploy-tests + popd >/dev/null || true +} + +main () { + install-go-mods + install-go-devtools + setup-ci +} + main "$@" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0d5729f68..74304d1e7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,7 +19,7 @@ "source=${localWorkspaceFolder}/tmp/data/,target=/mnt/dokku/,type=bind" ], "overrideCommand": false, - "postCreateCommand": "download-go-mod && make setup-deploy-tests", + "postCreateCommand": "setup-dev-env", "runArgs": ["--init"], "workspaceFolder": "/root/go/src/github.com/dokku/dokku", "workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/root/go/src/github.com/dokku/dokku,consistency=cached"