-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
89 lines (85 loc) · 2.59 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
steps:
- id: deploy-python
name: "python:3.7-buster"
entrypoint: "bash"
args:
- "-c"
- |
if [ "$TAG_NAME" ] ; then
python setup.py bdist_wheel
pip install twine keyrings.google-artifactregistry-auth
twine upload --repository-url https://europe-west4-python.pkg.dev/dev-vml-cm/vml-apis-python/ dist/*
else
TAG_NAME="v0.0.0"
python setup.py bdist_wheel
fi
env:
- "TAG_NAME=$TAG_NAME"
- id: deploy-csharp
name: "bitnami/dotnet-sdk"
entrypoint: "bash"
args:
- "-c"
- |
cp vmlapis.csproj gen/csharp
cd gen/csharp
if [ "$TAG_NAME" ] ; then
export TAG_NAME=${TAG_NAME:1}
dotnet pack -o . -c Release
dotnet nuget push vmlapis.$$TAG_NAME.nupkg --source https://api.nuget.org/v3/index.json --api-key $$NUGET_API_KEY
else
export TAG_NAME=0.0.0
dotnet pack -o . -c Release
fi
env:
- "TAG_NAME=$TAG_NAME"
waitFor: ["-"]
secretEnv: ["NUGET_API_KEY"]
- id: deploy-java
name: "maven:3.6.3-jdk-8"
entrypoint: "bash"
args:
- "-c"
- |
cp -R gen/java java-package/src/main/java
cd java-package
if [ "$TAG_NAME" ] ; then
export TAG_NAME=${TAG_NAME:1}
mvn deploy
else
export TAG_NAME=0.0.0
mvn package
fi
env:
- "TAG_NAME=$TAG_NAME"
waitFor: ["-"]
- id: test-go
name: "golang"
entrypoint: "bash"
args:
- "-c"
- |
if ! [ "$TAG_NAME" ] ; then
mkdir gotest
cp -R examples/go/AutosuggestCreateDatasetExample gotest/AutosuggestCreateDatasetExample
cp -R examples/go/SmartscanAnnotateDocumentExample gotest/SmartscanAnnotateDocumentExample
cp -R examples/go/SmartscanRasterizePdfExample gotest/SmartscanRasterizePdfExample
sed -i 's/commit/$COMMIT_SHA/' go.mod.example
cp go.mod.example gotest/AutosuggestCreateDatasetExample/go.mod
cp go.mod.example gotest/SmartscanAnnotateDocumentExample/go.mod
cp go.mod.example gotest/SmartscanRasterizePdfExample/go.mod
cd gotest/AutosuggestCreateDatasetExample
go mod tidy
go build
cd ../SmartscanAnnotateDocumentExample
go mod tidy
go build
cd ../SmartscanRasterizePdfExample
go mod tidy
go build
fi
waitFor: ["-"]
availableSecrets:
secretManager:
- versionName: projects/161107618804/secrets/nuget-api-key/versions/latest
env: "NUGET_API_KEY"