Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
3d25d542
Commit
3d25d542
authored
Aug 16, 2016
by
stu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add role for configuring android worker
parent
4bfd391c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
149 additions
and
0 deletions
+149
-0
playbooks/edx-east/jenkins_worker_android.yml
+15
-0
playbooks/roles/android_sdk/defaults/main.yml
+13
-0
playbooks/roles/android_sdk/tasks/main.yml
+39
-0
playbooks/roles/jenkins_worker/meta/main.yml
+4
-0
playbooks/roles/jenkins_worker/tasks/main.yml
+2
-0
playbooks/roles/jenkins_worker/tasks/test_android_worker.yml
+17
-0
util/packer/jenkins_worker_android.json
+59
-0
No files found.
playbooks/edx-east/jenkins_worker_android.yml
0 → 100644
View file @
3d25d542
# Configure a Jenkins worker instance
# This has all the requirements to build, sign, and test the android
# client, but does not contain the platform
-
name
:
Configure instance(s)
hosts
:
jenkins_worker
become
:
True
gather_facts
:
True
vars
:
serial_count
:
1
android_worker
:
True
serial
:
"
{{
serial_count
}}"
roles
:
-
aws
-
jenkins_worker
playbooks/roles/android_sdk/defaults/main.yml
0 → 100644
View file @
3d25d542
---
# User/group to manage Android SDK
jenkins_user
:
"
jenkins"
jenkins_group
:
"
jenkins"
# Tarball to download
android_download
:
"
android-sdk_r24.4.1-linux.tgz"
# Checksum of Android SDK (from: https://developer.android.com/studio/index.html#downloads)
android_checksum
:
"
725bb360f0f7d04eaccff5a2d57abdd49061326d"
# path to installed android sdk
android_home
:
"
/opt/android-sdk-linux"
# individual android build targets to be downloaded via the androind sdk manager
android_build_targets
:
-
android-23
playbooks/roles/android_sdk/tasks/main.yml
0 → 100644
View file @
3d25d542
---
# Configure the Jenkins worker system for building the edx android application
-
name
:
Create jenkins group
group
:
name={{ jenkins_group }} state=present
# The Jenkins account needs a login shell because Jenkins uses scp
-
name
:
Add the jenkins user to the group and configure shell
user
:
name={{ jenkins_user }} append=yes group={{ jenkins_group }} shell=/bin/bash
# Download the Android SDK/tools tarball from Google's download site.
# NOTE: while it is the general policy to use repositories/ppas as much as possible
# it did not seem reliable for this work. Other avenues were explored:
# - pre-Ubuntu 16 releases do not contain the android sdk in their apt repos
# - the existing ppas containing the sdk are questionable
# - ubuntu-make did not seem reliable at the time of writing this
-
name
:
Download the Android SDK tarball
get_url
:
url
:
"
https://dl.google.com/android/{{
android_download
}}"
dest
:
/tmp/android-sdk.tgz
-
name
:
Verify checksum of Android SDK
shell
:
"
sha1sum
/tmp/android-sdk.tgz"
register
:
sdk_checksum
-
assert
:
that
:
"
'{{
android_checksum
}}'
in
sdk_checksum.stdout"
-
name
:
Unarchive tarball to /opt/android-sdk
unarchive
:
copy
:
no
src
:
/tmp/android-sdk.tgz
dest
:
/opt
creates
:
"
{{
android_home
}}"
owner
:
"
{{
jenkins_user
}}"
group
:
"
{{
jenkins_group
}}"
become
:
yes
# Use the android sdk manager to install the build targets necessary for the edx mobile app
-
name
:
Install Android API levels
shell
:
"
echo
'y'
|
{{
android_home
}}/tools/android
update
sdk
--no-ui
--filter
{{
','.join(android_build_targets)
}}"
become
:
yes
become_user
:
"
{{
jenkins_user
}}"
playbooks/roles/jenkins_worker/meta/main.yml
View file @
3d25d542
...
...
@@ -15,3 +15,7 @@ dependencies:
# dependencies for sitespeed worker
-
role
:
sitespeedio
when
:
sitespeed_worker is defined
# dependencies for android worker
-
role
:
android_sdk
when
:
android_worker is defined
playbooks/roles/jenkins_worker/tasks/main.yml
View file @
3d25d542
...
...
@@ -20,3 +20,5 @@
when
:
platform_worker is defined
-
include
:
test_sitespeed_worker.yml
when
:
sitespeed_worker is defined
-
include
:
test_android_worker.yml
when
:
android_worker is defined
playbooks/roles/jenkins_worker/tasks/test_android_worker.yml
0 → 100644
View file @
3d25d542
---
# Test that the Android sdk has been installed to the correct location
-
name
:
Verify Android SDK is installed
shell
:
"
stat
{{
android_home
}}/tools/android"
register
:
android_version
-
assert
:
that
:
-
"
android_version.rc
==
0"
# Test that the necessary build targets for building the edx app have
# been installed.
-
name
:
Verify correct Android build targets installed
shell
:
"
{{
android_home
}}/tools/android
list
target
|tr
'
\n
'
'
'"
register
:
build_targets
-
with_items
:
"
{{
android_build_targets
}}"
assert
:
that
:
-
"
'{{
item
}}'
in
build_targets.stdout"
util/packer/jenkins_worker_android.json
0 → 100644
View file @
3d25d542
{
"variables"
:
{
"aws_access_key"
:
"{{env `AWS_ACCESS_KEY_ID`}}"
,
"aws_secret_key"
:
"{{env `AWS_SECRET_ACCESS_KEY`}}"
,
"playbook_remote_dir"
:
"/tmp/packer-edx-playbooks"
,
"ami"
:
"{{env `JENKINS_WORKER_AMI`}}"
,
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
,
"remote_branch"
:
"{{env `REMOTE_BRANCH`}}"
},
"builders"
:
[{
"type"
:
"amazon-ebs"
,
"access_key"
:
"{{user `aws_access_key`}}"
,
"secret_key"
:
"{{user `aws_secret_key`}}"
,
"ami_name"
:
"jenkins_worker_android-{{isotime | clean_ami_name}}"
,
"instance_type"
:
"m3.large"
,
"region"
:
"us-east-1"
,
"source_ami"
:
"{{user `ami`}}"
,
"ssh_username"
:
"ubuntu"
,
"ami_description"
:
"jenkins worker android"
,
"iam_instance_profile"
:
"jenkins-worker"
,
"security_group_id"
:
"sg-75af5e18"
,
"tags"
:
{
"delete_or_keep"
:
"{{user `delete_or_keep`}}"
}
}],
"provisioners"
:
[{
"type"
:
"shell"
,
"inline"
:
[
"rm -rf {{user `playbook_remote_dir`}}"
,
"mkdir {{user `playbook_remote_dir`}}"
]
},
{
"type"
:
"file"
,
"source"
:
"../../playbooks/run_role.yml"
,
"destination"
:
"{{user `playbook_remote_dir`}}/run_role.yml"
},
{
"type"
:
"file"
,
"source"
:
"../../playbooks/roles"
,
"destination"
:
"{{user `playbook_remote_dir`}}/roles"
},
{
"type"
:
"file"
,
"source"
:
"../../playbooks/edx-east"
,
"destination"
:
"{{user `playbook_remote_dir`}}/edx-east"
},
{
"type"
:
"file"
,
"source"
:
"../../util/install/ansible-bootstrap.sh"
,
"destination"
:
"{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'"
,
"sudo bash ./ansible-bootstrap.sh"
]
},
{
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/edx-east/jenkins_worker_android.yml"
,
"playbook_dir"
:
"../../playbooks"
,
"command"
:
"source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"jenkins_worker"
,
"extra_arguments"
:
[
"-vvv"
]
}]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment