Skip to content

Instantly share code, notes, and snippets.

@joshcarp
Last active December 4, 2020 02:35
Show Gist options
  • Save joshcarp/42c0aac1e2e6334c3735487f90e2286a to your computer and use it in GitHub Desktop.
Save joshcarp/42c0aac1e2e6334c3735487f90e2286a to your computer and use it in GitHub Desktop.
Example of how to deploy cloud functions with vendor directories, run vendor-cloudfunctions.sh right before running cloud deploy
#!/bin/bash
module=$(cat go.mod | grep module | cut -d " " -f2)
mkdir -p ./vendor/$module
cp -r pkg go.mod go.sum ./vendor/$module
echo "moving files to $module"
rm -rf go.mod go.sum
@joshcarp
Copy link
Author

joshcarp commented Dec 4, 2020

go.mod and go.sum are required, so don't ignore them in your .gcloudignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment