Trigger Amplify deplyoment for a NextJS SSR app in Gitlab Pipeline - next.js

I am deploying a NextJS SSR app in Amplify.
I am also running linters and tests in a Gitlab (cloud) Pipeline.
My workflow should be this:
Push changes into a branch.
Run the Gitlab Pipeline.
Deploy the new code (if the pipeline succeeds).
What I need is a mechanism to trigger the deployment inside the Gitlab Pipeline.
However, the documentation of Amplify says this:
Amplify Hosting does not support manual deploys for server-side rendered (SSR) apps.
That means the deployment is triggered by a push into a branch. Do you know any solution to trigger the deployment after the Gitlab Pipeline succeeded?

Related

Initializing Firebase Functions Emulator For Correct Project

I am developing a project with Firebase backend, utilising Firebase Functions. I actually two projects: myProject and myProject-test (used for deployment testing).
When submitting API calls, my (React) front-end is configured to call the myProject-test URL when running in local development, and only direct the calls to myProject when deployed on PROD.
The problem I am facing is that when I start my cloud functions emulator using firebase emulators:start, my cloud functions get started on the localhost:5001/myProject/... url instead of localhost:5001/myProject-test/..., and hence the API calls from my local development instance never arrive.
How can I control for which project the emulators start?
This is what the firebase use command is for. Read the documentation on managing aliases. You can run the command firebase use PROJECT_ID|ALIAS to set the current project or alias that is currently use use for the emulator or other commands.

Deploy asp.net react template without nodejs dependency on IIS server

I'm having problems with deploying and running the ReactRedux template on an IIS server which doesn't has nodejs. The app was created using AspNetCore.SpaTemplates' "reactredux" option:
https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/
The app is the same as the template, no changes were made. We first tried to host it on IIS with nodejs installed on the IIS server, everything works fine:
screenshot with nodejs
But when we uninstalled nodejs from the server and restarted IIS, it wasn't working anymore:
screenshot without nodejs
We couldn't figure out what the error is because running it in development mode requires nodejs and when we run it with dotnet run in development mode the error message complains about node.js not being installed, as expected.
We tried to deploy the app running:
$Env:ASPNETCORE_ENVIRONMENT = "Production"
dotnet publish -c Release
and using Visual Studios build>publish interface.
Acording to the docs here, the app shouldn't need nodejs when its deployed for production:
https://learn.microsoft.com/en-us/aspnet/core/spa/react?tabs=visual-studio
Unlike the development build, the production build doesn't require
Node.js to be installed on the server.
I'm new to asp.net and deploying apps on IIS, maybe the solution is trivial but we couldn't manage to solve this, thanks in advance.
If you don't want any nodejs dependency, make sure you disabled server-side prerendering:
https://github.com/aspnet/JavaScriptServices/issues/932
If you're not doing server-side prerendering, then you will not need
Node.js on your production server, because all the JS will be executed
on the client side.
If you are doing server-side prerendering (which is the default in the
React-Redux template in this repo), then you do need Node.js on your
production server, because the prerendering process involves executing
your JavaScript code on the server.
To disable server-side prerendering do the following:
Remove asp-prerender-module="ClientApp/dist/main-server" from Views>Home>Index.cshtml
Remove #addtaghelper "*, Microsoft.AspNetCore.SpaServices" from Views/_ViewImports.cshtml

How to deploy existing application to the Divio Cloud

I have django-cms application and I want to deploy it to the Divio cloud and really can't understand from the docs how to do it. I understand how to start new application using divio cli but not how to deploy existing.
The specifics of how to deploy an existing application to Divio Cloud vary widely based on the application structure itself. Basically Divio Cloud allows to deploy any web application which can be packaged in a Docker image.
There is some documentation about the process of migrating an existing Django application to Divio Cloud here: http://divio-cloud-developer-handbook.readthedocs.io/en/latest/how-to/migrate-existing-project.html

Watch File Changes on Service Fabric Web App

We have a web app published using Service Fabric App. My problem is I cannot immediately see my changes in client-side. I need to run "npm run build" and publish the Service Fabric again which takes more than 10 minutes.
Is there a way or a script that I can add so I can see my changes on the running web app (just refreshing the app will reflect it, like a normal web app not running on service fabric)?

How to deploy google firebase functions using cmd?

I have a problem with a web hosting project. I created a new proyect in google firebase, and I executed the following commands:
C:\myproject>firebase init functions
C:\myproject>firebase deploy --only functions
But the site says this:
Site Not Found
Why am I seeing this?
There are a few potential reasons:
You haven't deployed an app yet.
You may have deployed an empty directory.
This is a custom domain, but we haven't finished setting it up yet.
How can I deploy my first app?
Refer to our hosting documentation to get started.
What could I do for show, at least, some text when an user go to my project url?
The way you now invoke the Firebase CLI, it will only deploy the Cloud Functions in your project. It will not deploy the web site. In fact, the way you've run it, it probably didn't even create a web site to deploy.
Initialize the project with:
firebase init
And answer the questions this shows.
If you want to deploy the web site, use:
firebase deploy --only hosting
More likely you should simply deploy everything to prevent running into this problem:
firebase deploy

Resources