How to run OwinHost from non-bin folder? - asp.net

OwinHost.exe seems to only want to run against an application that lives in a folder called "bin". If I try against another folder e.g. "bin2", OwinHost says that it can't find the startup attribute.
I've tried running from within the bin2 folder, outside it, and tried the -d and -b arguments - nothing seems to work.

Related

Dockerfile COPY ${source:-obj/Docker/publish} not finding the correct source after upgrade to 3.1

I am using Jenkins to build and deploy a .Net Core microservice application. For each microservice, I am building a docker container. My dockerfile has the following in it:
ARG source
COPY ${source:-obj/Docker/publish} .
Prior to upgrading from .Net Core 2.2 to 3.1, this worked. After the upgrade, when I try to deploy, I am getting the following error:
COPY failed: stat /var/lib/docker/tmp/docker-builder609391151/obj/Docker/publish: no such file or directory
script returned exit code 1
From what I've read, it looks like .Net Core 2.2 compiled into the /obj/Docker/publish directory, but .Net Core 3.1 compiles into the /bin/Release/netcoreapp3.1 directory, however the source is still pointing to /obj/Docker/publish. I'm trying to figure out where the source arguement is defined, and how I should change this.
Update:
I decided to leave the source out entirely and hard-code the build path. I changed the copy line to
COPY /var/lib/jenkins/jobs/fusion-core/branches/master/workspace/src/CustomerAPI/obj/Release/netcoreapp3.1 .
I'm still getting an error when I try to build the docker container that says
COPY failed: stat /var/lib/docker/tmp/docker-builder356954794/var/lib/jenkins/jobs/fusion-core/branches/master/workspace/src/CustomerAPI/obj/Release/netcoreapp3.1: no such file or directory
script returned exit code 1
I'm not sure where the "/var/lib/docker/tmp/docker-builder356954794" is coming from, or why it is appending it to the front of my path, but it doesn't exist.
Still not sure how to get around this.
Some debugging suggestions in no certain order.
Default Value
${source:-obj/Docker/publish} is bash syntax that evaluates to the value of the variable source if it was defined, or obj/Docker/publish if it was not.
I'm trying to figure out where the source argument is defined, and how I should change this.
If you can't find anything that defines it to another value, it just means that the default value obj/Docker/publish was being used.
Publish directory
3.1 still uses the publish directory, but it will be at bin/Release/netcoreapp3.1/publish. Use a RUN find -type d -iname publish to find the publish directories in your container.
Dont use the full path, it will change every build. See the tmp/docker-builder356954794 in the path?
The COPY command uses relative files, based on the path in your machine (outside the docker container). So use a path that's relative to where the context directory (or Dockerfile) is. If the dockerfile is at /var/lib/jenkins/jobs/fusion-core/branches/master/workspace/src/CustomerAPI/Dockerfile and the publish directory on your machine is at /var/lib/jenkins/jobs/fusion-core/branches/master/workspace/src/CustomerAPI/bin/Release/netcoreapp3.1/publish, then use a COPY command like this:
COPY bin/Release/netcoreapp3.1/publish .
Funny paths
I'm not sure where the "/var/lib/docker/tmp/docker-builder356954794" is coming from
Containers need to share files from one directory (in your host) to another (in your container). Depending on the container technology, it uses one or more file systems or file directories.
One of those is /var/lib/docker/tmp/...

PhpStorm doesn't get the folder's configuration when running a single test method

I have a Laravel project with three test directories - Browser, Feature, and Unit.
In Run/Debug configurations I've configured the Feature and the Unit directories to use phpunit.xml while the Browser directory uses phpunit.e2e.xml. I've also created a default configuration for all tests which uses the phpunit.xml.
If I open a class that is in the Feature/Unit directories and run a single test method or the whole class, it picks the default configuration, but when I run a single test method in the Browser directory, it uses phpunit.xml instead of phpunit.e2e.xml.
If I select a directory and run tests, it picks the proper configuration, but when I open a class in the Browser directory, it doesn't
Why doesn't PhpStorm use the configuration of the Browser directory recursively? How can I handle this problem?
As far as I know PhpStorm has never had this functionality and I wouldn't count on them adding it either. It seems way too specific.
What you can do though, is specify the configuration file you want to use through the commandline.
See: https://phpunit.de/manual/6.5/en/textui.html#textui.clioptions
So your command would look something like this:
phpunit tests\Unit\SomeTest.php --configuration phpunit.xml
or
phpunit tests\Browser\SomeTest.php --configuration phpunit.e2e.xml

Laravel Homestead setup but does not sync hidden files

Hi I've setup Homestead correctly but when I ssh into my Vagrant instance I can see all my files just not the hidden ones (.env, .git, .gitignore are missing). I'm trying to run webpack-dev-server within my instance and it needs my .env file to run. Is it normal that hidden files are not synced?
My .yaml file:
Hidden files don't show when using the ls command (which I guess is what u're doing). They are still there, however. You can try something like nano .env and you'll see that you can edit your env from the console :)
Another command you could use is ls -a, which should show all files regardless of whether they're hidden or not.

Premake5 prebuildcommands Directory

I'm converting a premake4 config to premake5. My prebuildcommands are failing because the commands are executed from the root working directory, not the directory that the premake5.lua is in that contains the 'prebuildcommands'. premake4 executed them in the subdirectory containing the prebuildcommands call.
Is this the new intended behavior? If so, it's not documented anywhere that I can find. I don't mind correcting the paths as long as it's not an bug.
This looks like the correct behavior to me. Premake doesn't attempt to parse the commands to identify paths, so they are left intact as entered. The command itself is executed by the build tool (Visual Studio, GMake, etc.) and so will operate in whatever directory the tool makes current at that time.
If I'm reading it right, you would like the command to execute in the project directory, so what about:
prebuildcommands {
"%{prj.location}/styx/utils/ndate > %{prj.location}/include/kerndate.h"
}
For Visual Studio, Premake will convert those tokens to $(ProjectDir) so they will stay relative to the generated project file.

Openshift JBoss Logging

Hi I am deploying my spring application to Openshift Jboss AS. The problem is whereever i placed the log4j.properties it is not read by the application. I've tried the following ways to achieve this but can't.
Placed my log4j.properties in WEB-INF/classes.
Placed my log4j.properties in WEB-ING/resources and in web.xml loaded the
context-param for log4jConfigLocation.
Created a
jboss-deployment-structure.xml in META-INF which excludes log4j
logging.
Nothing seems to work . Can some one please help me.
In Jboss there is a default logging available, which can be implemented by modifying standaole.xml.
In Openshift when you ssh into your app using the below command
rhc ssh <app-name>
You will taken into your application where when you give ls command you will see the list of files and folders, you can find jbossas folder change your working directory to that folder
cd jbossas
execute ls command you will see list of folders where you will find standalone folder, change your working directory to this folder
cd standalone
again execute ls command you can see configuration folder, change your working directory to this
cd configuration
now if you execute ls command you can see standalone.xml, we need to edit this file, but editing here may not work because this standalone.xml is a copy of the another file which is in the following folder .openshift/config/standalone.xml . You can find this folder where you clone your git copy, Not in eclipse go to your working directory in window.
We need to edit this file and add our logging properties here. thats how it works

Resources