Skip to content

Commit

Permalink
fix(build): update ci script
Browse files Browse the repository at this point in the history
Signed-off-by: Teclib <[email protected]>
  • Loading branch information
stonebuzz committed Jan 7, 2020
1 parent 7dc381d commit 4d3d219
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 124 deletions.
43 changes: 26 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ reference:
run:
name: Validate running
command: source ci/scripts/validate_running.sh

update_licenses: &update_licenses
run:
name: Update licenses
command: source ci/scripts/ci_licenses.sh
jobs:
# unit test
build:
<<: *android_config
steps:
- checkout
- *update_licenses
- *validate_running
- *restore_gradle_cache
- *ruby_dependencies
Expand All @@ -83,6 +87,7 @@ jobs:
<<: *android_config
steps:
- checkout
- *update_licenses
- *validate_running
- *restore_gradle_cache
- *ruby_dependencies
Expand All @@ -99,6 +104,7 @@ jobs:
<<: *android_config
steps:
- checkout
- *update_licenses
- *validate_running
- *restore_gradle_cache
- *ruby_dependencies
Expand All @@ -118,6 +124,7 @@ jobs:
<<: *android_config
steps:
- checkout
- *update_licenses
- *validate_running
- *restore_gradle_cache
- *ruby_dependencies
Expand All @@ -141,6 +148,7 @@ jobs:
<<: *android_config
steps:
- checkout
- *update_licenses
- *validate_running
- *restore_gradle_cache
- *ruby_dependencies
Expand Down Expand Up @@ -170,6 +178,7 @@ jobs:
<<: *android_config
steps:
- checkout
- *update_licenses
- *validate_running
- *restore_gradle_cache
- *ruby_dependencies
Expand Down Expand Up @@ -197,22 +206,22 @@ workflows:
ignore:
- master
- develop
#- test_instrumentation:
#context: org-global
#requires:
#- build
#filters:
#branches:
#ignore:
#- master
#- deploy_alpha:
#context: org-global
#requires:
#- test_instrumentation
#filters:
#branches:
#only:
#- develop
- test_instrumentation:
context: org-global
requires:
- build
filters:
branches:
ignore:
- master
- deploy_alpha:
context: org-global
requires:
- build
filters:
branches:
only:
- develop
- deploy_production:
context: org-global
requires:
Expand Down
48 changes: 48 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "1002939879902",
"firebase_url": "https://android-inventory-agent.firebaseio.com",
"project_id": "android-inventory-agent",
"storage_bucket": "android-inventory-agent.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1002939879902:android:5652f6e731d1e6d5350d4f",
"android_client_info": {
"package_name": "org.glpi.inventory.agent"
}
},
"oauth_client": [
{
"client_id": "1002939879902-69don3lar14ts8m1p3sspjm8j2gaq94k.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "org.glpi.inventory.agent",
"certificate_hash": "4287d795b3ca467f0920cca3c9e461129d5f6af1"
}
},
{
"client_id": "1002939879902-fbn5vl95r1i8uar6paiua7d5hkdp26fe.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBH0VWCAhtYnO1G9AC9WNH6chFMDtE5rZk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1002939879902-fbn5vl95r1i8uar6paiua7d5hkdp26fe.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
29 changes: 29 additions & 0 deletions ci/scripts/ci_licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#
# LICENSE
#
# This file is part of Flyve MDM Inventory Library for Android.
#
# Inventory Library for Android is a subproject of Flyve MDM.
# Flyve MDM is a mobile device management software.
#
# Flyve MDM is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# Flyve MDM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ---------------------------------------------------------------------
# @copyright Copyright © 2018 Teclib. All rights reserved.
# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
# @link https://github.com/flyve-mdm/android-inventory-library/
# @link http://flyve.org/android-inventory-library/
# @link https://flyve-mdm.com/
# ---------------------------------------------------------------------
#

# Manage sdk licenses
yes | sdkmanager --licenses || if [ $? -ne '141' ]; then exit $?; fi;
2 changes: 1 addition & 1 deletion ci/scripts/create_about_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ echo "about.build=$CIRCLE_BUILD_NUM" >> app/src/main/assets/about.properties
echo "about.date=$(date "+%a %b %d %H:%M:%S %Y")" >> app/src/main/assets/about.properties
echo "about.commit=${CIRCLE_SHA1:0:7}" >> app/src/main/assets/about.properties
echo "about.commitFull=$CIRCLE_SHA1" >> app/src/main/assets/about.properties
echo "about.github=https://github.com/flyve-mdm/flyve-mdm-android-agent" >> app/src/main/assets/about.properties
echo "about.github=https://github.com/glpi-project/android-inventory-agent" >> app/src/main/assets/about.properties
2 changes: 1 addition & 1 deletion ci/scripts/google_cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ gcloud firebase test android run \
--app $(ls -dt ~/flyve_mdm/app/build/outputs/apk/debug/*.apk | head -1) \
--test $(ls -dt ~/flyve_mdm/app/build/outputs/apk/androidTest/debug/*.apk | head -1) \
--device model=Nexus6,version=25,locale=en,orientation=portrait \
--timeout 90s
--timeout 180s
12 changes: 11 additions & 1 deletion ci/scripts/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,25 @@ sudo apt-get update
# install gems
sudo apt-get install ruby-full build-essential

# update Rubygems
sudo gem update --system

# install fastlane
sudo gem install fastlane --no-rdoc --no-ri
sudo gem install fastlane

# update bundler
sudo gem install bundler

# update Gemfile.lock
sudo bundler update --bundler

# install node package available on package.json
yarn install

# config git
git config --global user.email $GH_EMAIL
git config --global user.name "Teclib"

git remote remove origin
git remote add origin https://$GH_USER:$GH_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@teclib/android-inventory-agent",
"version": "1.0.0-rc.2",
"description": "Flyve MDM Inventory Agent for Android",
"description": "GLPI Android Inventory Agent",
"main": "index.js",
"scripts": {
"release": "standard-version -t ''"
},
"repository": {
"type": "git",
"url": "git+https://github.com/flyve-mdm/android-inventory-agent.git"
"url": "git+https://github.com/glpi-project/android-inventory-agent.git"
},
"keywords": [
"Android",
Expand All @@ -21,7 +21,7 @@
"author": "Rafael Hernandez <[email protected]> (https://flyve-mdm.com)",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/flyve-mdm/android-inventory-agent/issues"
"url": "https://github.com/glpi-project/android-inventory-agent/issues"
},
"homepage": "http://flyve.org/android-inventory-agent/",
"devDependencies": {
Expand Down
Loading

0 comments on commit 4d3d219

Please sign in to comment.