-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove clean timeout * Update branch name * Move run-streams job * Add install-tools.sh * Update repo_url to avoid a space into it * Fix ci script path * Move scripts into dedicated files * Checkout code because of two runners * Write in /tmp * Fix setup-project script * Add more ci scripts * Fix space * Add constants file * Use regex for certificate name * Update token * Use strategies
- Loading branch information
Showing
12 changed files
with
251 additions
and
115 deletions.
There are no files selected for viewing
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,14 @@ | ||
#!/bin/sh | ||
|
||
scripts_path_destination=$1 | ||
github_token=$2 | ||
branch=$3 | ||
|
||
if [[ -z $scripts_path_destination || -z $github_token || -z $branch ]] | ||
then | ||
echo "[!] Usage: $(echo $0) <scripts_path_destination> <github_token> <branch>" | ||
exit 1 | ||
fi | ||
|
||
rm -rf $scripts_path_destination | ||
git clone -b $branch "https://$github_token@github.com/SRGSSR/macos-ci-setup.git" $scripts_path_destination |
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,3 @@ | ||
#!/bin/bash | ||
|
||
REPOSITORY_PATH="~/_repo" |
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,15 @@ | ||
#!/bin/sh | ||
|
||
scripts_path="$1" | ||
runner_name="$2" | ||
github_output="$3" | ||
|
||
if [[ -z $scripts_path || -z $runner_name || -z $github_output ]] | ||
then | ||
echo "[!] Usage: $(echo $0) <scripts_path> <runner_name> <github_output>" | ||
exit 1 | ||
fi | ||
|
||
|
||
runner_group_label=$($scripts_path/runner-group-label.sh $runner_name) | ||
echo "runner_group_label=$runner_group_label" >> $github_output |
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,33 @@ | ||
#!/bin/sh | ||
|
||
scripts_path="$1" | ||
vm_name="$2" | ||
vm_image="$3" | ||
branch_name="$4" | ||
repo_url="$5" | ||
|
||
if [[ -z $scripts_path || -z $vm_name || -z $vm_image || -z $branch_name || -z $repo_url ]] | ||
then | ||
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name> <vm_image> <branch_name> <repo_url>" | ||
exit 1 | ||
fi | ||
|
||
|
||
tools="swiftlint shellcheck markdownlint-cli yamllint ffmpeg" | ||
ruby_version="3.3.5" | ||
bundler_version="2.5.22" | ||
|
||
$scripts_path/brew-fetch.sh $vm_name $tools | ||
|
||
$scripts_path/create-vm-for-project.sh $vm_name $vm_image | ||
$scripts_path/clone-repo-in-vm.sh $vm_name $branch_name $repo_url | ||
|
||
$scripts_path/run-vm-shell-command.sh $vm_name "brew install --quiet $tools" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "rbenv install --skip-existing $ruby_version" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "echo 'export PATH=\"$HOME/.rbenv/bin:\$PATH\"' >> ~/.zshrc" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "rbenv init - >> ~/.zshrc" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "rbenv global $ruby_version" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "sudo gem install bundler -v $bundler_version" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "curl --location https://github.com/shaka-project/shaka-packager/releases/download/v3.2.0/packager-osx-arm64 -o /opt/homebrew/bin/shaka-packager" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "chmod a+x /opt/homebrew/bin/shaka-packager" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "source ~/.zshrc" |
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,41 @@ | ||
#!/bin/sh | ||
|
||
scripts_path="$1" | ||
vm_name="$2" | ||
github_token="$3" | ||
|
||
if [[ -z $scripts_path || -z $vm_name || -z $github_token ]] | ||
then | ||
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name> <github_token>" | ||
exit 1 | ||
fi | ||
|
||
source "$(dirname $(realpath $0))/constants.sh" | ||
source "$(dirname $(realpath $0))/unlock-keychain.sh" | ||
|
||
configuration_dir_path="$REPOSITORY_PATH/Configuration" | ||
configuration_repo="github.com/SRGSSR/pillarbox-apple-configuration.git" | ||
configuration_script="$REPOSITORY_PATH/Scripts/checkout-configuration.sh" | ||
configuration_branch="certificate" | ||
configuration_commit="HEAD" | ||
|
||
certificate_path=$(realpath "$configuration_dir_path/*.p12") | ||
certificate_password="6YXTQTG8JJ" | ||
|
||
function import_certificate { | ||
security import $certificate_path -k $keychain_path -P $certificate_password -T /usr/bin/security -T /usr/bin/codesign | ||
} | ||
|
||
function add_certificate_to_keychain { | ||
unlock_keychain && import_certificate | ||
} | ||
|
||
function authorize_access_to_certificate_private_key { | ||
security set-key-partition-list -S apple-tool:,apple: -s -k $keychain_password $keychain_path | ||
} | ||
|
||
$scripts_path/run-vm-shell-command.sh $vm_name "rm -rf $configuration_dir_path" | ||
$scripts_path/run-vm-shell-command.sh $vm_name "$configuration_script https://$github_token@$configuration_repo $configuration_branch $configuration_commit $configuration_dir_path" | ||
$scripts_path/run-vm-shell-command.sh $vm_name echo $(add_certificate_to_keychain) | ||
$scripts_path/run-vm-shell-command.sh $vm_name echo $(authorize_access_to_certificate_private_key) | ||
$scripts_path/run-vm-shell-command.sh $vm_name "cd $REPOSITORY_PATH && make setup" |
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,8 @@ | ||
#!/bin/sh | ||
|
||
keychain_password="admin" | ||
keychain_path="~/Library/Keychains/login.keychain-db" | ||
|
||
function unlock_keychain { | ||
security unlock-keychain -p $keychain_password $keychain_path | ||
} |
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/sh | ||
|
||
scripts_path="$1" | ||
vm_name="$2" | ||
platform="$3" | ||
|
||
|
||
if [[ -z $scripts_path || -z $vm_name || -z $platform ]] | ||
then | ||
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name> <platform>" | ||
exit 1 | ||
fi | ||
|
||
source "$(dirname $(realpath $0))/constants.sh" | ||
source "$(dirname $(realpath $0))/unlock-keychain.sh" | ||
|
||
$scripts_path/run-vm-shell-command.sh $vm_name "cd $REPOSITORY_PATH && echo $(unlock_keychain) && make archive-demo-$(echo $platform)" |
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,14 @@ | ||
#!/bin/sh | ||
|
||
scripts_path="$1" | ||
vm_name="$2" | ||
|
||
if [[ -z $scripts_path || -z $vm_name ]] | ||
then | ||
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name>" | ||
exit 1 | ||
fi | ||
|
||
source "$(dirname $(realpath $0))/constants.sh" | ||
|
||
$scripts_path/run-vm-shell-command.sh $vm_name "cd $REPOSITORY_PATH && make check-quality" |
Oops, something went wrong.