<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tamilarasu S</title>
    <description>The latest articles on DEV Community by Tamilarasu S (@tamilarasu602).</description>
    <link>https://dev.to/tamilarasu602</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F663072%2F436711c5-8a67-43b2-be77-7034c7a77532.jpeg</url>
      <title>DEV Community: Tamilarasu S</title>
      <link>https://dev.to/tamilarasu602</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tamilarasu602"/>
    <language>en</language>
    <item>
      <title>Deploy Node.js using Gitlab CI pipeline</title>
      <dc:creator>Tamilarasu S</dc:creator>
      <pubDate>Wed, 07 Jul 2021 16:59:02 +0000</pubDate>
      <link>https://dev.to/atdigitals/deploy-node-js-using-gitlab-ci-pipeline-2jod</link>
      <guid>https://dev.to/atdigitals/deploy-node-js-using-gitlab-ci-pipeline-2jod</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repository in Gitlab with Node.js project&lt;/li&gt;
&lt;li&gt;Production server for which you have SSH access&lt;/li&gt;
&lt;li&gt;Configure a folder in the server for a production Node.js server using steps from &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-18-04" rel="noopener noreferrer"&gt;this digitalocean guide&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;Setup the Gitlab CI/CD pipeline to push the Node.js code to the server and deploy it whenever code is merged to master branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 - Clone the repository in the server using deploy token
&lt;/h2&gt;

&lt;p&gt;Using a deploy token ensures that we can pull the code without the need to enter the credentials manually or save the credentials in the deploy script.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a deploy token for the repository or for the associated group using the steps mentioned in the &lt;a href="https://docs.gitlab.com/ee/user/project/deploy_tokens/#creating-a-deploy-token" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Clone the repository in the production server's folder using the steps from the &lt;a href="https://docs.gitlab.com/ee/user/project/deploy_tokens/#git-clone-a-repository" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. Make sure to use the correct repository url.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 2 - Give Gitlab access to your server
&lt;/h2&gt;

&lt;p&gt;We are going to use &lt;a href="https://docs.gitlab.com/ce/ci/variables/" rel="noopener noreferrer"&gt;Gitlab CI/CD Variables&lt;/a&gt; to save a private SSH key which Gitlab will use to authenticate with the server.&lt;/p&gt;

&lt;p&gt;We are going to use SSH keys to authenticate rather than username and password as it is more secure.&lt;/p&gt;

&lt;p&gt;This can be configured at a repository level or at a group level.&lt;br&gt;
To view all the CI/CD variables of your repository, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your project’s &lt;strong&gt;Settings &amp;gt; CI/CD&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Expand the &lt;strong&gt;Variables&lt;/strong&gt; section.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can also view the same at a group level by first navigating to the group (&lt;strong&gt;Menu &amp;gt; Groups &amp;gt; Your Groups&lt;/strong&gt;) and following the same steps.&lt;/p&gt;

&lt;p&gt;If you already have a &lt;code&gt;SSH_PRIVATE_KEY&lt;/code&gt; private key variable listed, you can skip this step.&lt;/p&gt;

