Services in Redmine-Plugin - redmine

i've made a plugin for redmine, with 2 services.
But, on my remote-machine, the services seems not to be loaded.
Do services in redmine-plugins work in general?
Do i have to set any autoload-paths?
Is there a version-difference, in Redmine?
On my local Macbook, within redmine-4.0.4 all works fine (env: production and development). But on my Debian, there is redmine-3.4.2 i receipt this error
NameError (uninitialized constant TimesController::SearchTimes):
plugins/billing/app/controllers/times_controller.rb:41:in `select'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Services are just Ruby objects so they surely work in Redmine plugins.
Redmine autoloads only controllers, helpers and models paths under the plugin's /app directory. Plugin starting point /init.rb should manually require other files which usually resides in /lib folder.
Redmine 3.x and 4.x versions are very different, but much of these changes are caused by Rails itself.

Related

Setup Django-SHOP on Divio

Tell me, is it possible to install django-shop on Divio servers?
How can I do that?
I can’t imagine how this can be done, because the structure of files in divio is different from the structure of ordinary django projects
There's nothing special at all about the structure of Django projects (or any other projects) in Divio applications.
If using the default Aldryn Django project type, then it starts with a particular project layout, but you are free to use this or not. Projects run in Docker and at the Python/Django level can be configured as you please.
See How to install Python dependencies in a project, and additional information on managing settings with Aldryn Django.

where are dependencies installed in the production server?

I am using Grails 2.2 and the plugins are really old. For some reason the dependencies are not resolving. I think it used to work because the plugins and files were in my local cache. From the documentation grails stores the dependencies locally in home/.grails/ivy-cache
With all these declarative dependencies, you may wonder where all the
JARs end up. They have to go somewhere after all. By default Grails
puts them into a directory, called the dependency cache, that resides
on your local file system at user.home/.grails/ivy-cache. You can
change this either via the settings.groovy file:
So the only option i can think of is to go to my remote server and find this directory to copy the dependencies to my local system. So where is this ivy-cache directory in production server? I dont seem to find it. Thanks for any help.
The same issue also I was working in the last week, from 15th January maven had decommissioned the http protocol where the URL "http://repo1.maven.org/maven2/" has changed to"https://repo1.maven.org/maven2/". Also need to check the grails maven to secured.
In BuilConfig.groovy, you can add the dependencies and the changed maven repo else in the _Events.groovy need to change the repo address to secure protocol.
If still you have protocol issue because of JDK8 try this -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2 in the path or bat file.

WebPack on VSTS Hosted Build

We're using the hosted build agent on VSTS to build and release our ASP.NET Core code to Azure App service.
My question is: can we run WebPack to handle front-end tasks on this hosted build on VSTS or do we have to do it manually before checking the code into our repository?
Update:
I'm utilizing the new ASP.NET Core Build (Preview) template that's available on VSTS -- see below:
Here are the steps -- out of the box:
For VSTS we're working on an extension, currently it's in beta phase, you can ask for a share.
Check the VSTS marketplace.
Check this github repo.
Webpack is definitively not a first class citizen for VS2015 and VSTS. Streamlining webpack for CI/CD has been a real headache in my case, especially as webpack was introduced hastily to solve dreadful performance issues with a large monolithic SPA (ASP.NET 4.6, Kendo, 15,000 files, 2000 folders). To cut short, after trying many scenarios to make sure that freshly rebuilt bundles would end up in IIS and Azure webapp, I did a 2-pass build. The sequence of VSTS tasks is as follows: npm install global, npm install local, npm webpack install local, npm webpack install global, build pass 1, webpack, build pass 2, etc... This works with hosted and private agents, providing you supply the proper path for webpack as webpack is installed in a different location in host and in private (did not find a way to chose the webpack install location for consistency). I scorch everything before starting the build. Also need to do these in VS2015 solution : (1) unload "built" folder, and (2) Add Content Include="Built\StarStar" in project file. The "built" folder contains the bundles and should appear greyed, otherwise more bad surprises and instabilities to deal with...
Build-Pass #2 task in VSTS BUILD allows to collect the fresh bundles generated by Build-Pass #1 and includes them automatically in the package to be published.
Without a second build-pass, collecting the bundles and merging them in the zip package is a nightmare, especially when you have 15,000 files to unzip then rezip (300 ms per file!!). Did not find file-merging capability that I could readily use in VSTS.
I have my hears to the ground listening for someone coming up with a more efficient CI/CD scheme for webpack. In the meanwhile, my 2-pass-build workaround is working flawlessly, but slow indeed.
I anticipate that the advances with ASP.NET core, Angular 2 and webpack will look into solving this elegantly.

Why does redmine not use the development and test environments?

Why does redmine not use the development and test environments?
In the official installation guide they only show one environment when setting up the databases, advise to run bundler skipping dev and test, and run the rails server in production mode.
I think this instruction describes the installation process only for server (which runs in Production mode). I think it is done this way not to confuse new users (who do not have a lot of knowledge in Rails)
You can easily use this instruction to setup Redmine locally (I did it successfully several times ;). In order to install Redmine locally you should change only few points in the instruction.

OS X Django dev environment: linking to virtualenv django and apps media

I am developing a Django app on Mac OS 10.8. The production server is an Ubuntu server. On the production server, I created symlinks to the directory below:
(On Ubuntu)
/var/virtualenvs/some_virtualenv/lib/python2.6/site-packages/django/contrib/admin/media
But those symlinks obviously don't work in my local OS X dev environment:
(On OS X)
/Users/username/Webdev/.virtualenvs/some_virtualenv/lib/python2.7/site-packages/django/contrib/admin/media
The symlink apparently made it into the git repo. Django deployment really is a bit of a pain! Can someone tell me how to deal with deployment in two different environments?
UPDATE: Is it simply a matter of making sure the symlinks are excluded from the git?
Django deployment really isn't too hard, but there are a couple of patterns that are useful. The first, is to split out your production and development settings. There are a number of different ways to do this, most of which are described in the django documentation.
Also, if you're using Django >= 1.4, you don't need to symlink to admin media anymore since it has been converted to using staticfiles.
I use this template when creating any new django 1.4 projects, which includes generating your production and local settings.
Symlinks shouldn't be included in your git repo IMO. There are better ways of managing how to access your media.