-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.ci_functions.sh
39 lines (31 loc) · 1.55 KB
/
.ci_functions.sh
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
36
37
38
39
# Functions for GitLab CI
# Sets up Conan by adding a remote path and authenticating the user
setup_conan() {
local conan_name=$1
local conan_url=$2
echo 'Setting up Conan...'
conan remote add "$conan_name" "$conan_url" --force
conan user --password "$ESS_ARTIFACTORY_ECDC_CONAN_TOKEN" --remote "$conan_name" "$ESS_ARTIFACTORY_ECDC_CONAN_USER"
}
# Creates a Conan package from the specified path
conan_package_creation() {
local conan_path=$1
local conan_settings=${2:-""}
local conan_options=${3:-""}
echo 'Creating Conan package...'
conan create $conan_path ${CONAN_USER}/${CONAN_PKG_CHANNEL} --build=outdated --settings $conan_settings --options $conan_options
}
# Uploads packages to the external Conan repository
upload_packages_to_conan_external() {
local conan_file_path=$1
echo 'Uploading packages to Conan External Artifactory...'
packageNameAndVersion=$(conan inspect --attribute name --attribute version $conan_file_path | awk -F': ' '{print $2}' | paste -sd'/')
conan upload --all --no-overwrite --remote ecdc-conan-external ${packageNameAndVersion}@${CONAN_USER}/${CONAN_PKG_CHANNEL}
}
# Uploads packages to the release Conan repository
upload_packages_to_conan_release() {
local conan_file_path=$1
echo 'Uploading packages to Conan Release Artifactory...'
packageNameAndVersion=$(conan inspect --attribute name --attribute version $conan_file_path | awk -F': ' '{print $2}' | paste -sd'/')
conan upload --no-overwrite --remote ecdc-conan-release ${packageNameAndVersion}@${CONAN_USER}/${CONAN_PKG_CHANNEL}
}