Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

Commit f9c7627

Browse files
author
Enzo Rivello
authored
Merge pull request #73 from Alfresco/develop
Develop
2 parents b5827bb + 01dccbe commit f9c7627

File tree

2 files changed

+17
-85
lines changed

2 files changed

+17
-85
lines changed

README.md

+16-84
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,26 @@
1-
Checkout the [Alfresco SPK presentation](http://www.slideshare.net/m.pillitu/alfresco-spkalfrescoday) at Alfresco Day.
1+
# Alfresco SPK
22

3-
## What is Alfresco SPK
43
Alfresco SPK is a toolset that can be used by stack operators (Devops/Architects/Engineers, Support, QA, Sales, Marketing, ...) to define Alfresco immutable Images, testing them locally first, also for arbitrarily complex architectures.
54

65
It allows you to:
76

8-
1. Run an arbitrarily complex stack locally
9-
2. Build (immutable) image(s) with the exact same provisioning logic used for local run
10-
3. Test immutable images locally
11-
4. Run a stack on any orchestration tool with the same provisioning logic used for local runs
7+
- Run an arbitrarily complex stack locally
8+
- Build (immutable) image(s) with the exact same provisioning logic used for local run
9+
- Test immutable images locally
10+
- Run a stack on any orchestration tool with the same provisioning logic used for local runs
1211

13-
## Installation
14-
Alfresco SPK uses ([Vagrant](https://www.vagrantup.com) and) [vagrant-packer-plugin](https://github.com/Alfresco/vagrant-packer-plugin) to build images and [chef-alfresco](https://github.com/Alfresco/chef-alfresco) to install Alfresco inside the boxes.
12+
### How to contribute
13+
To avoid any problem on master, we are implementing git-flow.
14+
To contribute, follow this:
1515

16-
Please install:
17-
* [Vagrant](https://www.vagrantup.com/downloads.html)
18-
* [Virtualbox](https://www.virtualbox.org/)
19-
* [Packer](https://packer.io/downloads.html)
16+
- Fork this repository
17+
- Make your changes
18+
- Test your changes
19+
- Open a pull request to develop
2020

21-
To install the Vagrant Packer Plugin:
22-
```
23-
vagrant plugin install vagrant-packer-plugin
24-
```
2521

26-
## Run a stack locally
27-
```
28-
git clone https://github.com/Alfresco/alfresco-spk.git
29-
cd alfresco-spk/stacks/community-allinone
30-
vagrant up
31-
```
32-
Browse [stacks](stacks) folder and change `VAGRANT_VAGRANTFILE` to test the stack of your choice; to customize it, read more about `Stack definitions` below.
22+
### External References
3323

34-
## Build an Image
35-
```
36-
git clone https://github.com/Alfresco/alfresco-spk.git
37-
cd alfresco-spk/stacks/community-allinone
38-
vagrant packer-build
39-
```
40-
This will build an Amazon AMI, but could also create an OVF, Vagrant .box or any other nature [supported by Packer](https://www.packer.io/docs/templates/builders.html)
41-
42-
## Concepts
43-
44-
### What is an Instance template
45-
An Instance Template is a JSON file that includes all information to build an immutable image; it contains:
46-
1. chef-alfresco configuration, using Chef attributes syntax; it also includes the list of recipes to invoke (`run_list`)
47-
2. vagrant-packer configuration, using Packer syntax
48-
49-
Alfresco SPK provides a [list of pre-defined instance-templates](instance-templates) that are used by the sample stacks.
50-
51-
### Stack definitions
52-
In every [stack example](stack-examples) you will find the following items:
53-
```
54-
# Where the instance template is located
55-
instance_template_path = "../instance-templates/community-allinone.json"
56-
57-
# chef-alfresco binary
58-
cookbooks_url = "https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/devops/chef-alfresco/0.6.20/chef-alfresco-0.6.20.tar.gz"
59-
60-
# chef-alfresco recipes to invoke
61-
run_list = ["alfresco::default"]
62-
```
63-
64-
Single-instance stacks - such as [Alfresco Community Allinone](stacks/community-allinone.vagrant.rb) - are simpler to start with; if you're looking for multi-machine configurations, check [Alfresco Enterprise Clustered](stacks/enterprise-clustered.vagrant.rb)
65-
66-
### Alfresco Enterprise
67-
```
68-
export MVN_CHEF_REPO_USERNAME=<your_nexus_user>
69-
export MVN_CHEF_REPO_PASSWORD=<your_nexus_password>
70-
71-
cd stacks/enterprise-clustered
72-
vagrant up
73-
```
74-
75-
### Integrating with Orchestration tools (WIP)
76-
When AMIs are (or not) in place and provisioning logic have been tested locally, it is possible to configure other orchestration tools and/or Cloud providers in order to spin up the same stack remotely.
77-
78-
Alfresco SPK provides a [chef-bootstrap.sh](scripts/chef-bootstrap.sh) that can be used to easily integrate with the orchestration tool of your choice; below we provide an integration example using AWS Cloudformation (and [UserData](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) attribute)
79-
80-
```
81-
CHEF_NODE_NAME=allinone
82-
CHEF_INSTANCE_TEMPLATE=https://raw.githubusercontent.com/alfresco/alfresco-spk/master/instance-templates/community-allinone.json
83-
84-
CHEF_LOCAL_YAML_VARS_URL=file://$WORK_DIR/local-vars.yaml
85-
cat > $CHEF_LOCAL_YAML_VARS_URL << "EOF"
86-
---
87-
alfresco:
88-
public_hostname: '{"Fn::GetAtt": ["ElasticLoadBalancer","DNSName"]}'
89-
EOF
90-
91-
ruby chef-bootstrap.rb
92-
```
93-
94-
The expression `{"Fn::GetAtt": ["ElasticLoadBalancer","DNSName"]}` is Cloudformation-specific and reads the `DNSName` value of an `ElasticLoadBalancer` instance defined in the same Cloudformation template.
24+
- [BeeCon presentation](https://www.youtube.com/watch?v=-L1CjPA2R6E)
25+
- [Alfresco Tech Talk Live #95](https://www.youtube.com/watch?v=y1ZbVvy_Evc)
26+
- [Alfresco SPK Presentation at AlfrescoDay](http://www.slideshare.net/m.pillitu/alfresco-spkalfrescoday)

packer/provisioners/chef.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "chef-solo",
33
"execute_command" : "cd /tmp/packer-chef-solo && ln -s cookbooks-0 cookbooks && {{if .Sudo}}sudo {{end}}chef-client --no-color -z -j {{.JsonPath}}",
4-
"install_command": "{{if .Sudo}}sudo {{end}}bash -c 'curl -L https://www.opscode.com/chef/install.sh| bash -s'",
4+
"install_command": "{{if .Sudo}}sudo {{end}}bash -c 'curl -L https://www.opscode.com/chef/install.sh| bash -s -- -v {{ user `chef_version` }}'",
55
"prevent_sudo": false,
66
"skip_install": false,
77
"run_list": ["{{user `run_list_item`}}"]

0 commit comments

Comments
 (0)