2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Orange and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 export PATH=$PATH:/usr/local/bin/
16 # - $1: the source directory where the files to be uploaded are located
17 # - $2: the target on artifact http://artifact.opnfv.org/<project>/$2
18 # if not set, default value is <project>/docs
22 artifact_dir="$project/docs"
24 artifact_dir="$project/$2"
29 # check that the API doc directory does exist before pushing it to artifact
30 if [ ! -d "$DIRECTORY" ]; then
31 echo "Directory to be uploaded "$DIRECTORY" does not exist"
37 echo "Not possible to push results to artifact: gsutil not installed"
40 gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null
42 echo "Not possible to push results to artifact: gsutil not installed."
45 echo "Uploading file(s) to artifact $artifact_dir"
46 gsutil -m cp -r "$DIRECTORY"/* gs://artifacts.opnfv.org/"$artifact_dir"/ >/dev/null 2>&1