Skip to content

Commit d05bf63

Browse files
authored
feat(gcloud): Support publishing packages to GCP Artifact Registry (#47)
* feat(circleci): Publish packages to GCP repository
1 parent 40a72fc commit d05bf63

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

Diff for: gcloud/orb.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,50 @@ commands:
135135
kubectl patch deployment <<parameters.deployment>> \
136136
-p '{"spec":{"template":{"metadata":{"annotations":{"date":"'$(date +'%s')'"}}}}}'
137137
138+
artifacts-package-publish:
139+
description: >
140+
This command will publish an already built package to a GCP package
141+
repository. Command requires python3 to be present.
142+
parameters:
143+
creds:
144+
default: GCLOUD_SERVICE_KEY
145+
description: >
146+
Name of environment variable storing the base64-encoded service key
147+
for the GCP project.
148+
type: env_var_name
149+
files:
150+
default: '*'
151+
description: >
152+
Glob pattern of files to upload
153+
type: string
154+
path:
155+
default: .
156+
description: >
157+
Path to the directory containing your packages.
158+
type: string
159+
project:
160+
description: >
161+
Name of GCP project to which we will push.
162+
type: string
163+
repository-url:
164+
description: >
165+
URL of GCP package repository to which we will push.
166+
type: string
167+
steps:
168+
- run: python3 -m pip install twine keyring keyrings.google-artifactregistry-auth
169+
- install
170+
- auth:
171+
creds: <<parameters.creds>>
172+
project: <<parameters.project>>
173+
- run: |
174+
unset TWINE_PASSWORD
175+
unset TWINE_USERNAME
176+
unset TWINE_REPOSITORY
177+
unset TWINE_REPOSITORY_URL
178+
unset TWINE_CERT
179+
unset TWINE_NON_INTERACTIVE
180+
twine upload --repository-url <<parameters.repository-url>> <<parameters.path>>/<<parameters.files>>
181+
138182
jobs:
139183
deploy-cloud-function:
140184
description: >

0 commit comments

Comments
 (0)