-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up CI with Azure Pipelines (#1089)
- Loading branch information
1 parent
174149e
commit 367b2a0
Showing
8 changed files
with
181 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
uname -a | ||
|
||
#setup for host | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/hosts/$OS_NAME/before_install.sh | ||
#source ~/.rvm/scripts/rvm | ||
#rvm list | ||
#setup for target | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/before_install.sh | ||
#install Ruby version specified in RHO_RUBY env var ( system Ruby by default ) | ||
#$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/check_cache_and_install_ruby.sh | ||
#rvm use $RHO_RUBY | ||
# run target-specific and host-specific install scripts ( for instance download and install NDK/SDK for Android targets) | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/hosts/$OS_NAME/install.sh | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/install.sh | ||
|
||
# start building of Rhodes gem in a separate gemset | ||
cd $BUILD_DIR | ||
#rvm gemset create rhodes | ||
#rvm gemset use rhodes | ||
|
||
bundle install | ||
gem list | ||
|
||
#TODO: build RhoRuby executable for host platform | ||
#- .ci/hosts/$TRAVIS_OS_NAME/build_rhoruby.sh | ||
|
||
# run target-specific and host-specific script before start of Rhodes gem build | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/hosts/$OS_NAME/pre_gem.sh | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/pre_gem.sh | ||
|
||
# build Rhodes gem | ||
$BUILD_DIR/lib/build/buildgem.rb | ||
|
||
# install Rhodes gem to clean gemset. All dependencies should be installed automatically | ||
gem install --no-document ./rhodes-$(cat ./version).gem | ||
|
||
# check rhodes path is valid | ||
#if [ "$(get-rhodes-info --rhodes-path)" != "$HOME/.rvm/gems/$RHO_RUBY@rhodes/gems/rhodes-$(cat ./version)" ] | ||
#then | ||
# echo "Unexpected path to Rhodes:" | ||
# echo "$(get-rhodes-info --rhodes-path)" | ||
# echo "Expected path:" | ||
# echo "$HOME/.rvm/gems/$RHO_RUBY@rhodes/gems/rhodes-$(cat ./version)" | ||
# exit 1 | ||
#fi | ||
|
||
# run target-specific rhodes-setup command | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/rho_setup.sh | ||
|
||
# clone and install rhoconnect-client gem | ||
.ci/install_rhoconnect-client.sh | ||
|
||
# clone and install rhoconnect-client gem if required by matrix config | ||
if [[ -n $RHO_TAU_EXTENSIONS ]]; then | ||
.ci/install_rho-tau-extensions.sh; | ||
fi | ||
|
||
# run target-specific script after all Rhodes build environment has been setup | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/post_gem.sh | ||
|
||
gem list | ||
cd $PIPELINE_WORKSPACE | ||
|
||
# generate few apps from scratch | ||
rhodes app vanilla_rhodes_app | ||
cd vanilla_rhodes_app | ||
#- safe_run_target_script upgrade_package.sh here we build not only android aps | ||
rhodes extension testext | ||
cd .. | ||
rhodes jsapp vanilla_rhodes_jsapp | ||
rhodes nodejsapp vanilla_rhodes_nodejsapp | ||
|
||
# clone testable app if required by matrix config | ||
if [[ -n $RHO_APP ]]; then | ||
git clone $($BUILD_DIR/.ci/app_repo.rb) $PIPELINE_WORKSPACE/$RHO_APP; | ||
cd $PIPELINE_WORKSPACE/$RHO_APP/$($BUILD_DIR/.ci/app_build_root.rb); | ||
fi | ||
|
||
if [[ -z $SKIP_BUILD ]]; then | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/build_artefact_for_deploy.sh; | ||
fi | ||
|
||
# add this for copy builded artifacts to foder for ipload to S3 | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/before_deploy.sh | ||
|
||
#TODO: change this to run specs in auto mode and collect results | ||
if [[ -z $SKIP_TESTS ]]; then | ||
$BUILD_DIR/.ci/safe_run.sh $BUILD_DIR/.ci/targets/$RHO_TARGET/$RHO_RUNNER_SCRIPT; | ||
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
#brew install gnupg2 | ||
#gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | ||
#\curl -sSL https://get.rvm.io | bash -s stable | ||
#source ~/.rvm/scripts/rvm | ||
#rvm list |
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,6 +1,6 @@ | ||
#!/usr/bin/env bash | ||
set -x | ||
|
||
cd $HOME/vanilla_rhodes_app | ||
cd $PIPELINE_WORKSPACE/vanilla_rhodes_app | ||
|
||
rake run:iphone:rhosimulator |
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,67 @@ | ||
name: rhomobile | ||
|
||
variables: | ||
- name: BUILD_DIR | ||
value: $(Build.Repository.LocalPath) | ||
- name: TRAVIS_BUILD_DIR | ||
value: $(Build.Repository.LocalPath) | ||
- name: OS_NAME | ||
value: osx | ||
- name: RHO_TARGET | ||
value: rhosimulator_osx | ||
- name: RHO_RUNNER_SCRIPT | ||
value: run_app_on_simulator.sh | ||
- name: RHO_RUBY | ||
value: ruby-2.7.4 | ||
- name: ruby_version | ||
value: '2.7.4' | ||
- name: BUILD_ARTEFACTS_DIR | ||
value: $(Pipeline.Workspace)/build_artefacts | ||
- name: RHO_APP | ||
value: "" | ||
|
||
- name: QTDIR | ||
value: $(Pipeline.Workspace)/Qt5.15.2/5.15.2/clang_64 | ||
|
||
- name: S3_JOB_DIR | ||
value: "$(Build.SourceVersion)/${{ variables.OS_NAME }}" | ||
|
||
- name: S3_DEPLOY_DIR | ||
value: "$(Build.Repository.Name)/$(Build.SourceBranchName)" | ||
|
||
trigger: | ||
branches: | ||
exclude: | ||
- '*' | ||
|
||
stages: | ||
- stage: build | ||
jobs: | ||
- job: build | ||
pool: | ||
vmImage: 'macOS-10.15' | ||
steps: | ||
# - task: Bash@3 | ||
# inputs: | ||
# targetType: 'inline' | ||
# script: 'env | sort' | ||
- task: UseRubyVersion@0 | ||
inputs: | ||
versionSpec: $(ruby_version) | ||
- task: Bash@3 | ||
inputs: | ||
targetType: 'inline' | ||
script: 'mkdir $BUILD_ARTEFACTS_DIR' | ||
|
||
- script: $BUILD_DIR/.ci/azure-build.sh | ||
|
||
- task: S3Upload@1 | ||
inputs: | ||
regionName: 'eu-central-1' | ||
bucketName: 'tau-autobuilds' | ||
sourceFolder: '$(BUILD_ARTEFACTS_DIR)' | ||
globExpressions: '**' | ||
targetFolder: $(S3_DEPLOY_DIR)/$(S3_JOB_DIR)-$(RHO_TARGET)-$(RHO_APP) | ||
filesAcl: 'public-read' | ||
logRequest: true | ||
logResponse: true |
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