f500 / ansible-project_deploy Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Lesser General Public License v3.0
License: GNU Lesser General Public License v3.0
Hi,
are you open to add the accept_hostkey option to the git task?
e.g.
git: "repo={{ project_git_repo }} dest={{ project_source_path }} version={{ project_version }} accept_hostkey={{ project_git_accept_hostkey }}"
Hi there,
Has anyone found an easy way to do a rollback? My problem is that timestamps are different from server to server , so it's impossible to just change the -current- symlink.
Capistrano for example is creating the same timestamp on all servers.
Current example:
lrwxrwxrwx 1 root root 53 Feb 5 02:44 current -> /.../releases/20150205024358
lrwxrwxrwx 1 root root 53 Feb 5 02:44 current -> /.../releases/20150205024359
lrwxrwxrwx 1 root root 53 Feb 5 02:44 current -> /.../releases/20150205024358
Is anyone interested in that functionality?
Hi Guys,
It seems latest ansible (since 2.3?) has changed the requirements for the when parameters:
[WARNING]: when statements should not include jinja2 templating delimiters
such as {{ }} or {% %}. Found: {{ project_copy_previous_composer_vendors }}
Tested on 3.2.0 of f500.project_deploy
Not sure if the change for this would be backwards compatible?
Hi there,
first of all, great role. Helps me a ton.
I would like to be able to speed up my composer install by copying the vendor dir from the old release (like: http://capifony.org/cookbook/speeding-up-deploy.html).
I was not able to put the cp command in project_pre_build_commands because this will break on the first deployment when current/vendor is not available yet.
Currently I am patching the role with the following tasks:
- name: Check if vendor dir exists
stat: path={{ project_root }}/current/vendor
register: check_vendor_path
- name: Copy vendor dir if exists to speed up composer
command: /bin/cp -rp {{ project_root }}/current/vendor {{ deploy_helper.new_release_path }}
when: check_vendor_path.stat.exists
It speeds up the deployment process quite drastically.
What do you think? Worth a PR? Any other solutions.
Cheers
Hi Ramon :)
Just checking again to update with composer/npm/bower: there are modules in Ansible for composer and npm. This changes the composer/npm tasks to these very simple ones:
- name: Do composer install
composer: command=install working_dir={{ deploy.new_release_path }}
environment: project_environment
when: project_has_composer
- name: Do npm install
npm: path={{ deploy.new_release_path }} production=yes
environment: project_environment
when: project_has_npm
These modules are maintained by the complete Ansible community, so it is easier to keep up to date with new changes in composer/npm or their respective modules. The disadvantage now is you don't have the ease of use to tune the command parameters or its binary location. For feature flags you have several options, so you have to copy/paste them over into your defaults + task yaml, but e.g. it is not possible (yet) to change the binary location of composer. Unfortunately, there is no such module for bower yet.
Change the task or not?
After running the deploy role, it's possible to call the deploy
module with state=cleanup
to remove old releases. In this case it generates a new deploy.new_release_path
fact.
I would expect the deploy module to stick to the first new_release
it generates.
Just an idea, currently the cleanup part is pretty rude:
releases = os.listdir(facts['releases_path'])
releases.sort(reverse=True)
obsoletes = releases[deploy.keep_releases:]
for obsolete in obsoletes:
changes += deploy.delete_path(os.path.join(facts['releases_path'],obsolete))
If you have keep_releases
amount of failures, the next time you deploy the current
release will be removed. I have two suggestions:
obsolete
is symlinked by current
. If so: do not remove this directory and quit with a failure messagecurrent
is symlinked and then remove only the directories which are "older" than the linked directory. Possibly also remove all directories "later" than the linked dir, as these are probably failed builds.I can do a little python so eventually solution 1 is feasible to implement for me. No 2 is little more complex I need some more time to implement, if I am the one who will do the work ;)
What is the reason to automatically create a system
directory in the /shared
folder? It isn't used in the role anymore, is it a left-over of a development version?
For example, if I want to do a service reload and need 'sudo: yes' for that task, it doesn't get passed properly.
Hi,
I don't know, how this can happen, but even though I can find the role on ansible galaxy (it shows up in the list), when I try to proceed to the role page, I'm getting "page not found".
Ansible geeft veel van de volgende warnings:
[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ X }}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.