Firebase Hosting deploy with Google Cloud Build throwing "No such file or directory" error - reactjs

I built a simple ReactJs app and tried using Google Cloud Build to deploy it as soon as I push a new commit to the master branch on Github.
For that I added an "On push to master" trigger and followed every step from here to configure my Google Cloud and Local Project. In the end I created a cloudbuild.yaml file with the following content:
After a new commit and push the cloud build logs a correct npm install and npm run build, but the firebase stops at the following step.
I didn't understand which file/directory is missing, nor how to fix it. Could anyone help me a little?
Thanks in advance.

So after a whole day of work I found out the problem. Apparently when you generate the firebase image mentioned in the tutorial all its files need to use End of line LF, but in windows it sets all of them to CRLF. I solved the problem using the WSL terminal in windows.

Related

Intellij Keeps Telling Me "App Engine SDK path is not correct.'

Trying to deploy my first Google Cloud Java app using Intellij. I've followed and read so many threads and have gotten absolutely nowhere on what is seemingly one of the simplest steps of getting this set up. I have installed gcloud CLI and followed the instructions here. After installing, I run the commands 'gcloud components update' and 'gcloud components install app-engine-java'. I see the folder located in both 'C:\Users<username>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine' and 'C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine'. I installed as multi user after hours of trying to get the single user install working, so now I have both. When in Intellij I am creating a new Google App Engine project under Java EE, it asks to specify a Google app engine SDK. There are no options so I choose to select the path. I have tried both above paths and it only tells me 'App Engine SDK path is not correct'. What am I doing wrong?? The steps seem ridiculously simple and it just doesn't work.
You stopped at the general google app engine folder
You need to specify the full path to the java-sdk folder, see the image in this question.

Github-Pages deployement issue

I have worked on an organization whose entire account was deleted by mistake but was later restored. Now I am trying to deploy a project in this org with gh-pages. Everything works or seems fine like to commits and all, unless I try to deploy the project. When I run the command npm run deploy the feedback I get is "published". But when I go to github and look for the website it says Error 404.
I have looked into the deployment log and found
this
I have tried every possible way to deploy a project using gh-pages and I have followed its procedure carefully. I found nothing useful which can solve this issue.
Thankyou in advance.

Google Cloud Platform: Updating a project after deployment

I am using Google Cloud to deploy my application. I have followed the steps in the documentation for deploying. I deployed early on in my project and it was successful. I then decided to change some files and update some features in my app. For this i followed the documentation for updating a deployment. This update was successful. It had me create the deployment in my Deployment Manager and run the gcloud commands to commence update. When I redeployed with gcloud app deploy, it was successful.
I have since added a couple more lines of code and features in my application. I followed the same documentation for updating a deployment as I had the first time I made an update and it is no longer working for me.
Does anybody have any idea what would be the problem? Again, I was able to successfully deploy, and even update that deployment once by following Google Cloud docs. Now I am having no luck.
Have you been changing the version number? Go to:
https://console.cloud.google.com/appengine/versions?project=< your project name >&serviceId=default
And make sure the version you want is active. Also, you can try:
http://<VERSION>-dot-<SERVICE>-dot-<PROJECT_ID>.<REGION_ID>.r.appspot.com
Example:
https://20200813-dot-myapp.uc.r.appspot.com
if the version number was 20200813 and your appname is myapp and the region is uc

Unable to resolve "./aws-exports" from "App.js"

I have been building an app with awsamplify for quite some time now. Today I descided to run some test and when I did
npm run start-web
Everythin worked fine. Now I went on to run mobile test with the use of Expo and ran
npm run ios & npm run android
which both returned the following errors.
Unable to resolve "./aws-exports" from "App.js"
Building JavaScript bundle: error
my problem is similar to the one below just its amplify and not awsmobile
https://github.com/aws-amplify/amplify-js/issues/669
Deos anyone know what I can do to resolve this?
Thanks alot!
I jsut removed some unused imports and the error changed to this
Unable to resolve "#aws-amplify/ui/dist/style.css" from "node_modules\aws-amplify-react\dist\Amplify-UI\Amplify-UI-Components-React.js"
Barely mentioned in the AWS docs:
For setting up a local dev folder, from an existing amplify repo, use an amplify env pull,
It will "pull" the ./aws-exports.js from the server, the latest one that was pushed there,
similar to git push and git pull but for the amplify env
It's true that an amplify push will create the ./aws-exports.js file,
but it will also "push" it to the server, overwriting whatever is there.
amplify status is also a handy command, similar to git status
I ran amplify env pull
and then found it in the ./src/aws-exports.js
not sure if the pull did it, or if it was always there but this is for an existing expo project
Confing your projects, using terminal go to the main folder and amplify init to config your project
amplify init
Do you to use an existing environment? (Y/n) Y
Choose the environment you would like to use: dev
Choose your default editor: Visual Studio Code
Choose the type of app you're building: javascript
What javascript framework you're using: ionic
Source Directory Path: src
Distribution Directory Path: www
Build Command: npm run-script build
Do you want to use an AWS profile? Y
Please choose the profile you want to use: select your personal IAM profile

GoogleAppEngine wordpress complains (Could not create directory) on update and plugin install

I have a problem updating wordpress or installing wordpress plugin in my local version of google app engine. I get the following message.
Downloading install package from
https://downloads.wordpress.org/plugin/event-espresso-decaf.4.8.38.decaf.zip…
Unpacking the package…
Could not create directory.
With the same code base I am able install plugin using MAMP (Macintosh, Apache, MySQL, and PHP). However fails with google Pyton script (dev_appserver.py).
I tried changing the permission of the file system by giving privilege to all user for write. Tried executing as sudo dev_appserver.py .. Followed the advice in other post, No luck.
Whats the problem here?, With MAMP all looks good in my local, but the same code break as I deploy to GAE (​appcfg.py -A APP-ID update app.yaml). Whats the problem here
Cannot write to file on Google App Engine Dev server with PHP?
Staring SDK 1.9.18, dev_appserver disables local file writing by default to better simulate the production environment. You can enable file writing by adding "google_app_engine.disable_readonly_filesystem=1" to your php.ini file.
I also wrote a blog post about running WordPress on App Engine flexible environment at:
https://wp.gaeflex.ninja/2016/03/25/using-wordpress-multisite/
Please give it a try too.

Resources