mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-21 18:22:33 +01:00
CI: Add workaround for exporting variables in Azure
Using '-x' to echo commands in the shell causes the Azure process commands to be processed twice
This commit is contained in:
parent
cc100f4008
commit
8581a2775a
@ -1,32 +1,12 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
# From pure sh bible, strips rogue quotes
|
||||
# Does single and double quotes
|
||||
trim_quotes()
|
||||
{
|
||||
set -f
|
||||
|
||||
old_ifs=$IFS
|
||||
IFS=\"\'
|
||||
|
||||
set -- $1
|
||||
IFS=
|
||||
printf '%s\n' "$*"
|
||||
IFS=$old_ifs
|
||||
|
||||
set +f
|
||||
}
|
||||
|
||||
# BUILD_blablabla is Azure specific, so we wrap it for portability
|
||||
# The BUILD var is passed from a previous stage, so it is cleaned
|
||||
# due to a bug in Azure
|
||||
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
|
||||
BUILD=$(trim_quotes "$BUILD")
|
||||
|
||||
# Remove unecessary files
|
||||
rm -f ./bin/rpcs3.exp ./bin/rpcs3.lib ./bin/rpcs3.pdb
|
||||
|
||||
# Prepare compatibility database for packaging, as well as
|
||||
# Prepare compatibility database for packaging, as well as
|
||||
# certificate for ssl (auto-updater)
|
||||
curl -sL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 > ./bin/GuiConfigs/compat_database.dat
|
||||
curl -sL 'https://curl.haxx.se/ca/cacert.pem' > ./bin/cacert.pem
|
||||
|
13
.travis/export-azure-vars.sh
Normal file
13
.travis/export-azure-vars.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Export variables for later stages of the Azure pipeline
|
||||
# Values done in this manner will appear as environment variables
|
||||
# in later stages.
|
||||
|
||||
# From pure-sh-bible
|
||||
# Setting 'IFS' tells 'read' where to split the string.
|
||||
while IFS='=' read -r key val; do
|
||||
# Skip over lines containing comments.
|
||||
[ "${key##\#*}" ] || continue
|
||||
echo "##vso[task.setvariable variable=$key]$val"
|
||||
done < ".travis/azure-vars.env"
|
@ -107,13 +107,10 @@ else
|
||||
BUILD="rpcs3-v${AVVER}-${COMM_HASH}_win64.7z"
|
||||
fi
|
||||
|
||||
# Export variables for later stages of the Azure pipeline
|
||||
# Values done in this manner will appear as environment variables
|
||||
# in later stages, but are not added to environment variables
|
||||
# in *this* stage. Thank azure for that one.
|
||||
# BRANCH is used for experimental build warnings for pr builds
|
||||
# used in main_window.cpp. AVVER is used for GitHub releases.
|
||||
# BRANCH is used for experimental build warnings for pr builds, used in main_window.cpp.
|
||||
# BUILD is the name of the release artifact
|
||||
# AVVER is used for GitHub releases, it is the version number.
|
||||
BRANCH="${REPO_NAME}/${REPO_BRANCH}"
|
||||
echo "##vso[task.setvariable variable=branch]$BRANCH"
|
||||
echo "##vso[task.setvariable variable=build]$BUILD"
|
||||
echo "##vso[task.setvariable variable=avver]$AVVER"
|
||||
echo "BRANCH=$BRANCH" > .travis/azure-vars.env
|
||||
echo "BUILD=$BUILD" >> .travis/azure-vars.env
|
||||
echo "AVVER=$AVVER" >> .travis/azure-vars.env
|
||||
|
@ -66,6 +66,9 @@ jobs:
|
||||
- bash: .travis/setup-windows.sh
|
||||
displayName: Download and unpack dependencies
|
||||
|
||||
- bash: .travis/export-azure-vars.sh
|
||||
displayName: Export Variables
|
||||
|
||||
- task: VSBuild@1
|
||||
inputs:
|
||||
solution: 'rpcs3.sln'
|
||||
|
Loading…
Reference in New Issue
Block a user