{"id":21577939,"url":"https://github.com/wesleysbmartins/node_with_jenkins","last_synced_at":"2026-04-12T04:39:33.098Z","repository":{"id":262846621,"uuid":"888535415","full_name":"wesleysbmartins/node_with_jenkins","owner":"wesleysbmartins","description":"Este é um projeto de estudos onde a ideia é implementar uma esteira de CI/CD usando Jenkins, uma ferramenta de automação extremamente poderosa e conhecida no mercado.","archived":false,"fork":false,"pushed_at":"2024-11-22T17:14:24.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T14:15:52.219Z","etag":null,"topics":["docker","github-webhooks","javascript","jenkins","jest","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wesleysbmartins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-14T15:08:19.000Z","updated_at":"2024-11-26T00:38:30.000Z","dependencies_parsed_at":"2024-11-14T16:36:04.934Z","dependency_job_id":"e2565dd5-7d07-4e09-ac3d-37b7802fc0d1","html_url":"https://github.com/wesleysbmartins/node_with_jenkins","commit_stats":null,"previous_names":["wesleysbmartins/node_with_jenkins"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleysbmartins%2Fnode_with_jenkins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleysbmartins%2Fnode_with_jenkins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleysbmartins%2Fnode_with_jenkins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleysbmartins%2Fnode_with_jenkins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wesleysbmartins","download_url":"https://codeload.github.com/wesleysbmartins/node_with_jenkins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244175811,"owners_count":20410756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","github-webhooks","javascript","jenkins","jest","nodejs"],"created_at":"2024-11-24T13:09:02.241Z","updated_at":"2025-12-31T00:16:35.026Z","avatar_url":"https://github.com/wesleysbmartins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJs with Jekins [![My Skills](https://skillicons.dev/icons?i=nodejs,jest,docker,github,jenkins)](https://skillicons.dev)\nEste é um projeto de estudos onde a ideia é implementar uma esteira de CI/CD usando Jenkins, uma ferramenta de automação extremamente poderosa e conhecida no mercado.\n\nTemos uma aplicação simples, que é um servidor REST que recebe requisições e as retorna um resultado de sucesso. Com a implementação de testes usando Jest e o encapsulamento da aplicação em um container do Docker.\n\nA ideia é que a cada merge na minha branch master a Pipeline seja executada, onde eu uso o GitHub Webhook para disparar uma request ao meu servidor do Jenkins e ele é resposável por iniciar a Pipeline, onde a esteira de CI/CD do Jenkins realiza a validação da versão, executa os testes e em caso de sucesso uma nova versão é colocada em produção.\n\nExplore o meu **Jenkinsfile** para entender na prática o que esta sendo executado na minha pipeline.\n\n```groovy\npipeline {\n    agent any\n\n    tools {\n        nodejs 'NodeJS'\n    }\n\n    stages {\n\n        stage('Checkout') {\n            steps {\n                git branch: 'master', url: 'https://github.com/wesleysbmartins/node_with_jenkins.git'\n            }\n        }\n\n        stage('Install Dependencies') {\n            steps {\n                bat 'npm install'\n            }\n        }\n\n        stage('Tests') {\n            steps {\n                bat 'npm test'\n            }\n        }\n\n        stage('Build Docker Image') {\n\n            steps {\n                script {\n                    def imageName = 'node_with_jenkins:latest'\n                    echo \"Building Docker image: ${imageName}\"\n                    bat \"docker build -t ${imageName} .\"\n                }\n            }\n        }\n\n        stage('Deploy') {\n            steps {\n                script {\n                    def containerName = 'node_with_jenkins_container'\n                    def imageName = 'node_with_jenkins:latest'\n\n                    echo \"Stopping and removing existing container, if any\"\n                    bat \"docker stop ${containerName} || echo 'No container to stop'\"\n                    bat \"docker rm ${containerName} || echo 'No container to remove'\"\n\n                    echo \"Deploying new container\"\n                    bat \"docker run -d --name ${containerName} -p 5050:5050 ${imageName}\"\n                }\n            }\n        }\n    }\n    \n    post {\n        success {\n            echo 'Pipeline completed successfully!'\n        }\n        failure {\n            echo 'Pipeline failed. Check logs for details.'\n        }\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesleysbmartins%2Fnode_with_jenkins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwesleysbmartins%2Fnode_with_jenkins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesleysbmartins%2Fnode_with_jenkins/lists"}