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
5d0c2216
Commit
5d0c2216
authored
Oct 30, 2016
by
stu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update packer scripts to use ansible bootstrap script
parent
bf898029
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
146 deletions
+68
-146
util/packer/harprofiler.json
+22
-18
util/packer/jenkins_worker.json
+9
-43
util/packer/jenkins_worker_android.json
+2
-13
util/packer/jenkins_worker_simple.json
+14
-37
util/packer/jenkins_worker_sitespeedio.json
+21
-35
No files found.
util/packer/harprofiler.json
View file @
5d0c2216
...
...
@@ -3,7 +3,9 @@
"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 `HARPROFILER_BASE_AMI`}}"
"venv_dir"
:
"/edx/app/edx_ansible/venvs/edx_ansible"
,
"ami"
:
"{{env `HARPROFILER_BASE_AMI`}}"
,
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
},
"builders"
:
[{
"type"
:
"amazon-ebs"
,
...
...
@@ -13,30 +15,32 @@
"source_ami"
:
"{{user `ami`}}"
,
"instance_type"
:
"m1.small"
,
"ssh_username"
:
"ubuntu"
,
"ami_name"
:
"harprofiler-{{isotime | clean_ami_name}}"
"ami_name"
:
"harprofiler-{{isotime | clean_ami_name}}"
,
"tags"
:
{
"delete_or_keep"
:
"{{user `delete_or_keep`}}"
}
}],
"provisioners"
:
[{
"type"
:
"shell"
,
"inline"
:
[
"rm -rf {{user `playbook_remote_dir`}}"
]
"inline"
:
[
"rm -rf {{user `playbook_remote_dir`}}"
,
"mkdir {{user `playbook_remote_dir`}}"
]
},
{
"type"
:
"file"
,
"source"
:
"../../playbooks"
,
"destination"
:
"{{user `playbook_remote_dir`}}"
},
{
"type"
:
"file"
,
"source"
:
"../../requirements.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/requirements.txt"
},
{
"type"
:
"file"
,
"source"
:
"../../github.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/github.txt"
"source"
:
"../../util/install/ansible-bootstrap.sh"
,
"destination"
:
"{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"virtualenv packer-venv"
,
". packer-venv/bin/activate"
,
"pip install -q -r requirements.txt"
,
"echo 'localhost' > inventory.ini"
,
"ansible-playbook run_role.yml -i inventory.ini -c local -e role=harprofiler -vvvv"
]
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'"
,
"sudo bash ./ansible-bootstrap.sh"
]
},
{
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/edx-east/harprofiler.yml"
,
"playbook_dir"
:
"../../playbooks"
,
"command"
:
". {{user `venv_dir`}}/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"harprofiler_worker"
,
"extra_arguments"
:
[
"-vvv"
]
}]
}
util/packer/jenkins_worker.json
View file @
5d0c2216
...
...
@@ -3,9 +3,11 @@
"aws_access_key"
:
"{{env `AWS_ACCESS_KEY_ID`}}"
,
"aws_secret_key"
:
"{{env `AWS_SECRET_ACCESS_KEY`}}"
,
"playbook_remote_dir"
:
"/tmp/packer-edx-playbooks"
,
"venv_dir"
:
"/edx/app/edx_ansible/venvs/edx_ansible"
,
"ami"
:
"{{env `JENKINS_WORKER_AMI`}}"
,
"test_platform_version"
:
"{{env `TEST_PLATFORM_VERSION`}}"
,
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
,
"remote_branch"
:
"{{env `REMOTE_BRANCH`}}"
},
"builders"
:
[{
"type"
:
"amazon-ebs"
,
...
...
@@ -28,65 +30,29 @@
"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"
:
"../../requirements.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/requirements.txt"
},
{
"type"
:
"file"
,
"source"
:
"../../github.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/github.txt"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo add-apt-repository ppa:git-core/ppa -y"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get update"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get -y install git-core"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get -y install libmysqlclient-dev"
]
"source"
:
"../../util/install/ansible-bootstrap.sh"
,
"destination"
:
"{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"virtualenv packer-venv"
,
". packer-venv/bin/activate"
,
"pip install -q -r requirements.txt"
]
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'"
,
"sudo bash ./ansible-bootstrap.sh"
]
},
{
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/edx-east/jenkins_worker.yml"
,
"playbook_dir"
:
"../../playbooks"
,
"command"
:
"
source {{user `playbook_remote_dir`}}/packer-venv
/bin/activate && ansible-playbook"
,
"command"
:
"
. {{user `venv_dir`}}
/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"jenkins_worker"
,
"extra_arguments"
:
[
"-e
\"
jenkins_edx_platform_version={{user `test_platform_version`}}
\"
"
,
"-vvv"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"rm -rf packer-venv"
,
"virtualenv packer-venv"
,
". packer-venv/bin/activate"
,
"pip install -q -r requirements.txt"
]
},
{
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/run_role.yml"
,
"playbook_dir"
:
"../../playbooks"
,
"command"
:
"
source {{user `playbook_remote_dir`}}/packer-venv
/bin/activate && ansible-playbook"
,
"command"
:
"
. {{user `venv_dir`}}
/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"jenkins_worker"
,
"extra_arguments"
:
[
"-e
\"
role=test_build_server test_edx_platform_version={{user `test_platform_version`}}
\"
"
,
...
...
util/packer/jenkins_worker_android.json
View file @
5d0c2216
...
...
@@ -3,6 +3,7 @@
"aws_access_key"
:
"{{env `AWS_ACCESS_KEY_ID`}}"
,
"aws_secret_key"
:
"{{env `AWS_SECRET_ACCESS_KEY`}}"
,
"playbook_remote_dir"
:
"/tmp/packer-edx-playbooks"
,
"venv_dir"
:
"/edx/app/edx_ansible/venvs/edx_ansible"
,
"ami"
:
"{{env `JENKINS_WORKER_AMI`}}"
,
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
,
"remote_branch"
:
"{{env `REMOTE_BRANCH`}}"
...
...
@@ -29,18 +30,6 @@
"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"
},
{
...
...
@@ -52,7 +41,7 @@
"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"
,
"command"
:
"
. {{user `venv_dir`}}
/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"jenkins_worker"
,
"extra_arguments"
:
[
"-vvv"
]
}]
...
...
util/packer/jenkins_worker_simple.json
View file @
5d0c2216
...
...
@@ -3,8 +3,11 @@
"aws_access_key"
:
"{{env `AWS_ACCESS_KEY_ID`}}"
,
"aws_secret_key"
:
"{{env `AWS_SECRET_ACCESS_KEY`}}"
,
"playbook_remote_dir"
:
"/tmp/packer-edx-playbooks"
,
"venv_dir"
:
"/edx/app/edx_ansible/venvs/edx_ansible"
,
"ami"
:
"{{env `JENKINS_WORKER_AMI`}}"
,
"test_platform_version"
:
"{{env `TEST_PLATFORM_VERSION`}}"
"test_platform_version"
:
"{{env `TEST_PLATFORM_VERSION`}}"
,
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
,
"remote_branch"
:
"{{env `REMOTE_BRANCH`}}"
},
"builders"
:
[{
"type"
:
"amazon-ebs"
,
...
...
@@ -17,58 +20,32 @@
"ssh_username"
:
"ubuntu"
,
"ami_description"
:
"jenkins worker"
,
"iam_instance_profile"
:
"jenkins-worker"
,
"security_group_id"
:
"sg-75af5e18"
"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"
:
"../../requirements.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/requirements.txt"
},
{
"type"
:
"file"
,
"source"
:
"../../github.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/github.txt"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo add-apt-repository ppa:git-core/ppa -y"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get update"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get -y install git-core"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get -y install libmysqlclient-dev"
]
"source"
:
"../../util/install/ansible-bootstrap.sh"
,
"destination"
:
"{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"virtualenv packer-venv"
,
". packer-venv/bin/activate"
,
"pip install -q -r requirements.txt"
]
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'"
,
"sudo bash ./ansible-bootstrap.sh"
]
},
{
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/edx-east/jenkins_worker.yml"
,
"playbook_dir"
:
"../../playbooks"
,
"command"
:
"
source {{user `playbook_remote_dir`}}/packer-venv
/bin/activate && ansible-playbook"
,
"command"
:
"
. {{user `venv_dir`}}
/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"jenkins_worker"
,
"extra_arguments"
:
[
"-vvv"
]
]
}]
}
util/packer/jenkins_worker_sitespeedio.json
View file @
5d0c2216
...
...
@@ -3,7 +3,10 @@
"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`}}"
"venv_dir"
:
"/edx/app/edx_ansible/venvs/edx_ansible"
,
"ami"
:
"{{env `JENKINS_WORKER_AMI`}}"
,
"delete_or_keep"
:
"{{env `DELETE_OR_KEEP_AMI`}}"
,
"remote_branch"
:
"{{env `REMOTE_BRANCH`}}"
},
"builders"
:
[{
"type"
:
"amazon-ebs"
,
...
...
@@ -16,49 +19,32 @@
"ssh_username"
:
"ubuntu"
,
"ami_description"
:
"jenkins worker sitespeedio"
,
"iam_instance_profile"
:
"jenkins-worker"
,
"security_group_id"
:
"sg-75af5e18"
"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"
:
"../../requirements.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/requirements.txt"
},
{
"type"
:
"file"
,
"source"
:
"../../github.txt"
,
"destination"
:
"{{user `playbook_remote_dir`}}/github.txt"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo add-apt-repository ppa:git-core/ppa -y"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get update"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo apt-get -y install git-core"
]
"source"
:
"../../util/install/ansible-bootstrap.sh"
,
"destination"
:
"{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cd {{user `playbook_remote_dir`}}"
,
"virtualenv packer-venv"
,
". packer-venv/bin/activate"
,
"pip install -q -r requirements.txt"
,
"echo '[jenkins_worker]' > inventory.ini"
,
"echo 'localhost' >> inventory.ini"
,
"ansible-playbook edx-east/jenkins_worker_sitespeedio.yml -i inventory.ini -c local -vvvv"
]
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'"
,
"sudo bash ./ansible-bootstrap.sh"
]
},
{
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/edx-east/jenkins_worker_sitespeedio.yml"
,
"playbook"
:
"../../playbooks"
,
"command"
:
". {{user `venv_dir`}}/bin/activate && ansible-playbook"
,
"inventory_groups"
:
"jenkins workers"
,
"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