Unable to send bundle from aws app deployed using aws copilot via github actions - amazon-web-services

I have deployed my application using copilot deploy which works. It creates a load balancer and when I go to the designated url I can view my react app. However, I'm trying to create a CI workflow using github actions.
My github actions appear to work, they appear to deploy the app. But when I go to the new designated url, I get Uncaught SyntaxError: Unexpected token '<'
If I go to that same url and hit a specific route on it, that actually does work. So I can do url/test and it return "hello world" but it won't return the bundle for the application or it's returning a broken version of it for some reason.
I can't figure out why using copilot deploy normally works, but this doesn't
For context, my app is set up like this. In the root folder there is a Server folder that has the node server file with the routes. In the root folder is also a src folder with the react code. There is a public file. There is the docker file containing instructions. And then there is the build file. So far I've been generating the build ahead of time and then deploying everything. The node server then sends the build.
So presumably, something about the way the docker container is being built via github actions is significantly different than the way it is building using copilot deploy. But, my understanding is that in both cases it is following the same docker file. So I can't figure out what is different about the directory structure it is creating, or maybe its having trouble creating the bundle at all. If anyone has any insight it would be appreciated.
Thanks!

Related

Failed to register a ServiceWorker. The script resource is behind a redirect, which is disallowed

I wanna make a flutter web app and deploy it to AWS.
After researching it looks like using AWS Amplify is the easiest way so I try it, however after I successfully deploy it, it only shows a white screen with this showing on the log after I inspect:
However the web app show up just fine on my GitHub page and Codemagic, you can see it on rezyfr.github.io and fl-blog.codemagic.app. And here is my amplify yaml file:
Is anyone ever experience this and found the solution? Or anyone have a better way to deploy flutter web on AWS?

Deploy Vue JS Django app with Elastic Beanstalk

I've got an app I've built locally and I'm ready to deploy it but using Vue as a frontend and Django as the backend is something new to me. My current folder structure looks like:
-Backend
-Frontend
-Env
The backend folder is a traditional Django project with sqlite as a DB and frontend is your normal looking Vue project while env is the virtual environment
I don't even know how to go about this or what questions to ask but I've come to see that people deploy SPAs with AWS Elastic Beanstalk.
What is the most straightforward way to deploy an app like this?
The best way we often use
If you are accessing your Django project using ajax call
1.Create the build of your project
Once your build is created you need to host this build to some URL using s3 or any other preferred static hosting.
Now you need to deploy your Django project using EB, once you deploy your project you will get an autogenerated URL
In your frontend project, you need to set an environment variable in your configuration so that whenever you build a project all you ajax call will be redirected to the elastic beanstalk auto-generated URL and whenever you are working locally all your call will be redirected to the localhost URL
Below coded is not the exact just a rough idea of what exactly your baseurl should look like
env.APILINK=env.build? 'beanstalkurl':'localhost'
Make sure you add a base URL to you axios or any other ajax call,
once you set your baseurl based on the environment you are working, all the ajax call will be redirected accordingly
For the dev environment
http://localhost/api/getsomedata
For the prod environment which is actually a build
http://beanstalkurl/api/getsomedata

Is possible deploy c++ web server on OpenShift3?

I am trying to deploy a c++ Http web server on OepnShift3 then I referred this.
The problem is:
Shall I put the source code on OpenShift or compile it first then put the executable file on OpenShift?
Is possible to access the OpenShift3 server via Xshell or Ftp?
Any way to get the OepnShift2 account?
It is no longer possible to get accounts on OpenShift 2.
For OpenShift 3, if you wanted to use a custom HTTP server you would need to be able to build a Docker image which includes it and any other files you need. If you can get the Docker image built, then you can deploy it to OpenShift 3.
Although you can get an interactive terminal in the container which runs your application, it doesn't work like traditional web hosting. That is, it isn't a shell access account where you would upload files using FTP or some other means.
Can you explain more about what it is you want to host? Depending on what you are doing there may be builder images already supported by OpenShift which can pull down files from a Git repository and build an image for you.
If OpenShift is new to you, I would suggest you try out:
https://learn.openshift.com
so you understand some of what it can do and how you interact with it.
Also grab down the free eBook and read it:
https://www.openshift.com/promotions/for-developers.html

Azure Deployment not picking up SSL certificates in repo

I'm currently running a Django app on the Azure server. I have a MySQL database to access using SSL. The SSL certificates I need to access the server are physically in the repo and I got my Django settings file to point to these using a relative path.
I have Azure set up to do continuous deployment from BitBucket. Problem is, at the end of the deployment, it will copy over all the files EXCEPT for the .pem files that I need.
I have to manually copy over the certificates everytime I push a commit. The files are in static/certs/*.pem
Is there something wrong with Azure? Or BitBucket? Or is there a better way of doing this?
I figured it out. Anything put manually inside the static folder gets cleaned out by Azure during deployment.
Just don't put anything inside the static folder

Deploy Rails spree to Beanstalk

I have deployed rails spree app to AWS Beanstalk successfully. Then I added some new products together with their images. The app by default saves the images in my_app/public/spree/products folder. Every thing went fine until I deployed new code. The new code is deployed successfully but the "products" folder is gone. I now have to re-upload all of my images manually. Anyone has any idea what is going here?
Please let me know if you need any further info.
Thanks!!
Application will contain a public folder and under of this, we have spree products/taxons images folder...Those files are static by nature, so it’s a good idea to serve them using S3 because for every deployment our code replace.
Elastic beanstalk servers are somehow out of your control, meaning AWS controls when they are restarted and even terminated and rebuilt. Therefore, you shouldn't store anything on local disks (which is what Spree does by default).
The solution to your problem is simply to store them on S3 as described here.