mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Temp
This commit is contained in:
parent
99c8a72cbd
commit
7a443df199
19 changed files with 817 additions and 305 deletions
|
|
@ -8,8 +8,11 @@ import shlex
|
|||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import pipes
|
||||
import tempfile
|
||||
|
||||
from darwin_containers import DarwinContainers
|
||||
def quote_args(seq):
|
||||
return ' '.join(pipes.quote(arg) for arg in seq)
|
||||
|
||||
def get_clean_env():
|
||||
clean_env = os.environ.copy()
|
||||
|
|
@ -26,7 +29,7 @@ def resolve_executable(program):
|
|||
return None
|
||||
|
||||
|
||||
def run_executable_with_output(path, arguments):
|
||||
def run_executable_with_output(path, arguments, check_result=False):
|
||||
executable_path = resolve_executable(path)
|
||||
if executable_path is None:
|
||||
raise Exception('Could not resolve {} to a valid executable file'.format(path))
|
||||
|
|
@ -39,121 +42,110 @@ def run_executable_with_output(path, arguments):
|
|||
)
|
||||
output_data, _ = process.communicate()
|
||||
output_string = output_data.decode('utf-8')
|
||||
|
||||
if check_result:
|
||||
if process.returncode != 0:
|
||||
print('Command {} {} finished with non-zero return code and output:\n{}'.format(executable_path, arguments, output_string))
|
||||
sys.exit(1)
|
||||
|
||||
return output_string
|
||||
|
||||
def session_scp_upload(session, source_path, destination_path):
|
||||
scp_command = 'scp -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr {source_path} containerhost@"{ipAddress}":{destination_path}'.format(
|
||||
privateKeyPath=session.privateKeyPath,
|
||||
ipAddress=session.ipAddress,
|
||||
source_path=shlex.quote(source_path),
|
||||
destination_path=shlex.quote(destination_path)
|
||||
)
|
||||
if os.system(scp_command) != 0:
|
||||
print('Command {} finished with a non-zero status'.format(scp_command))
|
||||
|
||||
def session_ssh(session, command):
|
||||
ssh_command = 'ssh -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null containerhost@"{ipAddress}" -o ServerAliveInterval=60 -t "{command}"'.format(
|
||||
privateKeyPath=session.privateKeyPath,
|
||||
ipAddress=session.ipAddress,
|
||||
command=command
|
||||
)
|
||||
return os.system(ssh_command)
|
||||
|
||||
def remote_build(darwin_containers_host, configuration):
|
||||
base_dir = os.getcwd()
|
||||
|
||||
configuration_path = 'versions.json'
|
||||
xcode_version = ''
|
||||
with open(configuration_path) as file:
|
||||
configuration_dict = json.load(file)
|
||||
if configuration_dict['xcode'] is None:
|
||||
raise Exception('Missing xcode version in {}'.format(configuration_path))
|
||||
xcode_version = configuration_dict['xcode']
|
||||
def isolated_build(arguments):
|
||||
if arguments.certificatesPath is not None:
|
||||
if not os.path.exists(arguments.certificatesPath):
|
||||
print('{} does not exist'.format(arguments.certificatesPath))
|
||||
sys.exit(1)
|
||||
|
||||
print('Xcode version: {}'.format(xcode_version))
|
||||
keychain_name = 'temp.keychain'
|
||||
keychain_password = 'secret'
|
||||
|
||||
commit_count = run_executable_with_output('git', [
|
||||
'rev-list',
|
||||
'--count',
|
||||
'HEAD'
|
||||
])
|
||||
existing_keychains = run_executable_with_output('security', arguments=['list-keychains'], check_result=True)
|
||||
if keychain_name in existing_keychains:
|
||||
run_executable_with_output('security', arguments=['delete-keychain'], check_result=True)
|
||||
|
||||
build_number_offset = 0
|
||||
with open('build_number_offset') as file:
|
||||
build_number_offset = int(file.read())
|
||||
run_executable_with_output('security', arguments=[
|
||||
'create-keychain',
|
||||
'-p',
|
||||
keychain_password,
|
||||
keychain_name
|
||||
], check_result=True)
|
||||
|
||||
build_number = build_number_offset + int(commit_count)
|
||||
print('Build number: {}'.format(build_number))
|
||||
existing_keychains = run_executable_with_output('security', arguments=['list-keychains', '-d', 'user'])
|
||||
existing_keychains.replace('"', '')
|
||||
|
||||
macos_version = '12.5'
|
||||
image_name = 'macos-{macos_version}-xcode-{xcode_version}'.format(macos_version=macos_version, xcode_version=xcode_version)
|
||||
run_executable_with_output('security', arguments=[
|
||||
'list-keychains',
|
||||
'-d',
|
||||
'user',
|
||||
'-s',
|
||||
keychain_name,
|
||||
existing_keychains
|
||||
], check_result=True)
|
||||
|
||||
print('Image name: {}'.format(image_name))
|
||||
run_executable_with_output('security', arguments=['set-keychain-settings', keychain_name])
|
||||
run_executable_with_output('security', arguments=['unlock-keychain', '-p', keychain_password, keychain_name])
|
||||
|
||||
buildbox_dir = 'buildbox'
|
||||
os.makedirs('{buildbox_dir}/transient-data'.format(buildbox_dir=buildbox_dir), exist_ok=True)
|
||||
for file_name in os.listdir(arguments.certificatesPath):
|
||||
file_path = arguments.certificatesPath + '/' + file_name
|
||||
if file_path.endwith('.p12') or file_path.endwith('.cer'):
|
||||
run_executable_with_output('security', arguments=[
|
||||
'import',
|
||||
file_path,
|
||||
'-k',
|
||||
keychain_name,
|
||||
'-P',
|
||||
'',
|
||||
'-T',
|
||||
'/usr/bin/codesign',
|
||||
'-T',
|
||||
'/usr/bin/security'
|
||||
], check_result=True)
|
||||
|
||||
codesigning_subpath = ''
|
||||
remote_configuration = ''
|
||||
if configuration == 'appcenter':
|
||||
remote_configuration = 'hockeyapp'
|
||||
elif configuration == 'appstore':
|
||||
remote_configuration = 'appstore'
|
||||
elif configuration == 'reproducible':
|
||||
codesigning_subpath = 'build-system/fake-codesigning'
|
||||
remote_configuration = 'verify'
|
||||
run_executable_with_output('security', arguments=[
|
||||
'import',
|
||||
'build-system/AppleWWDRCAG3.cer',
|
||||
'-k',
|
||||
keychain_name,
|
||||
'-P',
|
||||
'',
|
||||
'-T',
|
||||
'/usr/bin/codesign',
|
||||
'-T',
|
||||
'/usr/bin/security'
|
||||
], check_result=True)
|
||||
|
||||
destination_codesigning_path = '{buildbox_dir}/transient-data/telegram-codesigning'.format(buildbox_dir=buildbox_dir)
|
||||
destination_build_configuration_path = '{buildbox_dir}/transient-data/build-configuration'.format(buildbox_dir=buildbox_dir)
|
||||
run_executable_with_output('security', arguments=[
|
||||
'set-key-partition-list',
|
||||
'-S',
|
||||
'apple-tool:,apple:',
|
||||
'-k',
|
||||
keychain_password,
|
||||
keychain_name
|
||||
], check_result=True)
|
||||
|
||||
if os.path.exists(destination_codesigning_path):
|
||||
shutil.rmtree(destination_codesigning_path)
|
||||
if os.path.exists(destination_build_configuration_path):
|
||||
shutil.rmtree(destination_build_configuration_path)
|
||||
build_arguments = ['build-system/Make/Make.py']
|
||||
|
||||
#build_arguments.append('--bazel="$(pwd)/tools/bazel"')
|
||||
|
||||
if arguments.cacheHost is not None:
|
||||
build_arguments.append('--cacheHost={}'.format(arguments.cacheHost))
|
||||
|
||||
shutil.copytree('build-system/fake-codesigning', '{buildbox_dir}/transient-data/telegram-codesigning'.format(buildbox_dir=buildbox_dir))
|
||||
shutil.copytree('build-system/example-configuration', '{buildbox_dir}/transient-data/build-configuration'.format(buildbox_dir=buildbox_dir))
|
||||
else:
|
||||
print('Unknown configuration {}'.format(configuration))
|
||||
sys.exit(1)
|
||||
build_arguments.append('build')
|
||||
|
||||
source_dir = os.path.basename(base_dir)
|
||||
source_archive_path = '{buildbox_dir}/transient-data/source.tar'.format(buildbox_dir=buildbox_dir)
|
||||
build_arguments.append('--configurationPath={}'.format(arguments.configurationPath))
|
||||
build_arguments.append('--buildNumber={}'.format(arguments.buildNumber))
|
||||
build_arguments.append('--configuration={}'.format(arguments.configuration))
|
||||
build_arguments.append('--apsEnvironment=production')
|
||||
build_arguments.append('--disableParallelSwiftmoduleGeneration')
|
||||
build_arguments.append('--provisioningProfilesPath={}'.format(arguments.provisioningProfilesPath))
|
||||
|
||||
if os.path.exists(source_archive_path):
|
||||
os.remove(source_archive_path)
|
||||
build_command = 'python3 ' + quote_args(build_arguments)
|
||||
print('Running {}'.format(build_command))
|
||||
os.system(build_command)
|
||||
|
||||
print('Compressing source code...')
|
||||
os.system('find . -type f -a -not -regex "\\." -a -not -regex ".*\\./git" -a -not -regex ".*\\./git/.*" -a -not -regex "\\./bazel-bin" -a -not -regex "\\./bazel-bin/.*" -a -not -regex "\\./bazel-out" -a -not -regex "\\./bazel-out/.*" -a -not -regex "\\./bazel-testlogs" -a -not -regex "\\./bazel-testlogs/.*" -a -not -regex "\\./bazel-telegram-ios" -a -not -regex "\\./bazel-telegram-ios/.*" -a -not -regex "\\./buildbox" -a -not -regex "\\./buildbox/.*" -a -not -regex "\\./buck-out" -a -not -regex "\\./buck-out/.*" -a -not -regex "\\./\\.buckd" -a -not -regex "\\./\\.buckd/.*" -a -not -regex "\\./build" -a -not -regex "\\./build/.*" -print0 | tar cf "{buildbox_dir}/transient-data/source.tar" --null -T -'.format(buildbox_dir=buildbox_dir))
|
||||
|
||||
darwinContainers = DarwinContainers(serverAddress=darwin_containers_host, verbose=False)
|
||||
|
||||
print('Opening container session...')
|
||||
with darwinContainers.workingImageSession(name=image_name) as session:
|
||||
print('Uploading data to container...')
|
||||
session_scp_upload(session=session, source_path=codesigning_subpath, destination_path='codesigning_data')
|
||||
session_scp_upload(session=session, source_path='{base_dir}/{buildbox_dir}/transient-data/build-configuration'.format(base_dir=base_dir, buildbox_dir=buildbox_dir), destination_path='telegram-configuration')
|
||||
session_scp_upload(session=session, source_path='{base_dir}/{buildbox_dir}/guest-build-telegram.sh'.format(base_dir=base_dir, buildbox_dir=buildbox_dir), destination_path='')
|
||||
session_scp_upload(session=session, source_path='{base_dir}/{buildbox_dir}/transient-data/source.tar'.format(base_dir=base_dir, buildbox_dir=buildbox_dir), destination_path='')
|
||||
|
||||
print('Executing remote build...')
|
||||
|
||||
bazel_cache_host=''
|
||||
session_ssh(session=session, command='BUILD_NUMBER="{build_number}" BAZEL_HTTP_CACHE_URL="{bazel_cache_host}" bash -l guest-build-telegram.sh {remote_configuration}'.format(
|
||||
build_number=build_number,
|
||||
bazel_cache_host=bazel_cache_host,
|
||||
remote_configuration=remote_configuration
|
||||
))
|
||||
|
||||
print('Retrieving build artifacts...')
|
||||
|
||||
artifacts_path='{base_dir}/build/artifacts'.format(base_dir=base_dir)
|
||||
if os.path.exists(artifacts_path):
|
||||
shutil.rmtree(artifacts_path)
|
||||
os.makedirs(artifacts_path, exist_ok=True)
|
||||
|
||||
session_scp_download(session=session, source_path='telegram-ios/build/artifacts/*', destination_path='{artifacts_path}/'.format(artifacts_path=artifacts_path))
|
||||
print('Artifacts have been stored at {}'.format(artifacts_path))
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(prog='build')
|
||||
|
|
@ -182,7 +174,57 @@ if __name__ == '__main__':
|
|||
'reproducible'
|
||||
],
|
||||
required=True,
|
||||
help='Build configuration'
|
||||
help='Build configuration'
|
||||
)
|
||||
remote_build_parser.add_argument(
|
||||
'--bazelCacheHost',
|
||||
required=False,
|
||||
type=str,
|
||||
help='Bazel remote cache host address.'
|
||||
)
|
||||
|
||||
isolated_build_parser = subparsers.add_parser('isolated-build', help='Build the app inside an isolated environment.')
|
||||
isolated_build_parser.add_argument(
|
||||
'--certificatesPath',
|
||||
required=False,
|
||||
type=str,
|
||||
help='Install codesigning certificates from the specified directory.'
|
||||
)
|
||||
isolated_build_parser.add_argument(
|
||||
'--provisioningProfilesPath',
|
||||
required=True,
|
||||
help='''
|
||||
Use codesigning provisioning profiles from a local directory.
|
||||
''',
|
||||
metavar='command'
|
||||
)
|
||||
isolated_build_parser.add_argument(
|
||||
'--cacheHost',
|
||||
required=False,
|
||||
type=str,
|
||||
help='Bazel cache host url.'
|
||||
)
|
||||
isolated_build_parser.add_argument(
|
||||
'--configurationPath',
|
||||
help='''
|
||||
Path to a json containing build configuration.
|
||||
See build-system/appstore-configuration.json for an example.
|
||||
''',
|
||||
required=True,
|
||||
metavar='path'
|
||||
)
|
||||
isolated_build_parser.add_argument(
|
||||
'--buildNumber',
|
||||
required=True,
|
||||
type=int,
|
||||
help='Build number.',
|
||||
metavar='number'
|
||||
)
|
||||
isolated_build_parser.add_argument(
|
||||
'--configuration',
|
||||
type=str,
|
||||
required=True,
|
||||
help='Build configuration'
|
||||
)
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
|
|
@ -195,164 +237,8 @@ if __name__ == '__main__':
|
|||
exit(0)
|
||||
|
||||
if args.commandName == 'remote-build':
|
||||
remote_build(darwin_containers_host=args.darwinContainersHost, configuration=args.configuration)
|
||||
remote_build(darwin_containers_host=args.darwinContainersHost, bazel_cache_host=args.bazelCacheHost, configuration=args.configuration)
|
||||
elif args.commandName == 'isolated-build':
|
||||
isolated_build(arguments=args)
|
||||
|
||||
|
||||
'''set -e
|
||||
|
||||
rm -f "tools/bazel"
|
||||
cp "$BAZEL" "tools/bazel"
|
||||
|
||||
BUILD_CONFIGURATION="$1"
|
||||
|
||||
if [ "$BUILD_CONFIGURATION" == "hockeyapp" ] || [ "$BUILD_CONFIGURATION" == "appcenter-experimental" ] || [ "$BUILD_CONFIGURATION" == "appcenter-experimental-2" ]; then
|
||||
CODESIGNING_SUBPATH="$BUILDBOX_DIR/transient-data/telegram-codesigning/codesigning"
|
||||
elif [ "$BUILD_CONFIGURATION" == "appstore" ] || [ "$BUILD_CONFIGURATION" == "appstore-development" ]; then
|
||||
CODESIGNING_SUBPATH="$BUILDBOX_DIR/transient-data/telegram-codesigning/codesigning"
|
||||
elif [ "$BUILD_CONFIGURATION" == "verify" ]; then
|
||||
CODESIGNING_SUBPATH="build-system/fake-codesigning"
|
||||
else
|
||||
echo "Unknown configuration $1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COMMIT_COMMENT="$(git log -1 --pretty=%B)"
|
||||
case "$COMMIT_COMMENT" in
|
||||
*"[nocache]"*)
|
||||
export BAZEL_HTTP_CACHE_URL=""
|
||||
;;
|
||||
esac
|
||||
|
||||
COMMIT_ID="$(git rev-parse HEAD)"
|
||||
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an')
|
||||
if [ -z "$2" ]; then
|
||||
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||
BUILD_NUMBER_OFFSET="$(cat build_number_offset)"
|
||||
COMMIT_COUNT="$(($COMMIT_COUNT+$BUILD_NUMBER_OFFSET))"
|
||||
BUILD_NUMBER="$COMMIT_COUNT"
|
||||
else
|
||||
BUILD_NUMBER="$2"
|
||||
fi
|
||||
|
||||
BASE_DIR=$(pwd)
|
||||
|
||||
if [ "$BUILD_CONFIGURATION" == "hockeyapp" ] || [ "$BUILD_CONFIGURATION" == "appcenter-experimental" ] || [ "$BUILD_CONFIGURATION" == "appcenter-experimental-2" ] || [ "$BUILD_CONFIGURATION" == "appstore" ] || [ "$BUILD_CONFIGURATION" == "appstore-development" ]; then
|
||||
if [ ! `which generate-configuration.sh` ]; then
|
||||
echo "generate-configuration.sh not found in PATH $PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$BASE_DIR/$BUILDBOX_DIR/transient-data/telegram-codesigning"
|
||||
mkdir -p "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration"
|
||||
|
||||
case "$BUILD_CONFIGURATION" in
|
||||
"hockeyapp"|"appcenter-experimental"|"appcenter-experimental-2")
|
||||
generate-configuration.sh internal release "$BASE_DIR/$BUILDBOX_DIR/transient-data/telegram-codesigning" "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration"
|
||||
;;
|
||||
|
||||
"appstore")
|
||||
generate-configuration.sh appstore release "$BASE_DIR/$BUILDBOX_DIR/transient-data/telegram-codesigning" "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration"
|
||||
;;
|
||||
|
||||
"appstore-development")
|
||||
generate-configuration.sh appstore development "$BASE_DIR/$BUILDBOX_DIR/transient-data/telegram-codesigning" "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown build configuration $BUILD_CONFIGURATION"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
elif [ "$BUILD_CONFIGURATION" == "verify" ]; then
|
||||
mkdir -p "$BASE_DIR/$BUILDBOX_DIR/transient-data/telegram-codesigning"
|
||||
mkdir -p "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration"
|
||||
|
||||
cp -R build-system/fake-codesigning/* "$BASE_DIR/$BUILDBOX_DIR/transient-data/telegram-codesigning/"
|
||||
cp -R build-system/example-configuration/* "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration/"
|
||||
fi
|
||||
|
||||
if [ ! -d "$CODESIGNING_SUBPATH" ]; then
|
||||
echo "$CODESIGNING_SUBPATH does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOURCE_DIR=$(basename "$BASE_DIR")
|
||||
rm -f "$BUILDBOX_DIR/transient-data/source.tar"
|
||||
set -x
|
||||
find . -type f -a -not -regex "\\." -a -not -regex ".*\\./git" -a -not -regex ".*\\./git/.*" -a -not -regex "\\./bazel-bin" -a -not -regex "\\./bazel-bin/.*" -a -not -regex "\\./bazel-out" -a -not -regex "\\./bazel-out/.*" -a -not -regex "\\./bazel-testlogs" -a -not -regex "\\./bazel-testlogs/.*" -a -not -regex "\\./bazel-telegram-ios" -a -not -regex "\\./bazel-telegram-ios/.*" -a -not -regex "\\./buildbox" -a -not -regex "\\./buildbox/.*" -a -not -regex "\\./buck-out" -a -not -regex "\\./buck-out/.*" -a -not -regex "\\./\\.buckd" -a -not -regex "\\./\\.buckd/.*" -a -not -regex "\\./build" -a -not -regex "\\./build/.*" -print0 | tar cf "$BUILDBOX_DIR/transient-data/source.tar" --null -T -
|
||||
|
||||
PROCESS_ID="$$"
|
||||
|
||||
if [ -z "$RUNNING_VM" ]; then
|
||||
VM_NAME="$VM_BASE_NAME-$(openssl rand -hex 10)-build-telegram-$PROCESS_ID"
|
||||
else
|
||||
VM_NAME="$RUNNING_VM"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_MACHINE" == "linux" ]; then
|
||||
virt-clone --original "$VM_BASE_NAME" --name "$VM_NAME" --auto-clone
|
||||
virsh start "$VM_NAME"
|
||||
|
||||
echo "Getting VM IP"
|
||||
|
||||
while [ 1 ]; do
|
||||
TEST_IP=$(virsh domifaddr "$VM_NAME" 2>/dev/null | egrep -o 'ipv4.*' | sed -e 's/ipv4\s*//g' | sed -e 's|/.*||g')
|
||||
if [ ! -z "$TEST_IP" ]; then
|
||||
RESPONSE=$(ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null telegram@"$TEST_IP" -o ServerAliveInterval=60 -t "echo -n 1")
|
||||
if [ "$RESPONSE" == "1" ]; then
|
||||
VM_IP="$TEST_IP"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
elif [ "$BUILD_MACHINE" == "macOS" ]; then
|
||||
if [ -z "$RUNNING_VM" ]; then
|
||||
prlctl clone "$VM_BASE_NAME" --linked --name "$VM_NAME"
|
||||
prlctl start "$VM_NAME"
|
||||
|
||||
echo "Getting VM IP"
|
||||
|
||||
while [ 1 ]; do
|
||||
TEST_IP=$(prlctl exec "$VM_NAME" "ifconfig | grep inet | grep broadcast | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -1 | tr '\n' '\0'" 2>/dev/null || echo "")
|
||||
if [ ! -z "$TEST_IP" ]; then
|
||||
RESPONSE=$(ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null telegram@"$TEST_IP" -o ServerAliveInterval=60 -t "echo -n 1")
|
||||
if [ "$RESPONSE" == "1" ]; then
|
||||
VM_IP="$TEST_IP"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
echo "VM_IP=$VM_IP"
|
||||
fi
|
||||
|
||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr "$CODESIGNING_SUBPATH" telegram@"$VM_IP":codesigning_data
|
||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr "$BASE_DIR/$BUILDBOX_DIR/transient-data/build-configuration" telegram@"$VM_IP":telegram-configuration
|
||||
|
||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr "$BUILDBOX_DIR/guest-build-telegram.sh" "$BUILDBOX_DIR/transient-data/source.tar" telegram@"$VM_IP":
|
||||
|
||||
ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null telegram@"$VM_IP" -o ServerAliveInterval=60 -t "export BUILD_NUMBER=\"$BUILD_NUMBER\"; export BAZEL_HTTP_CACHE_URL=\"$BAZEL_HTTP_CACHE_URL\"; $GUEST_SHELL -l guest-build-telegram.sh $BUILD_CONFIGURATION" || true
|
||||
|
||||
OUTPUT_PATH="build/artifacts"
|
||||
rm -rf "$OUTPUT_PATH"
|
||||
mkdir -p "$OUTPUT_PATH"
|
||||
|
||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr telegram@"$VM_IP":"telegram-ios/build/artifacts/*" "$OUTPUT_PATH/"
|
||||
|
||||
if [ -z "$RUNNING_VM" ]; then
|
||||
if [ "$BUILD_MACHINE" == "linux" ]; then
|
||||
virsh destroy "$VM_NAME"
|
||||
virsh undefine "$VM_NAME" --remove-all-storage --nvram
|
||||
elif [ "$BUILD_MACHINE" == "macOS" ]; then
|
||||
echo "Deleting VM..."
|
||||
#prlctl stop "$VM_NAME" --kill
|
||||
#prlctl delete "$VM_NAME"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "$OUTPUT_PATH/Telegram.ipa" ]; then
|
||||
exit 1
|
||||
fi
|
||||
'''
|
||||
|
|
@ -101,7 +101,8 @@ python3 build-system/Make/Make.py \
|
|||
--configurationPath="$HOME/telegram-configuration" \
|
||||
--buildNumber="$BUILD_NUMBER" \
|
||||
--disableParallelSwiftmoduleGeneration \
|
||||
--configuration="$APP_CONFIGURATION"
|
||||
--configuration="$APP_CONFIGURATION" \
|
||||
--apsEnvironment=production
|
||||
|
||||
OUTPUT_PATH="build/artifacts"
|
||||
rm -rf "$OUTPUT_PATH"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue