mirror of
https://github.com/nextcloud/server.git
synced 2026-05-26 19:32:28 -04:00
chore: remove legacy drone CI config
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
23095a142a
commit
05ef64dd34
7 changed files with 0 additions and 361 deletions
|
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
if (!isset($argv[1])) {
|
||||
echo 'Clover file is missing' . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$cloverFile = $argv[1];
|
||||
|
||||
$doc = simplexml_load_file($cloverFile);
|
||||
|
||||
$metrics = [];
|
||||
foreach ($doc->project->metrics->attributes() as $k => $v) {
|
||||
$metrics[$k] = $v->__toString();
|
||||
}
|
||||
|
||||
$c0 = $metrics['coveredmethods'] / $metrics['methods'];
|
||||
$c1 = $metrics['coveredelements'] / $metrics['elements'];
|
||||
$c2 = $metrics['coveredstatements'] / $metrics['statements'];
|
||||
|
||||
echo $c0 . PHP_EOL;
|
||||
echo $c1 . PHP_EOL;
|
||||
echo $c2 . PHP_EOL;
|
||||
|
||||
$percent = (int)($c2 * 100);
|
||||
$color = 'red';
|
||||
if ($percent >= 50) {
|
||||
$color = 'yellow';
|
||||
}
|
||||
if ($percent >= 75) {
|
||||
$color = 'green';
|
||||
}
|
||||
$content = file_get_contents("https://img.shields.io/badge/coverage-$percent%-$color.svg");
|
||||
file_put_contents('coverage.svg', $content);
|
||||
} catch (Exception $ex) {
|
||||
echo $ex->getMessage() . PHP_EOL;
|
||||
$content = file_get_contents('https://img.shields.io/badge/coverage-ERROR-red.svg');
|
||||
file_put_contents('coverage.svg', $content);
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
echo "========================="
|
||||
echo "= List of changed files ="
|
||||
echo "========================="
|
||||
git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA
|
||||
echo "========================="
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | wc -l) -eq 0 ]] && echo "No files are modified => merge commit" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep ".json" | grep -v "package.json" | grep -c -v "package-lock.json") -gt 0 ]] && echo "JSON files are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".sh") -gt 0 ]] && echo "bash files are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".yml") -gt 0 ]] && echo "YML files are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".xml") -gt 0 ]] && echo "info.xml files are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "^tests/") -gt 0 ]] && echo "PHP test files are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "/tests/") -gt 0 ]] && echo "PHP test files of an app are modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "3rdparty") -gt 0 ]] && echo "3rdparty is modified" && exit 0
|
||||
|
||||
[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "apps/theming/css") -gt 0 ]] && echo "theming css is modified" && exit 0
|
||||
|
||||
exit 1
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function get_swift_token() {
|
||||
KEYSTONE_OUT=$(curl -s 'http://dockswift:5000/v2.0/tokens' -H 'Content-Type: application/json' -d '{"auth":{"passwordCredentials":{"username":"swift","password":"swift"},"tenantName":"service"}}')
|
||||
if (echo "$KEYSTONE_OUT" | grep -q 'object-store')
|
||||
then
|
||||
SWIFT_ENDPOINT=$(echo "$KEYSTONE_OUT" | php -r "echo array_values(array_filter(json_decode(file_get_contents('php://stdin'),true)['access']['serviceCatalog'], function(\$endpoint){return \$endpoint['type']==='object-store';}))[0]['endpoints'][0]['publicURL'];")
|
||||
SWIFT_TOKEN=$(echo "$KEYSTONE_OUT" | php -r "echo json_decode(file_get_contents('php://stdin'),true)['access']['token']['id'];")
|
||||
return 0
|
||||
else
|
||||
return -1
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$OBJECT_STORE" == "s3" ]; then
|
||||
echo "Waiting for minio to be ready"
|
||||
timeout 60 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://minio:9000)" != "403" ]]; do sleep 5; done' || (
|
||||
echo "Failed to wait for minio to be ready" && exit 1
|
||||
)
|
||||
fi
|
||||
if [ "$OBJECT_STORE" == "swift" ]; then
|
||||
echo "waiting for keystone"
|
||||
until get_swift_token
|
||||
do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "waiting for object store at $SWIFT_ENDPOINT"
|
||||
|
||||
until curl -s -H "X-Auth-Token: $SWIFT_TOKEN" "$SWIFT_ENDPOINT"
|
||||
do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "creating container"
|
||||
|
||||
sleep 2
|
||||
|
||||
while [ 1 ]
|
||||
do
|
||||
sleep 2
|
||||
|
||||
respCode=$(curl -s -o /dev/null -w "%{http_code}" -X PUT -H "X-Auth-Token: $SWIFT_TOKEN" "$SWIFT_ENDPOINT/nextcloud")
|
||||
|
||||
if [ "$respCode" == "201" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo "creating test file"
|
||||
|
||||
i=0
|
||||
while [ 1 ]
|
||||
do
|
||||
sleep 2
|
||||
|
||||
respCode=$(curl -s -o /dev/null -w "%{http_code}" -X PUT -H "X-Auth-Token: $SWIFT_TOKEN" -H "Content-Type: text/html; charset=UTF-8" -d "Hello world" "$SWIFT_ENDPOINT/nextcloud/helloworld.txt")
|
||||
|
||||
if [ "$respCode" == "201" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
i=$((i + 1))
|
||||
if [ "$i" == "20" ]
|
||||
then
|
||||
exit -1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "deleting test file"
|
||||
curl -s -o /dev/null -w "%{http_code}\n" -X DELETE -H "X-Auth-Token: $SWIFT_TOKEN" "$SWIFT_ENDPOINT/nextcloud/helloworld.txt"
|
||||
fi
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
#
|
||||
# This script start a docker container to test the files_external tests
|
||||
# against. It will also change the files_external config to use the docker
|
||||
# container as testing environment. This is reverted in the stop step.W
|
||||
#
|
||||
# Set environment variable DEBUG to print config file
|
||||
#
|
||||
# @author Morris Jobke
|
||||
# @author Robin McCorkell
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "No docker executable found - skipped docker setup"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
echo "Docker executable found - setup docker"
|
||||
|
||||
|
||||
docker_image=xenopathic/ceph-keystone
|
||||
|
||||
echo "Fetch recent ${docker_image} docker image"
|
||||
docker pull ${docker_image}
|
||||
|
||||
# retrieve current folder to place the config in the parent folder
|
||||
thisFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# create readiness notification socket
|
||||
notify_sock=$(readlink -f "$thisFolder"/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock)
|
||||
rm -f "$notify_sock" # in case an unfinished test left one behind
|
||||
mkfifo "$notify_sock"
|
||||
|
||||
port=5034
|
||||
|
||||
user=test
|
||||
pass=testing
|
||||
tenant=testenant
|
||||
region=testregion
|
||||
service=testceph
|
||||
|
||||
container=`docker run -d \
|
||||
-e KEYSTONE_PUBLIC_PORT=${port} \
|
||||
-e KEYSTONE_ADMIN_USER=${user} \
|
||||
-e KEYSTONE_ADMIN_PASS=${pass} \
|
||||
-e KEYSTONE_ADMIN_TENANT=${tenant} \
|
||||
-e KEYSTONE_ENDPOINT_REGION=${region} \
|
||||
-e KEYSTONE_SERVICE=${service} \
|
||||
-e OSD_SIZE=300 \
|
||||
-v "$notify_sock":/run/notifyme.sock \
|
||||
--privileged \
|
||||
${docker_image}`
|
||||
|
||||
host=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$container")
|
||||
|
||||
|
||||
echo "${docker_image} container: $container"
|
||||
|
||||
# put container IDs into a file to drop them after the test run (keep in mind that multiple tests run in parallel on the same host)
|
||||
echo $container >> $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
||||
|
||||
echo -n "Waiting for ceph initialization"
|
||||
ready=$(timeout 600 cat "$notify_sock")
|
||||
if [[ $ready != 'READY=1' ]]; then
|
||||
echo "[ERROR] Waited 600 seconds, no response" >&2
|
||||
docker logs $container
|
||||
exit 1
|
||||
fi
|
||||
if ! "$thisFolder"/wait-for-connection ${host} 80 600; then
|
||||
echo "[ERROR] Waited 600 seconds, no response" >&2
|
||||
docker logs $container
|
||||
exit 1
|
||||
fi
|
||||
echo "Waiting another 15 seconds"
|
||||
sleep 15
|
||||
|
||||
cat > $thisFolder/swift.config.php <<DELIM
|
||||
<?php
|
||||
\$CONFIG = array (
|
||||
'objectstore' => array(
|
||||
'class' => 'OC\\Files\\ObjectStore\\Swift',
|
||||
'arguments' => array(
|
||||
'username' => '$user',
|
||||
'password' => '$pass',
|
||||
'container' => 'owncloud-autotest$EXECUTOR_NUMBER',
|
||||
'objectPrefix' => 'autotest$EXECUTOR_NUMBER:oid:urn:',
|
||||
'autocreate' => true,
|
||||
'region' => '$region',
|
||||
'url' => 'http://$host:$port/v2.0',
|
||||
'tenantName' => '$tenant',
|
||||
'serviceName' => '$service',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
DELIM
|
||||
|
||||
if [ -n "$DEBUG" ]; then
|
||||
echo "############## DEBUG info ###############"
|
||||
echo "### Docker info"
|
||||
docker info
|
||||
echo "### Docker images"
|
||||
docker images
|
||||
echo "### current mountpoints"
|
||||
mount
|
||||
echo "### contents of $thisFolder/swift.config.php"
|
||||
cat $thisFolder/swift.config.php
|
||||
echo "### contents of $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift"
|
||||
cat $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
||||
echo "### docker logs"
|
||||
docker logs $container
|
||||
echo "############## DEBUG info end ###########"
|
||||
fi
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
#
|
||||
# This script stops the docker container the files_external tests were run
|
||||
# against. It will also revert the config changes done in start step.
|
||||
#
|
||||
# @author Morris Jobke
|
||||
# @author Robin McCorkell
|
||||
# @copyright 2015 ownCloud
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "No docker executable found - skipped docker stop"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
echo "Docker executable found - stop and remove docker containers"
|
||||
|
||||
# retrieve current folder to remove the config from the parent folder
|
||||
thisFolder=`echo $0 | replace "stop-swift-ceph.sh" ""`
|
||||
|
||||
if [ -z "$thisFolder" ]; then
|
||||
thisFolder="."
|
||||
fi;
|
||||
|
||||
if [ -e $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift ]; then
|
||||
# stopping and removing docker containers
|
||||
for container in `cat $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift`; do
|
||||
if [ -n "$DEBUG" ]; then
|
||||
docker logs $container
|
||||
fi
|
||||
echo "Stopping and removing docker container $container"
|
||||
# kills running container and removes it
|
||||
docker stop $container
|
||||
docker rm -f $container
|
||||
done;
|
||||
fi;
|
||||
|
||||
# cleanup
|
||||
rm -rf $thisFolder/swift.config.php
|
||||
rm -rf $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
||||
rm -rf $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
$timeout = 60;
|
||||
|
||||
switch ($argc) {
|
||||
case 4:
|
||||
$timeout = (float)$argv[3];
|
||||
case 3:
|
||||
$host = $argv[1];
|
||||
$port = (int)$argv[2];
|
||||
break;
|
||||
default:
|
||||
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if ($timeout < 0) {
|
||||
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
|
||||
exit(2);
|
||||
}
|
||||
if ($port < 1) {
|
||||
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
$socketTimeout = (float)ini_get('default_socket_timeout');
|
||||
if ($socketTimeout > $timeout) {
|
||||
$socketTimeout = $timeout;
|
||||
}
|
||||
|
||||
$stopTime = time() + $timeout;
|
||||
do {
|
||||
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
|
||||
if ($sock !== false) {
|
||||
fclose($sock);
|
||||
fwrite(STDOUT, "\n");
|
||||
exit(0);
|
||||
}
|
||||
sleep(1);
|
||||
fwrite(STDOUT, '.');
|
||||
} while (time() < $stopTime);
|
||||
|
||||
fwrite(STDOUT, "\n");
|
||||
exit(1);
|
||||
Loading…
Reference in a new issue