# Amorphie Deployment
## Versiyonlama
* Belirli bir client versiyonunda bir akisin birden fazla versiyonu calisabilir (A/B Testing, Experiment).
* Client tarafinda versiyonlama Dinamik navigation tanimlari(side navigation, context navigation) ile yonetilir (Feature Management).
* Gelistirme tarafinda farkli versiyon akislari farkli akis tanim dosyalari ile yonetilir.
* Ayni anda bir akisin birden fazla versiyonu dagitilabilir.
* Versiyonlama icin semantik versiyonlama kullanilir. https://semver.org/
## Temel Bilesenler
### Kullanici Arabirimleri
Is akisinda transition, state view olarak veya direkt page component olarak dagitilan arabirim kodlaridir. Bugun dynamic flutter olan bu kodlar, farkli teknolojilerle de uretilebicegi bilinmelidir.
```json
{
"domain": "amorphie",
"title": "deposit-account-opening-input-view",
"version": "1.0.1",
"type": "dynamic-flutter",
"content": "..."
],
}
```
### Amoprhie Akisi
Json formatinda bulunan amoprhie state machine is akis bilgisini tutan tanim dosyasidir.
Akis icinde Referans verilen bilesenler versiyon bilgisi ile refere edilir.
Client ve Backend sistemin minimum versiyon kontrolu runtime icerisinde tanimlanir.
* Her bir client icin minimum runtime versiyonu verilebilir.
* Eger bir client icin minimum runtime versiyonu verilmemisse tum client verisyonlari tarafindan calistirilabilecegi kabul edilir.
* Amorhie runtime icin specific olarak "engine" client name ile ilerlenir ve minimum runtime bunun uzerinden set edilir.
```json
{
"version": "1.0.0",
"title": "deposit-account-opening",
"runtime": [
{
"engine": "0.8.1",
"on-mobile-app": "1.1.0",
"burgan-mobile-app": "1.1.0"
}
],
"attributes": {
"domain": "amorphie",
"states": [
{
"views": [
{
"x-amorphie-aspect": "reference",
"key": "deposit-account-opening-input-view",
"domain": "amorphie",
"version": "1.0"
}
]
}
]
}
}
```
Akisin 1.1.0 versiyonu. Iliski viewlerde versiyonla iliskilendirilir.
```json
{
"version": "1.1.0",
"title": "deposit-account-opening",
"runtime": [
{
"engine": "0.8.1"
}
],
"attributes": {
"domain": "amorphie",
"states": [
{
"views": [
{
"x-amorphie-aspect": "reference",
"key": "deposit-account-opening-input-view",
"domain": "amorphie",
"version": "1.1"
}
]
}
]
}
}
```
:::info
"x-amorphie-aspect": "reference" bazli referans iliskilerinde versionun bos gecmesi durumunda latest calisir.
:::
### Zeebe Akisi
BPML seklinde Zeebe ustune dagitimi yapilan akis dosyasidir. BPML dosyalarida versiyon sekilde tutulur ve dagitilir.
### Apisix Tanimlari
Repo icindeki dagitilacak tum bilesenlerle ilgili api gateway tanim verilerini icerir.
### pipeline.json
Dagitimin hangi asamalardan ilerleyecegini belirler. Farkli akis, gorunum veya domainler farkli runtimelar uzerinde stage edilerek deploy edilir.
```json
{
"stages": [
{
"stage": 1,
"name": "test",
"namespace": "amorhie-account-test",
"approvals": [
"release-managers"
]
},
{
"stage": 2,
"name": "preprod",
"namespace": "amorhie-account-preprod",
"approvals": [
"test",
"business-owner",
"it-security"
]
},
{
"stage": 3,
"name": "pilot",
"namespace": "amorhie-account-pilot",
"approvals": [
"release-managers"
]
},
{
"stage": 4,
"name": "prod",
"namespace": "amorhie-account-prod",
"approvals": [
"business-owner"
]
}
]
}
```
:::warning
Acil akis ve staging icin gerekecek ek propertiler ile genisletilmelidir.
:::
:::danger
Developer pipeline ile kesin oynar, yasal uyumsuzluk, hatta atali prod yapar.
Pipeline dosya sorumlugu, repo iliskili ile devopsda olmali.
:::
## Pipeline
Tek bir pipeline uzerinden master branch ustunden release alinmasi hedeflenmistir.
Deployment aninda bilesenlerin sadece versiyon degisiklikleri ile dagitimi yapilacaktir. Bunun icin -head/git diff- bilgisi yeterlidir.
Tum amorhie repolari generic bir pipeline ile tanimli pipeline.json dosyasi baz alinarak dagitilir.
- [X] Degisiklige ugrayan tum bilesenler dagitilir.
- [ ] Tum bilesenler dagitilir.
Onaycilar.
1. Release Manager
2. Test Approve
3. Security Approve
4. Business Approve
:::info
Pipeline degisen artifacler icin test senaryosunu genere eder!
Ortak artifact kullanimlarinda eksik test senaryonsunun onune gecilir.
:::
### Folder Hiyerarsi (Multi Version in Single Repo)
Dagitilacak her bir repo icin olusturulacak folder yapisi ornegi (Vadeli hesap acma icin);
Versiyonalabilir bilesenler versiyonu belirten folder yapisi yonetilir.
* **definitions**
* **flows**:
* **deposit-account-opening**
* **1.0**
* deposit-account-opening.json
* **zeebe**
* deposit-account-opening.bpml
* **1.1**
* deposit-account-opening.json
* **zeebe**
* deposit-account-opening.bpml
* **2.0**
* deposit-account-opening.json
* **zeebe**
* deposit-account-opening.bpml
* **views**:
* **deposit-account-opening-input-view**
* **1.0**
* deposit-account-opening-input-view.json
* **1.1**
* deposit-account-opening-input-view.json
* **checking-account-list-view**
* **1.0**
* checking-account-list-view.json
* **schemas**
* **functions**
* **extensions**
* **features**
* **infrastructure**
* pipeline.json EXCLUDE - Developerdan Kork !
* **apisix**:
* apisix.sh
* **tests**
* **flows**
* deposit-account-opening-postman.json
* **mocks**
* fora-mocks.json