Sharing Top Content from the Angular-sphere.

GitLab Build and Deploy to a Server via SSH – codeburst

  • GitLab Build and Deploy to a Server via SSHGoalIs to create a build and deployment process, where you tag to release to production, push to master to release to staging server via ssh scp.
  • SIMPLE 😉We are going to be usingGitlab CI/CDAngular Cli to build our sample project (with unit and e2e testing)SSH SCP to move our files to serverSSHPASS to help escape ssh password promptLets get our sample angular app rollingnpm install -g @angular/cling new gitlabAppcd gitlabAppng serveyou should see our app on http://localhost:4200You…
  • Read more about gitlab ci/cd for more configurations here.NB: don’t forget to add the new repo as a remote origin, so you can push to the repoDeploying to SSH ServerWe are going to be using sshpass to perform our secured copy (scp) since we can’t perform ssh directly on CI since…
  • Then run our scp command like soexport SSHPASS=$USER_PASS- sshpass -e scp -o stricthostkeychecking=no -r directory-to-copy set our $USER_PASS variable, we open our gitlab repo dashboard and navigate to Settings CI/CD Secret variablesSet Secret ENV variablesOur final .
  • yml should look like thisGitlab Final Script for Deploying Your App over SSHCommit and push, then check your build job on gitlab ✌️Tip: Oh if you are having error on permission denied while copying files to ssh server via scp you can check hereYolla done.Thanks to Jonas Felix for the…

Is to create a build and deployment process, where you tag to release to production, push to master to release to staging server via ssh scp. SIMPLE 😉 Lets assume you have Gitlab repo created, so we…

GitLab Build and Deploy to a Server via SSHGoalIs to create a build and deployment process, where you tag to release to production, push to master to release to staging server via ssh scp. SIMPLE 😉We are going to be usingGitlab CI/CDAngular Cli to build our sample project (with unit and e2e testing)SSH SCP to move our files to serverSSHPASS to help escape ssh password promptLets get our sample angular app rollingnpm install -g @angular/cling new gitlabAppcd gitlabAppng serveyou should see our app on http://localhost:4200You can also run your e2e and unit test by using ng e2e and ng test respectively.Build Process ConfigurationLets assume you have Gitlab repo created, so we can create a gitlab-ci.yml under our root folder, so gitlab can pick it up and run through it. Will create two environmentStaging: when we push to master branch, this is triggeredProduction: when we create a tag or release, this is triggeredFor just the app build processThe above will just list the distribution files on the console, next step should push the generated files to server 👐 . Read more about gitlab ci/cd for more configurations here.NB: don’t forget to add the new repo as a remote origin, so you can push to the repoDeploying to SSH ServerWe are going to be using sshpass to perform our secured copy (scp) since we can’t perform ssh directly on CI since it will request for password, which we can’t respond to. With sshpass we can set our password via SSHPASS environment variable and it will auto…

GitLab Build and Deploy to a Server via SSH – codeburst