ilcgmbh / gulp-nwabap-ui5uploader

Deploying a SAPUI5/OpenUI5 file structure to SAP NetWeaver ABAP using a gulp task
11 stars 6 forks source link

Files are only deleted and not uploaded #5

Closed NoelHendrikx closed 7 years ago

NoelHendrikx commented 7 years ago

I received an error while deploying:

noels-mbp:my_forms Noel$ ls gulpfile.js neo-app.json node_modules package.json webapp

noels-mbp:my_forms Noel$ ls webapp Component.js css i18n localService manifest.json utils controller favicon-32x32.png index.html localindex.html model view

noels-mbp:my_forms Noel$ gulp deploy [13:52:55] Using gulpfile ~/Sources/mycustomer/my_forms/gulpfile.js [13:52:55] Starting 'deploy'... [13:52:55] 'deploy' errored after 619 ms [13:52:55] Error in plugin 'gulp-nwabap-ui5uploader' Message: Error: got 404 response (No suitable resource found) [13:52:55] gulp-nwabap-ui5uploader Uploaded: file /Component.js deleted. [13:52:55] gulp-nwabap-ui5uploader Uploaded: file /favicon-32x32.png deleted. [13:52:55] gulp-nwabap-ui5uploader Uploaded: file /index.html deleted. [13:52:55] gulp-nwabap-ui5uploader Uploaded: file /localindex.html deleted. [13:52:55] gulp-nwabap-ui5uploader Uploaded: file /manifest.json deleted.

My gulpfile.js looks like: gulp.task('deploy', function() { return gulp.src('build/**') .pipe(ui5uploader({ root: 'build/webapp', conn: { server: 'http://ourserver.nl:8000' }, auth: { user: 'username ', pwd: 'mypassword!' }, ui5: { package: 'ZFIORI', bspcontainer: 'ZMY_FORMS', bspcontainer_text: 'My forms via gulp', transportno: 'XXX279323', calc_appindex : true }, })); });

I think there is something wrong with the structure or so? Why do I get a 404? I don't know on which file this is, I examined the response json object, but that's a huge object :)

I am using a mac with some hidden system files, like .DS_Store.

Kyrodan commented 7 years ago

Hi @NoelHendrikx,

from your gulpfile.js: return gulp.src('build/**')

Do you have really have a build folder (e.g. from another task which you execute prior deployment)? Or is it just a mistake and it should be deployed from you webapp folder: return gulp.src('webapp/**')

Edit: same for .pipe(ui5uploader({ root: 'build/webapp',

NoelHendrikx commented 7 years ago

Thanks for the help, it was indeed not the .DS_Store file but a wrong reference as you mentioned. I'll create a build (or dist) folder and uglify everything in it now and afterwards I deploy it with build/** indeed.

It works ;)

NoelHendrikx commented 7 years ago

Ok recall...

I created a very simple project including a webapp folder and a gruntfile.js with a build task (just copy everything from the webapp to the build folder).

Afterwards I execute the deploy task with the following start: gulp.task('deploy', function() { return gulp.src('build/**') .pipe(ui5uploader({ root: 'build/webapp'

This throws an error again: [15:25:44] Error in plugin 'gulp-nwabap-ui5uploader' Message: Source contains paths outside of root

image

Kyrodan commented 7 years ago

It should be return gulp.src('build/webapp/**')

Kyrodan commented 7 years ago

Oh damn no: if you copy everything from inside webapp to build (so there does not exist a folder build/webapp), then this is the right solution:

return gulp.src('build/**')
.pipe(ui5uploader({ 
root: 'build'
NoelHendrikx commented 7 years ago

fixed it (for now):

gulp.task('deploy', function() { return gulp.src('build/webapp/**') .pipe(ui5uploader({ root: 'build/webapp',

My folder is build/webapp. Let me try again after deleting the build folder and run the build task and then the deploy task.

NoelHendrikx commented 7 years ago

this is really weird... When I delete the build folder and run the 2 gulp tasks, it complains again: Error: got 404 response (No suitable resource found)

Cache?

[edit]: now it works (deployed again, think the abap stack is busy activating)

Kyrodan commented 7 years ago

Just make clear: root parameter of ui5uploader-config strips the relative path out of your deployment target path. so if you have gulp.src('build/webapp/** you should have root set to build/webapp.

NoelHendrikx commented 7 years ago

yes. thanks 👍