be941a81e6678d7dce2e919d5e247a2b38c8ef98
[releng.git] / gitlab-templates / GoogleStorage.gitlab-ci.yml
1 # Template for uploading artifacts to Google Storage
2 #
3 # To upload artifacts to Google Storage, include this file in your
4 # .gitlab-ci.yml file with the following stanza:
5 #
6 #   include:
7 #     - project: anuket/releng
8 #       file: '/gitlab-templates/GoogleStorage.gitlab-ci.yml'
9 #
10 # And append the following "- !reference.." line to the script portion
11 # of a job where artifacts should be uploaded:
12 #
13 #   script:
14 #      ...
15 #      - !reference [.gsutil-install, script]
16 #      ...
17 #
18 # After the script has been included `gsutil` will have access to the
19 # necessary Google Storage bucket.
20 ---
21 variables:
22   GS_URL: "artifacts.opnfv.org/$CI_PROJECT_NAME"
23   WORKSPACE: $CI_PROJECT_DIR
24
25 .gsutil-install: &gsutil-install
26   script:
27     - dnf -y install python3-pip
28     - python3 -m pip install -U pip
29     - python3 -m pip install gsutil
30     - echo "$GSUTIL_CONFIG" > ~/.boto