Merge pull request #6429 from dokku/josegonzalez-patch-1

feat: use go.work for development purposes
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2024-01-17 02:20:59 -05:00
commit 555bcbaf1f
4 files changed
+28 -27

No files matched your search

-22
View File
@@ -5,27 +5,6 @@ install-go-devtools() {
go install honnef.co/go/tools/cmd/staticcheck@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
echo "-----> Fetching onsi/gomega dependency for tests"
go get github.com/onsi/gomega || true
echo "-----> Fetching spf13/pflag dependency for subcommands"
go get github.com/spf13/pflag || true
pushd "$plugin_root" >/dev/null || true
find "$plugin_root/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
pushd "$plugin_root/$plugin" >/dev/null || true
if [[ -f "go.mod" ]]; then
echo "-----> Fetching dependencies for $plugin plugin"
go get || true
fi
popd >/dev/null || true
done
popd >/dev/null || true
}
setup-ci() { setup-ci() {
local dokku_root="/root/go/src/github.com/dokku/dokku" local dokku_root="/root/go/src/github.com/dokku/dokku"
pushd "$plugin_root" >/dev/null || true pushd "$plugin_root" >/dev/null || true
@@ -34,7 +13,6 @@ setup-ci() {
} }
main() { main() {
install-go-mods
install-go-devtools install-go-devtools
setup-ci setup-ci
} }
+4 -4
View File
@@ -44,6 +44,10 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# workaround for https://github.com/github/codeql/issues/14235
- name: Remove go.work file
run: rm go.work
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v3
@@ -66,9 +70,5 @@ jobs:
# and modify them (or add more) to build your code if your project # and modify them (or add more) to build your code if your project
# uses a compiled language # uses a compiled language
# - run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3 uses: github/codeql-action/analyze@v3
+1 -1
View File
@@ -21,7 +21,7 @@ build-in-docker: clean
-e GO111MODULE=on \ -e GO111MODULE=on \
-w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \ -w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \
$(BUILD_IMAGE) \ $(BUILD_IMAGE) \
bash -c "GO_ARGS='$(GO_ARGS)' CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) make -j4 $(GO_PLUGIN_MAKE_TARGET)" || exit $$? bash -c "GO_ARGS='$(GO_ARGS)' CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) GOWORK=off make -j4 $(GO_PLUGIN_MAKE_TARGET)" || exit $$?
clean: clean:
rm -rf $(BUILD) rm -rf $(BUILD)
+23
View File
@@ -0,0 +1,23 @@
go 1.21
use (
./plugins/app-json
./plugins/apps
./plugins/builder
./plugins/buildpacks
./plugins/common
./plugins/config
./plugins/cron
./plugins/docker-options
./plugins/logs
./plugins/network
./plugins/nginx-vhosts
./plugins/ports
./plugins/proxy
./plugins/ps
./plugins/registry
./plugins/repo
./plugins/resource
./plugins/scheduler
./plugins/scheduler-docker-local
)