summaryrefslogtreecommitdiffstats
path: root/gitlab-templates/GoogleStorage.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab-templates/GoogleStorage.gitlab-ci.yml')
-rw-r--r--gitlab-templates/GoogleStorage.gitlab-ci.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/gitlab-templates/GoogleStorage.gitlab-ci.yml b/gitlab-templates/GoogleStorage.gitlab-ci.yml
new file mode 100644
index 000000000..4ddf313d6
--- /dev/null
+++ b/gitlab-templates/GoogleStorage.gitlab-ci.yml
@@ -0,0 +1,35 @@
+# Template for uploading artifacts to Google Storage
+#
+# To upload artifacts to Google Storage, include this file in your
+# .gitlab-ci.yml file with the following stanza:
+#
+# include:
+# - project: anuket/releng
+# file: '/gitlab-templates/GoogleStorage.gitlab-ci.yml'
+#
+# And append the following "- !reference.." line to the script portion
+# of a job where artifacts should be uploaded:
+#
+# script:
+# ...
+# - !reference [.gsutil-install, script]
+# ...
+#
+# After the script has been included `gsutil` will have access to the
+# necessary Google Storage bucket.
+---
+variables:
+ GS_URL: "artifacts.opnfv.org/$CI_PROJECT_NAME"
+ WORKSPACE: $CI_PROJECT_DIR
+
+.gsutil-install: &gsutil-install
+ script:
+ - |
+ if command -v dnf &> /dev/null; then
+ dnf -y install python3-pip
+ else
+ yum -y install python3-pip
+ fi
+ - python3 -m pip install -U pip
+ - python3 -m pip install gsutil
+ - echo "$GSUTIL_CONFIG" > ~/.boto