AEM Compose
Universal tool to manage AEM instances everywhere!
-
Install Go: https://go.dev/doc/install,
-
Set up shell, append lines ~/.zshrc with content below then restart IDE/terminals,
export GOPATH="$HOME/go" export PATH="$GOPATH/bin:$PATH"
-
Setup IDE:
- IntelliJ IDEA
- Install Go Plugin
- Remember to "Enable Go Modules" in settings to fix syntax highlighting and autocompletion.
- IntelliJ IDEA
Ensure having installed Go then:
Use this method to develop comfortably the tool.
- Clone repository:
git clone git@github.com:wttech/aemc.git - Enter cloned directory and run command:
make*
*When using Git Bash on Windows, you will first need to add make to your Git Bash installation:
- Go to ezwinports.
- Download
make-x.x.x-without-guile-w32-bin.zip(get the newest version without guile). - Extract zip.
- Copy the contents to your
Git\mingw64\merging the folders, but do NOT overwrite/replace any existing files.
Use this method to check particular commit/version of the tool.
- latest released version:
go install github.com/wttech/aemc/cmd/aem@latest, - specific released version:
go install github.com/wttech/aemc/cmd/aem@v1.1.9, - recently committed version:
go install github.com/wttech/aemc/cmd/aem@main,
After installing AEM CLI by one of above methods now instruct the wrapper script to use it by running the following command:
export AEM_CLI_VERSION=installedTo start using again version defined in wrapper file, simply unset the environment variable:
unset AEM_CLI_VERSIONSimply run script:
sh release.sh <major.minor.patch>It will:
- bump version is source files automatically,
- commit changes,
- push release tag that will initiate release workflow.
| Pattern | Purpose | Example |
|---|---|---|
local_*.go |
Local instance-specific functionality | local_instance.go, local_instance_manager.go |
*_manager.go |
Manager classes handling collections/operations | package_manager.go, osgi_bundle_manager.go |
*_test.go |
Unit tests | instance_test.go |
*_int_test.go |
Integration tests (require running AEM) | osgi_int_test.go |
Three types of managers exist:
- AEM-level - owned by
AEMfacade, operate globally (VendorManager,ContentManager) - Instance-level - owned by
Instance, operate via HTTP (PackageManager,OSGiBundleManager) - Sub-entity - owned by facade types (
OSGiownsBundleManager,ConfigManager, etc.)
Domain entities have paired *State structs for serialization:
type OSGiBundle struct { manager *OSGiBundleManager; symbolicName string }
type OSGiBundleState struct { SymbolicName string `yaml:"symbolic_name"` }Methods returning (bool, error) indicate if change was made (for idempotent operations):
func (b OSGiBundle) Start() error { ... } // Always attempts
func (b OSGiBundle) StartWithChanged() (bool, error) // Returns false if already startedOSGi, Sling, Repo, Auth group related managers:
type OSGi struct {
bundleManager *OSGiBundleManager
componentManager *OSGiComponentManager
configManager *OSGiConfigManager
}Packages in pkg/common/ use *x suffix for extended stdlib functionality:
pathx, fmtx, httpx, stringsx, timex, osx, filex, cryptox, execx, tplx, netx
pkg/{domain}/ contains pure data types without AEM dependencies:
pkg/osgi/- OSGi data structurespkg/instance/- Instance constants and utilitiespkg/content/- Content manipulationpkg/keystore/- Keystore types

