{"id":18421139,"url":"https://github.com/akarsh/gitlab-api-implementation","last_synced_at":"2025-04-13T11:23:26.347Z","repository":{"id":44142227,"uuid":"108727969","full_name":"akarsh/GitLab-API-Implementation","owner":"akarsh","description":"This project demonstrates, how to integrate gitlab api and abdkit library in a simple website application using nodejs.","archived":false,"fork":false,"pushed_at":"2023-04-22T22:38:44.000Z","size":322,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T07:17:44.755Z","etag":null,"topics":["adbkit","android","github-api","html5","localhost","nodejs","tutorial"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akarsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-10-29T11:23:57.000Z","updated_at":"2024-06-21T18:54:36.000Z","dependencies_parsed_at":"2024-11-06T04:27:00.035Z","dependency_job_id":"262e4820-2f5a-482c-9d22-092ee64a6e9e","html_url":"https://github.com/akarsh/GitLab-API-Implementation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akarsh%2FGitLab-API-Implementation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akarsh%2FGitLab-API-Implementation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akarsh%2FGitLab-API-Implementation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akarsh%2FGitLab-API-Implementation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akarsh","download_url":"https://codeload.github.com/akarsh/GitLab-API-Implementation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703983,"owners_count":21148261,"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":["adbkit","android","github-api","html5","localhost","nodejs","tutorial"],"created_at":"2024-11-06T04:24:29.975Z","updated_at":"2025-04-13T11:23:26.283Z","avatar_url":"https://github.com/akarsh.png","language":"JavaScript","readme":"# GitLab-API-Implementation\n\nThis project demonstrates, how to integrate gitlab api and abdkit library in a simple website application using nodejs.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Project file structure](#project-file-structure)\n- [Tutorial](#tutorial)\n- [Credits](#credits)\n\n### Introduction\n\nThis project was created to make it easy for the testers to download an artifact file i.e. apk file without navigating through the multiple pages in GitLab website. and it integrates the adbkit. Which allows the tester to install the artifact file i.e. apk file on all the connected devices to the computer; where this application is running.\n\nNote: You need to initialise adb on the computer and check all the devices are connected to the computer via\n\n    $ adb devices\n\n**Note:**\n\n\u003e For more details on the gitlab library. Refer to [node-gitlab](https://github.com/node-gitlab/node-gitlab)\n\n\u003e For more details on the adbkit library. Refer to [adbkit](https://github.com/openstf/adbkit)\n\n## Installation\n\ncd into folder `GitLab-API-Implementation` then\n\n    npm install -save\n\n### Project file structure\n\n* [`app.js`](app.js) - Application starting point\n* [`node_modules/`](node_modules) - Contains all the downloaded dependent node modules\n* [`public/`](public) - Contains the image files, js files and css dependencies\n* [`package.json`](package.json) - Contains the dependency configuration for npm managed node modules\n* [`routes/`](routes) - URL(HTTP method) to controller mapping and all file paths of jade files are declared\n* [`views/`](views) - Contains the view templates for the application\n\n### Tutorial\n\nThe library files are declared\n```\nvar http = require('http'); // http library https://www.npmjs.com/package/http\nvar fs = require('fs'); // fs library https://www.npmjs.com/package/fs\nvar formidable = require(\"formidable\"); // formidable library https://www.npmjs.com/package/formidable\nvar util = require('util'); // util library https://www.npmjs.com/package/util\n\n// Express library for routing. Refer to documentation https://expressjs.com/en/guide/routing.html for more details.\nvar express = require('express'); // express library https://www.npmjs.com/package/express\nvar app = express();\n\n// GitLab nodeJS library to access GitLab API\nvar gitlab = require('gitlab'); // gitlab library https://www.npmjs.com/package/gitlab\n\n// Libraries for adb installation\nvar Promise = require('bluebird') // bluebird library https://www.npmjs.com/package/bluebird\nvar adb = require('adbkit') // adbkit library is a nodejs client for adb https://www.npmjs.com/package/adbkit\nvar request = require('request') // request library to make http calls https://www.npmjs.com/package/request\nvar Readable = require('stream').Readable // stream library https://www.npmjs.com/package/stream\nvar client = adb.createClient()\n```\n\nThe global variables are declared\n```\n// Global variables\nvar storeProjectId; // Project Id\nvar storeProjectName; // Project Name\nvar storeProjectUsername; // Project username\nvar storeBranches = [];  //Branches\nvar storeBuildId = []; // Build Id\nvar storeBuildName = []; // Build Name\nvar storeBuildStatus = []; // Build Status\nvar storeBuildStage = []; // Build Stage\nvar storeBuildReference = []; // Build Reference\nvar storeBuildArtifacts = []; // Build Artifacts\n```\n\nExpress library is used to do the routing\n\n```js\n/* GET home page. */\nrouter.get('/', function (req, res) {\n  res.render('index', {\n    title: 'Home'\n  });\n});\n\n/* POST projects page. */\nrouter.post('/projects', function (req, res) {\n  processAllFieldsOfTheProjectsForm(req, res);\n});\n\n/* POST branches page. */\nrouter.post('/projects/branches', function (req, res) {\n  processAllFieldsOfTheBranchesForm(req, res);\n});\n\n/* POST builds page. */\nrouter.post('/projects/branches/builds', function (req, res) {\n  processAllFieldsOfTheBuildsForm(req, res);\n});\n\n/* POST trace page. */\nrouter.post('/projects/branches/builds/trace', function (req, res) {\n  processAllFieldsOfTraceForm(req, res);\n});\n\n/* POST trace page. */\nrouter.post('/projects/branches/builds/install', function (req, res) {\n  processAllFieldsOfInstallForm(req, res);\n});\n```\n\n**Note:**\n\n\u003e For tutorial on how the adbkit is used to install an apk file. Refer to [adkit-install-apk-tutorial](https://github.com/akarsh/adkit-install-apk-tutorial)\n\n### Credits\n\nThis project uses Open Source components. You can find the source code of the open source projects along with license information below. I acknowledge the authors of the open source projects and I'm grateful for their contributions to the open source community.\n\n* Project: [express](https://github.com/expressjs/express)\n\n  Author: [209+ contributors](https://github.com/expressjs/express/graphs/contributors)\n\n  License: [MIT](https://github.com/expressjs/express/blob/master/LICENSE)\n\n* Project: [node-formidable](https://github.com/felixge/node-formidable)\n\n  Author: [58 contributors](https://github.com/felixge/node-formidable/graphs/contributors)\n\n  License: [MIT](https://github.com/felixge/node-formidable/blob/master/LICENSE)\n\n* Project: [node-gitlab](https://github.com/node-gitlab/node-gitlab)\n\n  Author: [41 contributors](https://github.com/node-gitlab/node-gitlab/graphs/contributors)\n\n  License: [MIT](https://github.com/node-gitlab/node-gitlab/blob/develop/LICENSE.md)\n\n* Project: [node-util](https://github.com/defunctzombie/node-util)\n\n  Author: [3 contributors](https://github.com/defunctzombie/node-util/graphs/contributors)\n\n  License: [MIT](https://github.com/defunctzombie/node-util/blob/master/LICENSE)\n\n* Project: [bluebird](https://github.com/petkaantonov/bluebird)\n\n  Author: [185 contributors](https://github.com/petkaantonov/bluebird/graphs/contributors)\n\n  License: [MIT](https://github.com/petkaantonov/bluebird/blob/master/LICENSE)\n\n* Project: [adbkit](https://github.com/openstf/adbkit)\n\n  Author: [9 contributors](https://github.com/openstf/adbkit/graphs/contributors)\n\n  License: [Apache-2.0](https://github.com/openstf/adbkit/blob/master/LICENSE)\n\n* Project: [request](https://github.com/request/request)\n\n  Author: [273 contributors](https://github.com/request/request/graphs/contributors)\n\n  License: [Apache-2.0](https://github.com/request/request/blob/master/LICENSE)\n\n* Project: [stream](https://github.com/juliangruber/stream)\n\n  Author: [3 contributors](https://github.com/juliangruber/stream/graphs/contributors)\n\n  License: [MIT](https://github.com/juliangruber/stream#license)\n\n* Project: [axios](https://github.com/axios/axios)\n\n  Author: [110 contributors](https://github.com/axios/axios/graphs/contributors)\n\n  License: [MIT](https://github.com/axios/axios/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakarsh%2Fgitlab-api-implementation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakarsh%2Fgitlab-api-implementation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakarsh%2Fgitlab-api-implementation/lists"}