{"id":62296,"date":"2024-06-29T08:07:11","date_gmt":"2024-06-29T02:37:11","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=62296"},"modified":"2024-07-29T09:47:44","modified_gmt":"2024-07-29T04:17:44","slug":"understanding-buildkite-pipeline-snyk-integration-part-1","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/understanding-buildkite-pipeline-snyk-integration-part-1\/","title":{"rendered":"Accelerate Your Development with Buildkite Pipelines"},"content":{"rendered":"<div>\n<h2 dir=\"auto\" data-heading=\"Introduction\">Introduction<\/h2>\n<\/div>\n<div>\n<p dir=\"auto\">In today&#8217;s fast-paced digital landscape, efficient and reliable software delivery is paramount for businesses to stay competitive. Buildkite, a powerful cloud-native CI\/CD platform, offers a robust solution to streamline the development process.<\/p>\n<p dir=\"auto\">Buildkite is a modern cloud-native CI\/CD platform that empowers development teams to build, test, and deploy software efficiently. At its core, a Buildkite pipeline is a series of interconnected jobs that execute in a specific order to automate the software development lifecycle. This blog post will delve into the fundamentals of Buildkite pipelines, exploring their components, configuration, and best practices.<\/p>\n<p dir=\"auto\">It uses a hybrid architecture to separate:<\/p>\n<\/div>\n<div>\n<ul class=\"has-list-bullet\" dir=\"auto\">\n<li dir=\"auto\" data-line=\"0\">\n<div class=\"list-bullet\" dir=\"auto\">The control panel<\/div>\n<\/li>\n<li dir=\"auto\" data-line=\"1\">\n<div class=\"list-bullet\" dir=\"auto\">The build environment<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<div>\n<p dir=\"auto\">Buildkite runs the control panel as a SaaS product, and we run the build environment on our infrastructure.<br \/>\nIn other words, Buildkite handles the orchestration, and we can have our own compute unit.<br \/>\nAs a result, we have a secure build environment to suit our particular use case and workflow.<\/p>\n<div class=\"page\" title=\"Page 1\">\n<div id=\"attachment_62300\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62300\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-62300\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/buildkite-hybrid-architecture-1024x610.png\" alt=\"Buildkite Architecture\" width=\"625\" height=\"372\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/buildkite-hybrid-architecture-1024x610.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/buildkite-hybrid-architecture-300x179.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/buildkite-hybrid-architecture-768x458.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/buildkite-hybrid-architecture-624x372.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/buildkite-hybrid-architecture.png 1504w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-62300\" class=\"wp-caption-text\">Buildkite Architecture<\/p><\/div>\n<\/div>\n<\/div>\n<p>The hybrid architecture reduces the maintenance burden compared to self-hosted solutions and gives us the security and control missing from fully SaaS build tools.<\/p>\n<h2>Objective<\/h2>\n<p>This article will provide a step-by-step guide for setting up a buildkite agent on EC2 and help you understand the buildkite pipeline basics.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>Amazon Linux 2023 EC2 instance<\/li>\n<li>Buildkite Account<\/li>\n<li>Github \/ Gitlab Account.<\/li>\n<\/ul>\n<h3><span style=\"font-size: 1.28571rem;\">Agent Installation\u00a0<\/span><\/h3>\n<div>\n<div>\n<p dir=\"auto\">Agents in buildkite is a program that is responsible for the execution of the pipeline. It&#8217;s a small, reliable, and cross-platform build runner that links our infrastructure to Buildkite. It checks in Buildkite for work, executes jobs, and also reports results. Agents can be installed on the local machine, any cloud servers, or any other remote machines. At least one agent will be required to run builds.<\/p>\n<\/div>\n<div>In this example, we will install an agent on the &#8220;<strong>Amazon Linux 2023<\/strong>&#8221; EC2 Instance.<\/div>\n<\/div>\n<div><\/div>\n<div>\n<div id=\"attachment_62488\" style=\"width: 280px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62488\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-62488 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.50.46\u202fAM.png\" alt=\"os-release\" width=\"270\" height=\"58\" \/><p id=\"caption-attachment-62488\" class=\"wp-caption-text\">os-release<\/p><\/div>\n<\/div>\n<p><strong>Step 1:<\/strong> First, Add the yum repository for our architecture (we executed uname -m to find our system&#8217;s arch).<\/p>\n<div id=\"attachment_62489\" style=\"width: 167px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62489\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62489\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.52.15\u202fAM.png\" alt=\"uname -m\" width=\"157\" height=\"41\" \/><p id=\"caption-attachment-62489\" class=\"wp-caption-text\">system architecture<\/p><\/div>\n<div>\n<p dir=\"auto\">The default version of the agent is stable. Still, you can get the beta version by using unstable instead of stable in the following command, or the agent built from the repository&#8217;s main branch by using experimental instead of stable.<\/p>\n<div>\n<pre class=\"language-bash\" dir=\"auto\"><code class=\"is-loaded language-bash\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">sh<\/span> -c <span class=\"token string\">'echo -e \"[buildkite-agent]\\nname = Buildkite Pty Ltd\\nbaseurl = https:\/\/yum.buildkite.com\/buildkite-agent\/stable\/x86_64\/\\nenabled=1\\ngpgcheck=0\\npriority=1\" &gt; \/etc\/yum.repos.d\/buildkite-agent.repo'<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div>\n<p dir=\"auto\"><strong>Step 2:<\/strong> Install agent<\/p>\n<pre dir=\"auto\">sudo yum -y install buildkite-agent<\/pre>\n<\/div>\n<\/div>\n<div id=\"attachment_62490\" style=\"width: 696px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62490\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62490\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.54.06\u202fAM.png\" alt=\"Agent installed.\" width=\"686\" height=\"158\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.54.06\u202fAM.png 686w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.54.06\u202fAM-300x69.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.54.06\u202fAM-624x144.png 624w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><p id=\"caption-attachment-62490\" class=\"wp-caption-text\">Agent installed<\/p><\/div>\n<div>\n<p dir=\"auto\"><strong>Configure Agent token :<\/strong><\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\">sudo sed -i \"s\/xxx\/YourActualAgentToken\/g\" \/etc\/buildkite-agent\/buildkite-agent.cfg<\/pre>\n<\/div>\n<div>\n<p dir=\"auto\">or, open the config file with a text editor and input your actual token here, <code>token=\"xxx\"<\/code><\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\">sudo vim \/etc\/buildkite-agent\/buildkite-agent.cfg<\/pre>\n<\/div>\n<div id=\"attachment_62491\" style=\"width: 434px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62491\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62491\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.59.39\u202fAM.png\" alt=\"Agent Token\" width=\"424\" height=\"46\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.59.39\u202fAM.png 424w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-8.59.39\u202fAM-300x33.png 300w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><p id=\"caption-attachment-62491\" class=\"wp-caption-text\">Agent Token<\/p><\/div>\n<div>\n<p dir=\"auto\"><strong>Step 3:<\/strong> Start the buildkite agent and check its service status:<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\">sudo systemctl enable buildkite-agent &amp;&amp; sudo systemctl start buildkite-agent &amp;&amp; sudo systemctl status buildkite-agent<\/pre>\n<\/div>\n<div id=\"attachment_62492\" style=\"width: 1235px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62492\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-62492 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.02.55\u202fAM.png\" alt=\"Agent Status\" width=\"1225\" height=\"227\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.02.55\u202fAM.png 1225w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.02.55\u202fAM-300x56.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.02.55\u202fAM-1024x190.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.02.55\u202fAM-768x142.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.02.55\u202fAM-624x116.png 624w\" sizes=\"(max-width: 1225px) 100vw, 1225px\" \/><p id=\"caption-attachment-62492\" class=\"wp-caption-text\">Agent Status<\/p><\/div>\n<div>\n<p dir=\"auto\">The buildkite service log can be viewed using the below command:<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\">sudo journalctl -u buildkite-agent<\/pre>\n<\/div>\n<div id=\"attachment_62493\" style=\"width: 1739px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62493\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-62493 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM.png\" alt=\"Service Log\" width=\"1729\" height=\"401\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM.png 1729w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM-300x70.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM-1024x237.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM-768x178.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM-1536x356.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.04.29\u202fAM-624x145.png 624w\" sizes=\"(max-width: 1729px) 100vw, 1729px\" \/><p id=\"caption-attachment-62493\" class=\"wp-caption-text\">Service Log<\/p><\/div>\n<div>\n<p dir=\"auto\"><strong>Step 4:<\/strong> SSH Setup in Agent Instance<\/p>\n<\/div>\n<div>\n<pre class=\"language-shell\" dir=\"auto\">sh-4.2$ sudo su buildkite-agent\r\nbash-4.2$ mkdir -p ~\/.ssh &amp;&amp; cd ~\/.ssh\r\nbash-4.2$ ssh-keygen -t rsa -b 4096 -C \"ec2-agent@buildkite\"<\/pre>\n<div id=\"attachment_62494\" style=\"width: 711px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62494\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62494\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.11.52\u202fAM.png\" alt=\"SSH Setup\" width=\"701\" height=\"139\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.11.52\u202fAM.png 701w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.11.52\u202fAM-300x59.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.11.52\u202fAM-624x124.png 624w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><p id=\"caption-attachment-62494\" class=\"wp-caption-text\">SSH Setup<\/p><\/div>\n<p><strong>Note<\/strong>: In the GitLab <code>User Settings - SSH Keys<\/code> , Add your public key, key title, and expiration date.<\/p>\n<\/div>\n<div id=\"attachment_62495\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62495\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-62495\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-1024x620.png\" alt=\"Add public key\" width=\"625\" height=\"378\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-1024x620.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-300x182.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-768x465.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-1536x930.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-2048x1239.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.23.16\u202fAM-624x378.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-62495\" class=\"wp-caption-text\">Add public key<\/p><\/div>\n<div>\n<p dir=\"auto\">Execute the below command to check if the SSH Setup was successful.<\/p>\n<\/div>\n<div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\"><code class=\"language-bash is-loaded\"><span class=\"token function\">ssh<\/span> -T git@gitlab.com<\/code><\/pre>\n<\/div>\n<div>\n<div id=\"attachment_62496\" style=\"width: 318px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62496\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62496\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.26.39\u202fAM.png\" alt=\"SSH Status\" width=\"308\" height=\"38\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.26.39\u202fAM.png 308w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-11.26.39\u202fAM-300x38.png 300w\" sizes=\"(max-width: 308px) 100vw, 308px\" \/><p id=\"caption-attachment-62496\" class=\"wp-caption-text\">Login Status check<\/p><\/div>\n<\/div>\n<\/div>\n<div>\n<p dir=\"auto\"><strong>Note<\/strong>: Exit from the\u00a0<code>buildkite-agent<\/code>\u00a0user after setting up SSH.<\/p>\n<\/div>\n<div>\n<p dir=\"auto\"><strong>Step 5:<\/strong> Docker support for the Buildkite agent<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\">sudo yum install docker\r\nsudo systemctl enable docker.service\r\nsudo systemctl start docker.service\r\nsudo systemctl status docker.service<\/pre>\n<div id=\"attachment_62502\" style=\"width: 1176px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62502\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-62502\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.14.52\u202fAM.png\" alt=\"docker status\" width=\"1166\" height=\"255\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.14.52\u202fAM.png 1171w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.14.52\u202fAM-300x66.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.14.52\u202fAM-1024x224.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.14.52\u202fAM-768x168.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.14.52\u202fAM-624x136.png 624w\" sizes=\"(max-width: 1166px) 100vw, 1166px\" \/><p id=\"caption-attachment-62502\" class=\"wp-caption-text\">docker status<\/p><\/div>\n<div>\n<p dir=\"auto\"><strong>Step 6:<\/strong> Docker-compose support for Buildkite agent<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\"># docker-compose (latest version)\r\nsudo curl -L https:\/\/github.com\/docker\/compose\/releases\/latest\/download\/docker-compose-$(uname -s)-$(uname -m) -o \/usr\/local\/bin\/docker-compose\r\n# Fix permissions after download\r\nsudo chmod +x \/usr\/local\/bin\/docker-compose\r\n# Verify success\r\ndocker-compose version<\/pre>\n<div id=\"attachment_62503\" style=\"width: 305px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62503\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62503\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.25.12\u202fAM.png\" alt=\"docker compose version\" width=\"295\" height=\"39\" \/><p id=\"caption-attachment-62503\" class=\"wp-caption-text\">docker-compose version<\/p><\/div>\n<div>\n<p dir=\"auto\"><strong>Step 7:<\/strong> Allow <code>buildkite-agent<\/code> user to run the docker<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\">sudo usermod -a -G docker buildkite-agent<\/pre>\n<div id=\"attachment_62504\" style=\"width: 360px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62504\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62504\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.33.32\u202fAM.png\" alt=\"buildkite user verification\" width=\"350\" height=\"115\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.33.32\u202fAM.png 350w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-9.33.32\u202fAM-300x99.png 300w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><p id=\"caption-attachment-62504\" class=\"wp-caption-text\">Verify services<\/p><\/div>\n<h3><strong>A few file locations are listed for quick access :<\/strong><\/h3>\n<ul>\n<li>Configuration: \/etc\/buildkite-agent\/buildkite-agent.cfg<\/li>\n<li>Agent Hooks: \/etc\/buildkite-agent\/hooks\/<\/li>\n<li>Builds: \/var\/buildkite-agent\/builds\/<\/li>\n<li>Agent user home: \/var\/lib\/buildkite-agent\/<\/li>\n<li>SSH keys: \/var\/lib\/buildkite-agent\/.ssh\/<\/li>\n<li>Logs, depending on your system:\n<ul>\n<li>journalctl -f -u buildkite-agent (systems)<\/li>\n<li>\/var\/log\/buildkite-agent.log (older systems)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div>\n<p dir=\"auto\"><strong>Running multiple agents<\/strong>\u00a0:<br \/>\nYou can run as many parallel agent workers on one machine as you wish with the <code>spawn<\/code> variable in a configuration file, or by passing the\u00a0<code>--spawn<\/code> flag in the buidkite-agent start command.<\/p>\n<pre dir=\"auto\"># Start 3 workers. Each one independently fetches and executes jobs.\r\nspawn=3<\/pre>\n<p dir=\"auto\"><strong>Creating a new queue for the buidkite agent :<\/strong><br \/>\nOpen the config file with the below command,<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\"><code class=\"language-bash is-loaded\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">vim<\/span> \/etc\/buildkite-agent\/buildkite-agent.cfg<\/code><\/pre>\n<div>\n<p dir=\"auto\">Add the below variable in the config file:<\/p>\n<pre dir=\"auto\"><code>tags=\"queue=aws-ec2-agent\"<\/code><\/pre>\n<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div id=\"attachment_62506\" style=\"width: 467px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62506\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-62506\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.16.18\u202fAM.png\" alt=\"Agent Queue\" width=\"457\" height=\"58\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.16.18\u202fAM.png 457w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.16.18\u202fAM-300x38.png 300w\" sizes=\"(max-width: 457px) 100vw, 457px\" \/><p id=\"caption-attachment-62506\" class=\"wp-caption-text\">Agent Queue<\/p><\/div>\n<div>\n<p dir=\"auto\"><strong>Note<\/strong>: To apply any changes done in\u00a0<code>buildkite-agent.cfg<\/code> , you must execute the below command:<\/p>\n<\/div>\n<div>\n<pre class=\"language-bash\" dir=\"auto\"><code class=\"language-bash is-loaded\"><span class=\"token function\">sudo<\/span> systemctl reload-or-restart buildkite-agent<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>If all steps are done correctly, you will see your agent in the buildkite dashboard.<\/p>\n<div id=\"attachment_62507\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-62507\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-62507\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-1024x381.png\" alt=\"Agent Status\" width=\"625\" height=\"233\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-1024x381.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-300x112.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-768x286.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-1536x571.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-2048x761.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-2024-06-12-at-10.29.05\u202fAM-624x232.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-62507\" class=\"wp-caption-text\">Agent Queues<\/p><\/div>\n<h3>Pipeline Demonstration<\/h3>\n<p>Pipelines are how Buildkite represents a CI\/CD workflow. You define each pipeline with a series of steps to run. When you trigger a pipeline, you create a build, and steps are dispatched as jobs to run on agents. Jobs are independent of each other and can run on different agents.<\/p>\n<p><strong>Step 1<\/strong>: Let&#8217;s create a new pipeline in Buildkite.<\/p>\n<div id=\"attachment_63119\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-63119\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63119\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-896x1024.png\" alt=\"New Buildkite Pipeline\" width=\"625\" height=\"714\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-896x1024.png 896w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-262x300.png 262w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-768x878.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-1344x1536.png 1344w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-1791x2048.png 1791w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/NewPipeline-624x713.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63119\" class=\"wp-caption-text\">New Buildkite Pipeline<\/p><\/div>\n<p>You will need to provide your Git repository URL, Pipeline Name, Description and we will leave the Steps section as default.<\/p>\n<p><strong>Step 2: <\/strong>GitLab Webhook Integration<\/p>\n<div id=\"attachment_63120\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-63120\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63120\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-1024x655.png\" alt=\"Gitlab Webhook Integration\" width=\"625\" height=\"400\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-1024x655.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-300x192.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-768x491.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-1536x982.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-2048x1310.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/WebHookIntegration-624x399.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63120\" class=\"wp-caption-text\">Gitlab Webhook Integration<\/p><\/div>\n<div id=\"attachment_63136\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-63136\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63136\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-1024x369.png\" alt=\"Gitlab Webhook Integration\" width=\"625\" height=\"225\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-1024x369.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-300x108.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-768x276.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-1536x553.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-2048x737.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Pasted-image-20240612105258-624x225.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63136\" class=\"wp-caption-text\">Gitlab Webhook Integration<\/p><\/div>\n<p>We can verify the webhook integration test, check the below sample for reference.<\/p>\n<div id=\"attachment_63137\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-63137\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63137\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-1024x634.png\" alt=\"Webhook Integration Test\" width=\"625\" height=\"387\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-1024x634.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-300x186.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-768x476.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-1536x951.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-2048x1269.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/IntegrationTest-624x387.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63137\" class=\"wp-caption-text\">Webhook Integration Test<\/p><\/div>\n<p>This integration triggers new builds whenever new code is pushed. Check the sample below,<\/p>\n<div id=\"attachment_63138\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-63138\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63138\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-1024x306.png\" alt=\"Pipeline Trigger\" width=\"625\" height=\"187\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-1024x306.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-300x90.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-768x230.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-1536x460.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-2048x613.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/PipelineSample-624x187.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63138\" class=\"wp-caption-text\">Pipeline Trigger<\/p><\/div>\n<h2>Conclusion<\/h2>\n<p>There it is, we have successfully installed the buildkite agent on the EC2 Machine and also demonstrated setting up the sample pipeline. In Part 2 of this blog series, we will dig deeper into buidlkite pipeline &amp; we will setup nodejs application build with the Snyk Vulnerability scan.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In today&#8217;s fast-paced digital landscape, efficient and reliable software delivery is paramount for businesses to stay competitive. Buildkite, a powerful cloud-native CI\/CD platform, offers a robust solution to streamline the development process. Buildkite is a modern cloud-native CI\/CD platform that empowers development teams to build, test, and deploy software efficiently. At its core, a [&hellip;]<\/p>\n","protected":false},"author":1741,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":39},"categories":[2348],"tags":[5992,4252,1892],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/62296"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1741"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=62296"}],"version-history":[{"count":17,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/62296\/revisions"}],"predecessor-version":[{"id":63510,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/62296\/revisions\/63510"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=62296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=62296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=62296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}