Skip to content

Commit ac32ce9

Browse files
authored
[Composer] Add Update Flag (#530)
1 parent 9b00d65 commit ac32ce9

File tree

7 files changed

+29
-1
lines changed

7 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Added
9+
- [Composer] Update flags
810

911
## [0.1.108] - 2021-01-28
1012
### Changed

roles/composer/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Added
9+
- Update flags
810

911
## [2.0.5] - 2021-01-27
1012
### Fixed

roles/composer/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,19 @@ None.
4646
| `manala_composer_bin` | '/usr/local/bin/composer' | String | Binary path |
4747
| `manala_composer_users_auth_template` | ~ | String | User auth template path |
4848
| `manala_composer_users_auth` | [] | Array | User auth config |
49+
| `manala_composer` | {} | Dict | Use for custom flags |
4950

5051
### Configuration example
5152

5253
### Versions
5354

5455
By default, the role installs the latest version of composer (channel stable).
55-
If you want the latest version of a specific channel (major version), set `manala_composer_version` value to the desired channel (ie `1` or `2`)
5656
If you want a specific version, set `manala_composer_version` value to the desired version (ie `1.10.16`)
57+
If you want the latest version of a specific channel (major version), set `manala_composer_version` value to the desired channel (ie `1` or `2`)
58+
59+
If you set a specific channel, and want to update to the latest version of this specific channel :
60+
- Set `manala_composer_version` value to the desired channel (ie `1` or `2`)
61+
- Set `manala_composer.update=true`
5762

5863
#### Composer configuration with github token
5964

roles/composer/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ manala_composer_bin: /usr/local/bin/composer
1616
# Users - Auth
1717
manala_composer_users_auth_template: ~
1818
manala_composer_users_auth: []
19+
20+
# Flags
21+
manala_composer: {}

roles/composer/tasks/install.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@
4040
manala_composer_version|string != __manala_composer_bin_check_result.stdout|regex_replace('(.*)(\\d+)(\\.\\d+\\.\\d+.*)', '\\2')
4141
)
4242
)
43+
or (
44+
__manala_composer['update']
45+
)

roles/composer/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
tags:
66
- manala_composer
77
- manala_composer.install
8+
- manala_composer.update
9+
- manala.update
810

911
# Users Auth
1012
- import_tasks: users_auth.yml

roles/composer/vars/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
3+
# Flags
4+
__manala_composer: "{{
5+
{
6+
'update': False
7+
}|combine(
8+
manala|default({}),
9+
manala_composer
10+
)
11+
}}"

0 commit comments

Comments
 (0)