summaryrefslogtreecommitdiffstats
path: root/gitlab-templates/GoogleStorage.gitlab-ci.yml
blob: 4ddf313d6aabed7a25e3983329a23c911686362b (plain)
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
# 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