Running this on Windows Server 2008 R2
Getting error when trying to compile SASS from a Bamboo task. All my other tasks in my Gruntfile work fine, it's just the SASS that is giving this error:
Warning: Unable to write "dist/css/style.min.css" file (Error code: EPERM). Use --force to continue
Bamboo is running as Administrator and all the related pieces were all installed as this user as well.
Here is what I have in my Gruntfile
sass: {
dist: {
options: {
style: 'compressed'
},
files: [{
expand: true,
cwd: 'css',
src: ['**/style.scss'],
dest: 'dist/css/',
ext: '.min.css'
}]
}
}
If I delete my dist/css directory from Windows explorer and run from the command line, it works, but no amount of messing around like that get's it to work from within Bamboo. I'm working around this now by just having my local compiled css in my repository, but really want this as part of our build process.
If anyone could suggest some things to try, I would appreciate it. I'm out of ideas.
So it turns out it was a PATH issue. When we installed Ruby (for SASS) it wrote to the local user PATH. This is fine, except that Bamboo didn't see this change until we rebooted the server. This however created another issue for us. Now that there was something in the local user PATH, Bamboo stopped using the system PATH and started using the local users PATH and everything else stopped working! To fix this we just added to path to Ruby to the system PATH and all was good in the world again.
Related
I am unable to run e2e tests with protractor 7 with the following configuration
...
directConnect: true,
capabilities: {
browserName: 'firefox'
}
...
on my MacOS Catalina. I noticed the
webdriver-manager update
command from the project's package.json downloads the geckodriver-v0.29.1.
As mentioned in the title the logs do not go beyond Using FirefoxDriver directly... when I run the tests. How can I check logs in more details (is there a verbose option in protractor?), and how can I fix the issue ?
With Splaktars answer I was able to get Firefox to launch using the typical directConnect: true setting.
I had to download the geckodriver-v0.29.1-macos.tar.gz package from the Github Releases and extract the binary. Then I replaced the geckodriver-v0.29.1 binary previously downloaded through webdriver-manager with that copy from the package.
After that I launched my tests to make sure everything was still partially working and finally saw the MacOS security popup. I ran the command to remove the quarantine flag:
xattr -r -d com.apple.quarantine /path/to/geckodriver-v0.29.1
Relaunched the tests and finally Firefox popped up...
Thanks again to Splaktar, just made an account so I can't comment or upvote for help
It looks like there is a known issue in the v0.29.1 release notes:
https://github.com/mozilla/geckodriver/releases/tag/v0.29.1
Those point to some GeckoDriver macOS Notarization docs:
https://firefox-source-docs.mozilla.org/testing/geckodriver/Notarization.html
However that page say
Arbitrary software downloaded through other means, such as curl(1) is not affected by this change.
I don't get any security pop ups or warnings, just the hang that you see.
Running
xattr -r -d com.apple.quarantine /Users/splaktar/Git/app/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.29.1
Doesn't help.
In https://github.com/angular/protractor/issues/4253, there are a lot of old issues mentioned with Firefox and directConnect support. I tried using directConnect: false with a suggestion from that issue:
config.capabilities = {
'browserName': 'firefox',
'marionette': true,
'elementScrollBehavior': 1
};
config.directConnect = false;
config.seleniumAddress = 'http://localhost:4444';
config.localSeleniumStandaloneOpts = {
jvmArgs: ['-Dwebdriver.gecko.driver=node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.29.1']
};
I ran webdriver-manager start and then ran my tests, but that failed quickly with an error page's HTML in the console and From: Task: WebDriver.createSession() Process exited with error code 199.
I also tried setting
config.firefoxPath = '/usr/local/bin/firefox-bin';
after creating a symbolic link there to /Applications/Firefox.app/Contents/MacOS/firefox-bin. But that didn't help at all. Firefox never gets started. I tried with Firefox Developer Edition as well.
Still investigating...
I have a Laravel project and as you know when you deploy your app everything in your public directory should be copied over to your htdocs or public_html directory to hide your application's code.
I am using webpack to build my react code and everything else and each time I change my javascript webpack does what I want, it sees I make a change and then it builds it.
However I want to add one additional command after it builds and that is to copy everything from the public directory into the correct directory in htdocs/public_html.
So far I read up on this question here Run command after webpack build
It works and I can get the echo to work but I'm not sure why cp isn't working. Echo works but how do I know what shell commands I can use?
I tried 'cp' and even 'copy-item' which is powershell, but none are working.
This is my plugin so far, I figured I needed to change the directory to be safe
before copying anything over but again, nothing is working.
mix.webpackConfig(webpack => {
return {
plugins: [
new WebpackShellPlugin({
onBuildStart: ['echo "Starting Build ..."'],
onBuildEnd: ["cd 'E:\\xammp\\apps\\FactorioCalculator'",
"cp '.\\public\\*' '..\\..\\htdocs\\FactorioCalculator\\' -f -r"]
})
]
};
});
You could always use the copyDirectory mix method. Just put something like the following at the bottom of your webpack.mix.js file:
mix.copyDirectory('public', '../../htdocs/FactorioCalculator/')
You might have to change your path to ..\\..\\htdocs\\FactorioCalculator\\ as per the path in your question (I only have my mac with me so I'm unable to test on my other machine).
To answer you original question, if you want to execute a command each time webpack finishes building you can use the mix.then() which takes a closure.
The Setup:
Using scss-lint plugin for IntelliJ-based IDEs (PHPStorm)
http://plugins.jetbrains.com/plugin/7530?pr=phpStorm
A gulp-compass task, part of a larger Gulp build process, that watches my sass (scss) dir.
https://www.npmjs.com/package/gulp-compass
NOTE:
OS: Windows 8
both tools work as expected.
The Situation:
With the scss-lint inspection active, any kind of typing activity in the editor (including simply typing a whitespace) triggers the gulp-compass task, and the terminal for said task returns 'file not found' errors along the following line:
[10:53:34] Starting 'dev-compass'...
[10:53:34] Finished 'dev-compass' after 3.58 ms
[10:53:36] File not found: E:/projects/xf/src/sass/blog_scsslint_tmp8349313806557714816.scss
[10:53:36]
[10:53:36] { [Error: Compass failed]
message: 'Compass failed',
showStack: false,
showProperties: true,
plugin: 'gulp-compass',
__safety: { toString: [Function] } }
[BS] 1 file changed (blog.css)
[10:53:46] Starting 'dev-compass'...
[10:53:46] Finished 'dev-compass' after 15 ms
write src/styles.group/blog.css
[BS] 1 file changed (blog.css)
Note: this 'error' doesn't prevent the task to perform; when I make actual changes to the .scss source files, the .css are generated properly.
Apparently, either SCSS Lint itself and/or the PHPStorm plugin generate temporary files when the inspection occurs, and promptly removes them -- presumably when the inspection finishes.
As it does so in the same directory that's being watched by the gulp-compass task... These two end up playing NYSMNYD (now you see me, now you don't).
I was hoping I could either:
set my SCSS Lint configuration file to force a different path for the temporary files, or,
set my gulp-compass task to ignore files based on a pattern such as *scsslint_tmp*.scss
But so far, I haven't found any way to do either of these.
I suppose it could be seen as just a 'cosmetic' error, since both tools do produce the desired outputs, but it results in unnecessary processing, and by filling my terminal with 'bogus' errors just make it more confusing to spot the genuine ones.
Any ideas?
I have a SCSS build working from Grunt that takes files in a "build" directory and outputs them to a "deploy" directory.
Is it possible to split off a single file -- the primary CSS file -- and have it output not only to the deploy directory but also on to a production server? That's the only file that will be changed now that the site is live.
I know Capistrano can do something like this, but it's probably not worth it on our end to add more technology to the workflow. So is it possible within Grunt?
Rather than modify the configuration of your css generation task which could result in a second copy being compiled, you can utilize an additional entry under grunt-copy:
styles: {
expand: true,
dot: true,
cwd: 'deploy/styles',
dest: 'other/styles',
src: 'filename.css'
}
Take care that you aren't calling the entire copy task elsewhere in your Gruntfile, and when you call this instance you'll use 'copy:styles'.
I'm trying to get assetics running with the yui compressor and, if this is running, sass. Right now, both don't work. When removing all filters from config.yml and the twig template, it works and php app/console assetic:dump does copy the css and js files.
Now I want to add the yui compressor and my config.yml looks like this:
assetic:
debug: %kernel.debug%
use_controller: false
filters:
yui_js:
jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar
Adding the filter to the template and running assetic:dump again ends in the following error (translation of message by me):
[RuntimeException]
The syntax for filename, directory name or drive name is wrong
I found an article telling me to specify the path to java.exe, so I add this to config.yml:
assetic:
..
java: C:/Program Files (x86)/Java/jre6/bin/java.exe
..
Now assetic:dump tells me:
[RuntimeException]
The COMMAND "C:/Program" is either written wrong or
I tried playing around with both variables (using \ or \ instead of /, adding single or double quotes, working with short alias Progra~1 or Progra~2) in the config, but I didn't get anywhere. The both errors comming up all the time. Maybe someone can point me in the right direction.
Ok, I figured it out. Man, this one was brutal.
Let's start with the easy stuff. A working version of the config.yml can look like this:
assetic:
debug: false
use_controller: false
java: C:\Program Files (x86)\Java\jre6\bin\java.exe
sass: C:\Program Files (x86)\Ruby192\bin\sass.bat
filters:
scss: ~
yui_js:
jar: %kernel.root_dir%\Resources\java\yuicompressor-2.4.6.jar
For some reason, assetic is always importing a whole directory for scss, so I had to make a combine.scss which imports the other scss files in the correct order.
And now it gets ugly, as one have to change the assetics core in order to get this working. The developers of assetic know this bug and I think it is fixed in some development trunk/branch but not the stable one.
The Assetic\Util\ProcessBuilder has to be changed on line 95
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
,line 103
$script .= ' '.implode(' ', array_map('escapeshellarg', $args));
and line 110
return new Process($script, $this->cwd, null, $this->stdin, $this->timeout, $options);
I hope this bug get fixed soon and till then anybody trying to get it working finds this thread... Took me like 8 hours of debuging, reading and trying different approaches.
Answer by Boo Nov 19 at 22:53 did work for me by changing everything he mentioned in Assetic\Util\ProcessBuilder (I ignored line 95 as it looks the same as in my file)
Now it works on windows. Thanks!
Just to confirm. Im using Symfony 2.0.7 and yuicompressor-2.4.7
For other users who use window server 2008 r2 :
Maybe you should change the C:\windows\Temp folder property to 777 (read/write) for the IIS user / or the machine's normal user
please unpack the ruby.7z from rubyinstaller.org , and go to C:\_ruby193\bin , in this unpack position you should exec the CMD prompt , type :
ruby -S gem install sass
so that you will get the sass.bat in that position
It's time to use Boo's best answer , and please notice that in symfony2 dev env maybe it's not necessary to change the use_controller to false (in the config.yml) , because there's another use_controller in the config_dev.yml (set to true) , and in routing_dev.yml there's also a _assetic router , they're perhaps associated.