aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks
Commit message (Collapse)AuthorAgeFilesLines
* Bump clever waiting time to 1 hourAntoine Vandecreme2021-06-032-6/+6
|
* deploy: try to restart the app when the CLI asks to do itPaul Bonaud2020-08-062-1/+15
| | | | | | | | | | | | | | | In some cases (rollback or deployment errored on clever side), clever-tools will fail when calling `clever deploy` because it thinks the currently being deployed commit is already deployed. However in some cases the git pushed commit is not the currently running commit. Leading to a failure in our deployment process. The proposed solution from the clever tools error is to launch `clever restart`. Until we wait for https://github.com/CleverCloud/clever-tools/issues/422 to be fixed, let's do what the error message say: try to restart in case of a deployment failure.
* Remove compatibility code for now-unsupported clever-tools versionsClement Delafargue2020-07-021-16/+1
|
* Add support for linking service dependenciesClement Delafargue2020-07-022-0/+23
|
* Don't run `clever deploy` if the app is up-to-dateClement Delafargue2020-06-302-1/+2
| | | | | | | | | | | Running `git push` when the remote is up-to-date no-ops (it does not trigger a deployment, but it does not fail either). Running `clever deploy` when the remote is up-to-date triggers a failure. Here, we care about the _end result_ (ie the app is deployed on the correct commit), so no-oping is more appropriate. This behaviour is not baked in `clever-tools`, but I think it should. I opened an issue. This script is a temporary workaround. (at least I hope it's temporary) https://github.com/CleverCloud/clever-tools/issues/422
* fix: prevent crash when the deployment times outPaul Bonaud2020-06-291-1/+1
|
* feature: add a new 'clever_restart_only' flag to restart an appPaul Bonaud2020-06-232-0/+31
| | | | | This new flag will perform a restart on the target clever cloud application instead of deploying it.
* Add support for scalability configurationClement Delafargue2020-06-222-0/+15
| | | | Closes #52
* Inline `clever scale --build-flavor` commandClement Delafargue2020-06-192-3/+1
|
* Add optional build flavor configurationClement Delafargue2020-06-192-0/+10
|
* Extract environment building tasks from the JSON templateClement Delafargue2020-06-191-0/+10
|
* Use JSON import for environment variablesClement Delafargue2020-06-191-1/+1
| | | | | | | | The env can be provided as a JSON list `[{"name": "PORT", "value": "8080"}]`. The `dict2items` filter provided by ansible is _almost_ what we want, but it keeps the value original types (a boolean is kept as a boolean in the JSON value). Since environment variables are strings and `clever-tools` does not want to make the implicit coercion for us, we need to do it ourselves.
* deploy: remove custom polling script now that the CLI does it for usPaul Bonaud2020-06-173-57/+54
| | | | | See recent changes (https://github.com/CleverCloud/clever-tools/pull/415) introduced in 2.5.0+ version of the clever cli tools
* fix: addon environment variables fetch for clever >= 1.5.0Paul Bonaud2019-10-111-1/+16
| | | | | | | | | It seems the output of `clever env` has changed and now env values are surrounded by quotes with the latest 1.5.0 clever tools version. We used to add quotes ourselves because they were missing in the output. So this commit is adapting its parsing depending of the clever tools' version.
* deploy: add a timeout in the polling waiting scriptPaul Bonaud2019-08-011-2/+13
|
* deploy: revert back to git push + pollingPaul Bonaud2019-07-312-61/+33
| | | | | | | | | | | | | | | | In #19 we removed the polling script to rely on the clever cli's ability to wait on `clever deploy` command. After more than 6 months of experimentation it seems the command is still not reliable (sometimes the command never returns, sometimes it returns even when the deployment has finished..). Thus we are reverting back to our manual process of polling `clever activity` every 5 seconds. The timeout for this polling is set at the Ansible level (not in the bash script) and set for 40 minutes. This should give enough time for any of our applications to deploy.
* use bash with -o pipefailGaëtan Duchaussois2019-06-111-0/+1
|
* fix(deploy): fail the task correctly when last deploymt failedPaul Bonaud2019-05-131-3/+5
|
* fix(lint): ansible 4.1.0 compatibiliyGaëtan Duchaussois2019-03-051-0/+1
|
* login: make sure no existing apps are linked to the clever toolsPaul Bonaud2019-02-261-0/+5
|
* Revert "login: force the `.clever.json` file to be created"Paul Bonaud2019-02-261-1/+1
| | | | This reverts commit 85d1a7838d032ec7dfe858fce5dca3f5535199e4.
* login: force the `.clever.json` file to be createdPaul Bonaud2019-02-261-1/+1
| | | | | | | | In case a project already has a `.clever.json` file (for debugging purpose to communicate with dev environment for instance) this step was never done because of the `creates:`. Removing it forces the role to always create a new clever.json file.
* Missing /Gaëtan Duchaussois2019-02-221-1/+1
|
* Fix duplicate version number in urlGaëtan Duchaussois2019-02-221-1/+1
|
* linitingGaëtan Duchaussois2019-02-213-5/+15
|
* use full path for clever helper invocationGaëtan Duchaussois2019-02-211-2/+2
|
* deploy: check "up-to-date" error to succeeded if last commit is OKPaul Bonaud2019-01-161-1/+35
|
* fix: Fail module takes one argumentPaul Bonaud2019-01-141-1/+2
|
* deploy_task: Update clever CLI tools and use it instead of git pushPaul Bonaud2019-01-142-27/+33
| | | | | | | | Updating to latest version of 1.1.1 helps to have a stable `clever deploy` command. This commit relies on the output of the command instead of manually pooling the results with `clever activity` command.
* fix(deploy): properly quote variables in environment filesClement Delafargue2019-01-071-1/+1
| | | | adding exports in the env file also quotes the variable values
* tags: add clever-env tag to post-deploy tasksPaul Bonaud2019-01-061-4/+5
|
* fix: statically include sub tasks for 'tags' to workPaul Bonaud2019-01-041-8/+5
| | | | | | | | | | | In ansible the `include_tasks` loads the tasks dynamically. Thus it does not apply the tag specified at the include level to all sub tasks. In order to make sure all included tasks inherit the specified `tags:` we need to include the tasks files "statically". It is very similar to cases where we have a `when:` condition that we want to apply to all included subtasks. cf https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#applying-when-to-roles-imports-and-includes
* fix: Yet again a missing chdir for "clever" commandPaul Bonaud2018-12-061-0/+2
| | | | This is a followup of #26
* Fix: post depoy tasks were not launched. This fixes it.Paul Bonaud2018-11-301-0/+6
|
* fix(deploy): Yet again a missing chdir to execute from app rootPaul Bonaud2018-11-301-1/+3
|
* fix(deploy): Make sure to execute clever commands in app_root dirPaul Bonaud2018-11-302-0/+7
|
* feat(post_deploy): Add a post deploy task to fetch deployed envPaul Bonaud2018-11-301-0/+9
| | | | | | | | In some cases you might need to retrieve the ENV which is currently in use by your clever application recently deployed. If you specify a `clever_env_output_file` that is exactly what you will get!
* Revert "Merge pull request #19 from paulrbr-fl/update-clever-tools"Paul Bonaud2018-11-302-29/+25
| | | | | This reverts commit 695ceaa28821660e17a1cf819cffebe1b5d8c7ca, reversing changes made to 5485dbc4db3e141673457475bcda5fc88057739f.
* Revert "Merge pull request #20 from paulrbr-fl/update-clever-tools"Paul Bonaud2018-11-301-2/+1
| | | | | This reverts commit b17a839d622bdb36ddbe2e0667559c33e9b7fd8a, reversing changes made to 695ceaa28821660e17a1cf819cffebe1b5d8c7ca.
* fix: Fail module takes one argumentPaul Bonaud2018-11-211-1/+2
|
* deploy_task: Update clever CLI tools and use it instead of git pushPaul Bonaud2018-11-212-25/+29
| | | | | | | | Updating to latest version of 1.1.1 helps to have a stable `clever deploy` command. This commit relies on the output of the command instead of manually pooling the results with `clever activity` command.
* fix: 😬 really fix the usage of "clever_app_root" when waiting deployPaul Bonaud2018-11-051-1/+1
| | | | | | | Followup after the fix of #15 it was still missing another case of "git" usage. This should be the last fix about this variable 🤞.
* fix: clever_app_root is provided & exec is outside of "parent dir"Paul Bonaud2018-11-051-0/+6
| | | | | | | | | | | | Imagine such a usecase: - project is in `/project` - executing Ansible in `/ansible` with `clever_app_root: /project` will fail deploying with the git push with the following error: ``` Not a git repository (or any of the parent directories): .git" ``` This PR fixes this.
* vars: add a clever_syslog_server variable replacing syslog_serverPaul Bonaud2018-10-041-2/+2
| | | | | All variables "namespaced" with the role name is helpful to read "client" configurations
* domain: allow the domain to be specified via clever_domain variablePaul Bonaud2018-09-281-2/+2
| | | | | | | | Every other variables are prefixed with `clever_` which makes the definition of variables clearer from a "app" configuration point of view. WDYT?
* deploy: Make sure repo is unshallow copy before pushing to cleverPaul Bonaud2018-09-211-0/+16
| | | | | | | | If your build tool only uses a shallow clone of your project, Clever cloud will fail on first time git push. You need to git push a full clone of your git repo for the first time deployment to clever. This PR fixes that.
* add ansible-lint test and fix warningGaëtan Duchaussois2018-09-214-1/+11
|
* warnings: Remove warning given by Ansible 2.5Paul Bonaud2018-09-211-1/+1
| | | | | | | | ``` [DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using `result|failed` instead use `result is failed`. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ```
* Watch and wait for CleverFrédéric Menou2018-03-301-1/+13
|
* define safe default variable for clever and rename clever_app_tasks to ↵Gaëtan Duchaussois2018-02-261-2/+2
| | | | clever_app_tasks_file