blob: fe1003722fcea6fc6be3366ba9513fbf6a2752b9 [file] [log] [blame]
Gergely Csatari9205c552021-09-08 11:53:02 +03001#!/bin/bash
2#
3# Copyright 2021 Nokia
4# Licensed under the Apache License 2.0
5# SPDX-License-Identifier: Apache-2.0
6
7set -x
8echo "run-c2m -------------------------------------------------------------"
9if [[ -z "$CONFLUENCE_USERNAME" || -z "$CONFLUENCE_PASSWORD" ]]
10then
11 echo "Mandatory environment variables:"
12 echo " CONFLUENCE_USERNAME: Confluence username"
13 echo " CONFLUENCE_PASSWORD: Confluence password."
14 echo "Be aware! Setting bash debuging on will print credentials."
15 exit
16fi
17
18proxy=""
19if [[ -z "${http_proxy}" ]]; then
20 echo "http_proxy is empty"
21else
22 echo "http_proxy is set to $http_proxy"
23 if [[ $http_proxy =~ ^http:\/\/[0-9] ]]; then
24 echo "starts with http"
25 proxy=$http_proxy
26 elif [[ $http_proxy =~ ^[0-9] ]]; then
27 echo "starts with number"
28 proxy=http://$http_proxy
29 fi
30fi
31
32echo "Proxy set to $proxy, build env is $build_env."
33
34docker run -e http_proxy=$proxy -e https_proxy=$proxy -e HTTP_PROXY=$proxy -e HTTPS_PROXY=$proxy -e CONFLUENCE_PASSWORD=$CONFLUENCE_PASSWORD -e CONFLUENCE_USERNAME=$CONFLUENCE_USERNAME -v $PWD:/mount c2m:latest ./c2m-wrapper.sh /mount/$1