&lt;p&gt;To create a new variable, Select the &lt;strong&gt;Add Variable&lt;/strong&gt; button and fill in the details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Key&lt;/strong&gt;: &lt;code&gt;SSH_PRIVATE_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: &lt;code&gt;&amp;lt;ssh_private_key_details&amp;gt;&lt;/code&gt;. (To generate a new SSH public and private key pair, follow steps from &lt;a href="https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent" rel="noopener noreferrer"&gt;this guide&lt;/a&gt;. Make sure to not accidentally overwrite any existing key pairs.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type&lt;/strong&gt;: &lt;code&gt;Variable&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Choose other settings based on your needs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Add Variable&lt;/strong&gt; to add the variable&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flojstz01s83cn6hnk4xg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flojstz01s83cn6hnk4xg.png" alt="Gitlab CI/CD Variable Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 - Add Gitlab SSH public key to your server
&lt;/h2&gt;

&lt;p&gt;Now, we need to add SSH public key to the list of &lt;code&gt;authorized_keys&lt;/code&gt; in the production server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SSH into your server (&lt;code&gt;ssh root@example.com&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the SSH public key to &lt;code&gt;authorized_keys&lt;/code&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nano ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3. Paste the SSH public key(starts with`ssh-rsa`) in a new line
4. Save the file

## Step 4 - Configuring Gitlab CI/CD
Gitlab looks for `.gitlab-ci.yml` in the root folder of your repository for CI/CD pipeline configurations

Add a new file `.gitlab-ci.yml` in the root folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;before_script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;apt-get update -qq&lt;/li&gt;
&lt;li&gt;apt-get install -qq git
# Setup SSH deploy keys&lt;/li&gt;
&lt;li&gt;"which ssh-agent || ( apt-get install -qq openssh-client )"&lt;/li&gt;
&lt;li&gt;eval $(ssh-agent -s)&lt;/li&gt;
&lt;li&gt;ssh-add &amp;lt;(echo "$SSH_PRIVATE_KEY")&lt;/li&gt;
&lt;li&gt;mkdir -p ~/.ssh&lt;/li&gt;
&lt;li&gt;'[[ -f /.dockerenv ]] &amp;amp;&amp;amp; echo -e "Host *\n\tStrictHostKeyChecking no\n\n" &amp;gt; ~/.ssh/config'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;deploy:&lt;br&gt;
  stage: deploy&lt;br&gt;
  environment:&lt;br&gt;
    name: production&lt;br&gt;
    url: &lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt;&lt;br&gt;
  script:&lt;br&gt;
    - bash deploy/deploy.sh&lt;br&gt;
  only:&lt;br&gt;
    - master&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Update the url in the above file to your domain

### Explanation
- We are using the default `ubuntu` docker package
- We install `git` package and then configure it to add our `SSH_PRIVATE_KEY`
- We also configure `StrictHostKeyChecking` to `no`, to ensure git doesn't show manual prompt during initial connection.
- We have setup pipeline named `deploy` with a single pipeline stage `deploy` which listens to commits on `master` and runs the script in `deploy/deploy.sh`

## Step 5 - Setup the deploy script
Add a new file `deploy.sh` in `deploy` folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;DEPLOY_SERVER=$DEPLOY_SERVER&lt;/p&gt;

&lt;p&gt;echo "Deploying to ${DEPLOY_SERVER}"&lt;br&gt;
ssh root@${DEPLOY_SERVER} 'bash' &amp;lt; ./deploy/server.sh&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Set the CI/CD variable `DEPLOY_SERVER` with value `domain.com` for the repository using step 1.

### Explanation
- We set server variable
- We ssh into our server and then execute code at `deploy/server.sh`

## Step 6 - Setup the server script
Add a new file `server.sh` in `deploy` folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Pull code
&lt;/h1&gt;

&lt;p&gt;cd /var/www/html/folder-name/&lt;br&gt;
git checkout master&lt;br&gt;
git pull origin master&lt;/p&gt;

&lt;h1&gt;
  
  
  Build and deploy
&lt;/h1&gt;

&lt;p&gt;yarn install&lt;br&gt;
yarn run build&lt;br&gt;
pm2 restart server&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Update the `folder-name` in the above script to match the folder name used in the prerequisite step

### Explanation
- We navigate to the folder
- We get the latest changes from master branch
- We install dependencies and then optionally run build(incase of typescript project)
- Finally we restart the pm2 server

## Step 7 - Setup a Gitlab runner (One time setup)
We need a runner to run our CI/CD pipeline jobs. This step is optional if a runner is already configured for your group in Gitlab. 

To setup a new Gitlab group runner
1. Install Gitlab Runner in any server with atleast 2GB of RAM using the steps from the [documentation](https://docs.gitlab.com/runner/install/). The server should be separate from where Gitlab is installed for security reasons.
2. Go to your group's __Settings &amp;gt; CI/CD__ 
3. Expand the __Runners__ section.
4. Under the __Set up a group runner manually__ section, copy the url and token
5. Then register the runner in your server using steps from [documentation](https://docs.gitlab.com/runner/register/index.html)
  - Provide default image as `ubuntu` and empty tags
6. Once the runner is registered, go back to the __Runners__ section in Gitlab to see the runner appear under __Available runners__ section

Push the `.gitlab-ci.yml` and `deploy/deploy.sh`, `deploy/server.sh` files to master to start the automated deployment.

When the deployment is complete, you should see a green checkmark in the repository home page similar to 
![Pipeline Status Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3yjjkz0hz3ihpz84rtkm.png)

You can click the status icon to go to the pipeline and then to the individual job to see the command line output of your script

## Troubleshooting
- If the job is not scheduled, make sure you have setup a runner and that the runner is active. Also check the runner parameters like `active`, `protected` and `tags` to see if any of the conditions are incorrect.

## References
- https://medium.com/devops-with-valentine/deploy-over-ssh-from-gitlab-ci-pipeline-6a0d7b87e4a
- https://medium.com/@hfally/a-gitlab-ci-config-to-deploy-to-your-server-via-ssh-43bf3cf93775
- https://codeburst.io/gitlab-build-and-push-to-a-server-via-ssh-6d27ca1bf7b4
- https://erangad.medium.com/create-ci-cd-pipeline-for-nodejs-express-with-gitlab-6c420a956b10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>node</category>
      <category>devops</category>
      <category>gitlab</category>
    </item>
    <item>
      <title>Build and deploy React using Gitlab CI pipeline</title>
      <dc:creator>Tamilarasu S</dc:creator>
      <pubDate>Wed, 07 Jul 2021 16:34:04 +0000</pubDate>
      <link>https://dev.to/atdigitals/build-and-deploy-react-using-gitlab-ci-pipeline-2bhc</link>
      <guid>https://dev.to/atdigitals/build-and-deploy-react-using-gitlab-ci-pipeline-2bhc</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repository in Gitlab with react project&lt;/li&gt;
&lt;li&gt;Production server for which you have SSH access&lt;/li&gt;
&lt;li&gt;NGINX setup for your domain to a folder in the server. See &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04" rel="noopener noreferrer"&gt;this tutorial&lt;/a&gt; on how to do it&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;Setup the Gitlab CI/CD pipeline to create a react production build and deploy to our server whenever code is merged to master branch. The attached steps can also be used for other SPA like Angular, Vue.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 - Give Gitlab access to your server
&lt;/h2&gt;

&lt;p&gt;We are going to use &lt;a href="https://docs.gitlab.com/ce/ci/variables/" rel="noopener noreferrer"&gt;Gitlab CI/CD Variables&lt;/a&gt; to save a private SSH key which Gitlab will use to authenticate with the server.&lt;/p&gt;

&lt;p&gt;We are going to use SSH keys to authenticate rather than username and password as it is more secure.&lt;/p&gt;

&lt;p&gt;This can be configured at a repository level or at a group level.&lt;br&gt;
To view all the CI/CD variables of your repository, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your project’s &lt;strong&gt;Settings &amp;gt; CI/CD&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Expand the &lt;strong&gt;Variables&lt;/strong&gt; section.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can also view the same at a group level by first navigating to the group (&lt;strong&gt;Menu &amp;gt; Groups &amp;gt; Your Groups&lt;/strong&gt;) and following the same steps.&lt;/p&gt;

&lt;p&gt;If you already have a &lt;code&gt;SSH_PRIVATE_KEY&lt;/code&gt; private key variable listed, you can skip this step.&lt;/p&gt;

&lt;p&gt;To create a new variable, Select the &lt;strong&gt;Add Variable&lt;/strong&gt; button and fill in the details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Key&lt;/strong&gt;: &lt;code&gt;SSH_PRIVATE_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: &lt;code&gt;&amp;lt;ssh_private_key_details&amp;gt;&lt;/code&gt;. (To generate a new SSH public and private key pair, follow steps from &lt;a href="https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent" rel="noopener noreferrer"&gt;this guide&lt;/a&gt;. Make sure to not accidentally overwrite any existing key pairs.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type&lt;/strong&gt;: &lt;code&gt;Variable&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Choose other settings based on your needs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Add Variable&lt;/strong&gt; to add the variable&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flojstz01s83cn6hnk4xg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flojstz01s83cn6hnk4xg.png" alt="Gitlab CI/CD Variable Config"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 - Add Gitlab SSH public key to your server
&lt;/h2&gt;

&lt;p&gt;Now, we need to add SSH public key to the list of &lt;code&gt;authorized_keys&lt;/code&gt; in the production server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SSH into your server (&lt;code&gt;ssh root@example.com&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the SSH public key to &lt;code&gt;authorized_keys&lt;/code&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nano ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3. Paste the SSH public key(starts with`ssh-rsa`) in a new line
4. Save the file

## Step 3 - Configuring Gitlab CI/CD
Gitlab looks for `.gitlab-ci.yml` in the root folder of your repository for CI/CD pipeline configurations

Add a new file `.gitlab-ci.yml` in the root folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;image: node&lt;/p&gt;

&lt;p&gt;cache:&lt;br&gt;
  paths:&lt;br&gt;
    - node_modules/&lt;/p&gt;

&lt;p&gt;before_script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;apt-get update -qq&lt;/li&gt;
&lt;li&gt;apt-get install -qq git&lt;/li&gt;
&lt;li&gt;"which ssh-agent || ( apt-get install -qq openssh-client )"&lt;/li&gt;
&lt;li&gt;eval $(ssh-agent -s)&lt;/li&gt;
&lt;li&gt;ssh-add &amp;lt;(echo "$SSH_PRIVATE_KEY")&lt;/li&gt;
&lt;li&gt;mkdir -p ~/.ssh&lt;/li&gt;
&lt;li&gt;'[[ -f /.dockerenv ]] &amp;amp;&amp;amp; echo -e "Host *\n\tStrictHostKeyChecking no\n\n" &amp;gt; ~/.ssh/config'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;deploy:&lt;br&gt;
  stage: deploy&lt;br&gt;
  environment:&lt;br&gt;
    name: production&lt;br&gt;
    url: example.com&lt;br&gt;
  script:&lt;br&gt;
    - bash deploy/deploy.sh&lt;br&gt;
  only:&lt;br&gt;
    - master&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Update the url in the above file to your domain

### Explanation
- We are using the [Node docker image](https://hub.docker.com/_/node) as the starting point
- We are caching the `node_modules` folder to improve the speed of the build
- We install `git` package and then configure it to add our `SSH_PRIVATE_KEY`
- We also configure `StrictHostKeyChecking` to `no`, to ensure git doesn't show manual prompt during initial connection.
- We have setup pipeline named `deploy` with a single pipeline stage `deploy` which listens to commits on `master` and runs the script in `deploy/deploy.sh`

## Step 4 - Setup the deploy script
Add a new file `deploy.sh` in `deploy` folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;DEPLOY_SERVER=$DEPLOY_SERVER&lt;br&gt;
SERVER_FOLDER="html-folder-in-server"&lt;/p&gt;

&lt;h1&gt;
  
  
  Building React output
&lt;/h1&gt;

&lt;p&gt;yarn install&lt;br&gt;
yarn run build&lt;/p&gt;

&lt;p&gt;echo "Deploying to ${DEPLOY_SERVER}"&lt;br&gt;
scp -r build/ root@${DEPLOY_SERVER}:/var/www/html/${SERVER_FOLDER}/&lt;/p&gt;

&lt;p&gt;echo "Finished copying the build files"&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Update the server folder to the folder name that you have created in the production server
- Set the CI/CD variable `DEPLOY_SERVER` with value `domain.com` for the repository using step 1.

### Explanation
- We set server and folder variables
- We install dependencies and then start a new react production build using `yarn`
- Once the build is done, we copy the `build` folder to `/var/www/html/html-folder-in-server/build` location in server

## Step 5 - Setup a Gitlab runner (One time setup)
We need a runner to run our CI/CD pipeline jobs. This step is optional if a runner is already configured for your group in Gitlab. 

To setup a new Gitlab group runner
1. Install Gitlab Runner in any server with atleast 2GB of RAM using the steps from the [documentation](https://docs.gitlab.com/runner/install/). The server should be separate from where Gitlab is installed for security reasons.
2. Go to your group's __Settings &amp;gt; CI/CD__ 
3. Expand the __Runners__ section.
4. Under the __Set up a group runner manually__ section, copy the url and token
5. Then register the runner in your server using steps from [documentation](https://docs.gitlab.com/runner/register/index.html)
  - Provide default image as `ubuntu` and empty tags
6. Once the runner is registered, go back to the __Runners__ section in Gitlab to see the runner appear under __Available runners__ section

Push the `.gitlab-ci.yml` and `deploy/deploy.sh` files to master to start the automated deployment.

When the deployment is complete, you should see a green checkmark in the repository home page similar to 
![Pipeline Status Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3yjjkz0hz3ihpz84rtkm.png)

You can click the status icon to go to the pipeline and then to the individual job to see the command line output of your script

## Troubleshooting
- If the job is not scheduled, make sure you have setup a runner and that the runner is active. Also check the runner parameters like `active`, `protected` and `tags` to see if any of the conditions are incorrect.
- If the job fails to produce a build output due to memory allocation issue, try increasing the memory of the server which hosts the runner. 

## References
- https://medium.com/devops-with-valentine/deploy-over-ssh-from-gitlab-ci-pipeline-6a0d7b87e4a
- https://medium.com/@hfally/a-gitlab-ci-config-to-deploy-to-your-server-via-ssh-43bf3cf93775
- https://codeburst.io/gitlab-build-and-push-to-a-server-via-ssh-6d27ca1bf7b4
- https://erangad.medium.com/create-ci-cd-pipeline-for-nodejs-express-with-gitlab-6c420a956b10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>gitlab</category>
      <category>react</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
