Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Commit c2eedf3

Browse files
authored
Merge pull request #12 from navierula/master
Update cloudbuild.yaml to use Go modules
2 parents 87bba1d + 8978d38 commit c2eedf3

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

‎README.md‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
# gcbapp-go-example
2-
Example used in the Cloud Build GitHub app tutorial
3-
https://cloud.google.com/cloud-build/docs/run-builds-on-github
2+
The example in this repository is used in the [Cloud Build GitHub app tutorial](https://cloud.google.com/cloud-build/docs/run-builds-on-github).
3+
4+
#### Note:
5+
6+
If you are not currently using Go modules, add the following step to the `cloudbuild.yaml` build configuration file:
7+
8+
```
9+
steps:
10+
- name: golang
11+
args: ['go', 'mod', 'init', 'github.com/your/import/path']
12+
```
13+
In this example, the specified `GOPATH` is `github.com/your/import/path`.

‎cloudbuild.yaml‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
# limitations under the License.
1414

1515
steps:
16-
- name: 'gcr.io/cloud-builders/go'
17-
args: ['install', '.']
18-
env: ['PROJECT_ROOT=hello']
19-
- name: 'gcr.io/cloud-builders/go'
20-
args: ['build', 'hello']
21-
env: ['PROJECT_ROOT=hello']
22-
artifacts:
23-
objects:
24-
location: 'gs://$PROJECT_ID/'
25-
paths: ['hello']
16+
# Build the module.
17+
- name: golang
18+
args: ['go', 'build', '.']

0 commit comments

Comments
 (0)