-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): fix ci run for forked repos (#2777)
- Loading branch information
Showing
12 changed files
with
76 additions
and
24 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
steps: | ||
- bash: | | ||
scripts/ci/rebase.sh | ||
displayName: 'Rebase sources' | ||
|
||
- bash: | | ||
sudo update-alternatives --set php /usr/bin/php$(phpVersion) | ||
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion) | ||
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion) | ||
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion) | ||
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion) | ||
php -version | ||
displayName: 'Use PHP version $(phpVersion)' | ||
displayName: 'Set php version $(phpVersion)' | ||
|
||
- bash: | | ||
mkdir -p results/coverage | ||
sed 's/DB_TEST_PASSWORD=/DB_TEST_PASSWORD=root/' scripts/tests/.env.mysql > .env | ||
touch .sentry-release | ||
displayName: Prepare environment | ||
displayName: 'Prepare environment' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
steps: | ||
- bash: | | ||
source scripts/ci/fixsecrets.sh | ||
export SONAR_COVERAGE=$(ls -m ./results/coverage*.xml | sed 's/ //g' | sed ':a;N;$!ba;s/\n//g') | ||
scripts/tests/runsonar.sh | ||
displayName: 'Run sonar scanner' | ||
env: | ||
SONAR_RESULT: '$(System.DefaultWorkingDirectory)/results/results.xml' | ||
GITHUB_TOKEN: $(GITHUB_TOKEN) | ||
SONAR_TOKEN: $(SONAR_TOKEN) | ||
SONAR_VERSION: $(SONAR_VERSION) | ||
GITHUB_TOKEN: $(GITHUB_TOKEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P) | ||
|
||
cat $SELF_PATH/../azure-pipelines.yml $SELF_PATH/*.yml | gpg -sb -o $SELF_PATH/azure.sig - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [ "$SONAR_TOKEN" == "\$(SONAR_TOKEN)" ]; then | ||
echo -e "\033[0;36mFix SONAR_TOKEN\033[0;37m" | ||
export SONAR_TOKEN= | ||
fi | ||
if [ "$GITHUB_TOKEN" == "\$(GITHUB_TOKEN)" ]; then | ||
echo -e "\033[0;36mFix GITHUB_TOKEN\033[0;37m" | ||
export GITHUB_TOKEN= | ||
fi | ||
if [ "$GH_TOKEN" == "\$(GH_TOKEN)" ]; then | ||
echo -e "\033[0;36mFix GH_TOKEN\033[0;37m" | ||
export GH_TOKEN= | ||
fi | ||
if [ "$ASSETS_GITHUB_TOKEN" == "\$(ASSETS_GITHUB_TOKEN)" ]; then | ||
echo -e "\033[0;36mFix ASSETS_GITHUB_TOKEN\033[0;37m" | ||
export ASSETS_GITHUB_TOKEN= | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# Rebase source on top of based branch | ||
|
||
set -evuo pipefail | ||
|
||
export GIT_COMMIT=$(git rev-parse --verify "HEAD^2" 2>/dev/null || echo $BUILD_SOURCEVERSION) | ||
echo "##vso[task.setvariable variable=GIT_COMMIT]$GIT_COMMIT" | ||
|
||
git reset --hard "$GIT_COMMIT" | ||
|
||
if [[ $BUILD_SOURCEBRANCH == refs/tags/* ]]; then | ||
git checkout -q "$BUILD_SOURCEBRANCHNAME" | ||
elif [ -n "$SYSTEM_PULLREQUEST_SOURCEBRANCH" ]; then | ||
git checkout -q -B "$SYSTEM_PULLREQUEST_SOURCEBRANCH" | ||
fi | ||
|
||
git reset --hard "$GIT_COMMIT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.