Created
May 7, 2019 18:32
-
-
Save numbsafari/5bfaef9a7de0c03b04b299780654bb82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a GCP debian-9 (stretch) instance and then SSH into it | |
# gcloud compute instances create test-please --zone=us-east4-c --machine-type=n1-standard-2 --subnet=default --network-tier=PREMIUM --maintenance-policy=MIGRATE --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --image=debian-9-stretch-v20190423 --image-project=debian-cloud --boot-disk-size=10GB --boot-disk-type=pd-standard --boot-disk-device-name=test-please | |
# gcloud compute ssh test-please | |
# From there, run the following two blocks of code to initialize the environment and run the go tests | |
# setup please pre-reqs | |
sudo apt-get update -y | |
sudo apt-get install -y --fix-missing golang-1.11 python3-pip git default-jre default-jdk | |
mkdir -p ~/.config/please | |
cat <<EOF > ~/.config/please/plzconfig | |
[Build] | |
path = /usr/lib/go-1.11/bin:/usr/local/bin:/usr/bin:/bin | |
[Go] | |
goroot = /usr/lib/go-1.11/ | |
EOF | |
# setup please-examples and run go tests | |
mkdir ~/src | |
git clone https://github.com/thought-machine/please-examples.git | |
cd please-examples | |
./pleasew test -i go -o proto.language:go | |
To accomplish the same thing locally using goenv and pyenv to manage my local installs of each, I did the following:
cd ~/src/please-examples
pyenv local 3.7.3 # create .python-version
goenv local 1.12.4 # create .go-version
cat <<EOF > localize
#!/bin/bash
cat <<EOF > .plzconfig.local
[Build]
path = $(dirname $(goenv which go)):$(dirname $(pyenv which python)):/usr/local/bin:/usr/bin:/bin
[Go]
goroot = $(dirname $(dirname $(goenv which go)))
EOF
chmod u+x localize
./localize # create a .plzconfig.local file based on my active python and go versions
sudo apt-get update && sudo apt-get install -y default-jdk default-jre # I don't care about java, but I need it to keep plz happy here
Now, when I run the pleasew
command to run the tests, I get the same error as I do on the VM.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The output of the final command is current: