I recently moved my code repo from a One drive folder to my C: drive, trying to escape sync issues wiping files (thats another issue). Before doing so both my dev and prod compose files worked as expected (under source control).
Moving the files across (cloning from the repo and checking out to the branch) I ran my dev compose file which worked again as expected however my prod started complaining about "no such file or directory", "not found". I decided to snapshot the filesystem and check and could see the files and could cat the contents. So why is docker complaining?
My compose file does not use any hardcoded file paths, all relative and its evident the files are being copied across.
Compose errors:
exec docker/deployment/folder/scripts/run.sh: no such file or directory
Snapshot:
/app$ cat docker/deployment/folder/scripts/run.sh
#!/bin/sh
As previously mentioned this worked running from a diffirent local dir location. I can't imaging how that would make any diffirence.
Thanks in advance for any support.
Found the issue, vs code had updated the end-of-line sequence to crlf instead of lf.
Related
I cloned a laravel-8 sail project via gitlab but everywhere in every folder which containing files there is a file which ends in .Identifier
I don't know where they come from. There may be 1000 files like this in the project.
My question is:
How can I get rid of those files which endr with .Identifier?
Is there some kind of Ubuntu or docker command that searches the entire project for such file which ends in .Identifier and then deletes them?
Maybe phpStorm has such a function?
If you are on Linux machine, then open terminal in you project folder and run rm *.Identifier. And if you are on Windows machine then open command prompt in your project folder and run del *.Identifier. This will do the trick for you.
I have directory csv in context directory of docker build. I want to copy it into docker image in all circumstances (for empty directory in host an empty directory inside image is created, for nonempty directory in host it is copied with all content).
The COPY csv/* /csv/ gives COPY failed: no source files were specified error when the directory is empty.
Similar questions I found on SO are differing from my case in either setup or intention (multistage build, copying existing jar, certainly existing file) so I choose Q&A-style here rather than messing question with unrelated answer. This Github issue is also related.
The solution is to use
COPY csv/. /csv/
This question gave me a hint (although the behavior desired by me is unwanted for its OP).
I recently had a low disc space issue in jenkins. Although the home directory has sufficient space, the /tmp did not and it brought my master down.
I tried many ways to fix this
Discard old build and deleting old workspaces
Restarting jenkins
Tried to setup a node with same config and starting it, but that failed saying i dont have sufficient permission for copying remote.jar
Since my server is debian, I could not find any file where I could set set -Djava.io.tmpdir
Many people talked about jenkin file or config file, but I could not find it.
The only thing that worked was https://updates.jenkins-ci.org/download/plugins/tmpcleaner/ , this plugin hpi, which I installed through Advanced tag in plugins.
Also, I went manually to the /tmp folder in root and then deleted it contents to start the jenkins again. So my question is:
How do i change the /tmp folder in jenkins?
The jenkins home directory is /mnt/data/jenkins, however the tmp it uses it root/tmp. Why is it so? The /mnt/data/jenkins has lots of free space and i manually created a /tmp folder there, but it only takes the /tmp from the root
My colleague found the answer out
open '/etc/defaults/jenkins' file using command 'less /etc/defaults/jenkins'
Add argument
JAVA_ARGS="$JAVA_ARGS -Djava.io.tmpdir=yourNewtempLocation"
Once you restart jenkins, you will be able to see the storage of the new space
I have just created a .env file to separate my environment variables from my main docker-compose file. I can run this document on my local machine fine with no errors or issues but when I try run it through my CD pipeline I get the following error.
[error]Top level object in 'C:\BuildAgent_work\r38\a\"Myproject Name"\drop\ .env' needs to be an object not 'class 'str'.
I first thought this was because I had set up my build/CI process wrong but I have played around with it and have had no luck.
I have also done some research online to find others with the same problem but none relate to DevOps in anyway so it has been unhelpful
I am not sure how to reproduce this problem but if anyone knows I can try provide some of my code if needed
Edit:
Here is a snippet of my .env file. Check comment below for my thoughts
ContainerInfrastructure_Version=6.7.93-beta.1
ContainerInfrastructureCore_Version=6.7.41-beta.1
AuthenticationWebService_Version=6.7.52-beta.1
CRM_Version=6.7.52-beta.1
Expected result:
Deploys successfully
What I'm getting during the docker-compose task:
[error]Top level object in 'C:\BuildAgent_work\r38\a\Goldpine.ReleaseManagement\drop.env' needs to be an object not 'class 'str'.
Ok so I figured it out. I'm not sure how to explain this briefly but I'll do my best.
So the problem was within DevOps itself not my code. It turns out a .env file only works/gets picked up if you run the docker-compose command from within the working directory that the docker-compose.yml file exists.
When it went into DevOps it was not running the command from within the downloaded artefact directory but by creating a path to it using the -f command.
So long story short, If you use a .env file you need to set the working directory within the CD pipeline to your artefact folder for it to be able to see the .env file correctlly.
I hope this is clear enough if not just let me know and I'll try change it accordingly :)
I have a project which for its tests runs:
./node_modules/.bin/mocha tests/**/*.coffee -r coffee-script/register -c
tests/ looks like this:
_helper.coffee
database-tests.coffee
routers/
index-router-tests.coffee
team-router-tests.coffee
On my windows dev machine it works fine running _helper.coffee first and then the rest of the files.
On my CI server running debian it only tries to run routers/* missing out anything in the root folder.
I am assuming that tests/**/*.coffee isnt right for unix?
Moving Comments to an Answer for others since it appears to have fixed your problem.
I have had the same problems on Windows where it is not returning the files in the same order that you see them listed on the drive. I have therefore used tests/*.coffee and then tests/**/*.coffee.
I found that Windows will retrieve the files in the order they were likely written to the hard drive, while a directory or other list will have them sorted for display. This seemed to be the problem I was encountering.
The parent directory ('tests') does not seem to be included when using tests/** which seams to mean directories under the tests folder, and does not include the tests folder itself.