{"id":19736963,"url":"https://github.com/travis-ci/travis-api","last_synced_at":"2025-04-04T14:08:28.566Z","repository":{"id":3998841,"uuid":"5096124","full_name":"travis-ci/travis-api","owner":"travis-ci","description":"The Travis CI API","archived":false,"fork":false,"pushed_at":"2024-05-22T13:16:49.000Z","size":12056,"stargazers_count":294,"open_issues_count":72,"forks_count":166,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-05-23T07:47:07.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developer.travis-ci.com/","language":"Ruby","has_issues":false,"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/travis-ci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2012-07-18T12:55:46.000Z","updated_at":"2024-05-29T11:07:27.869Z","dependencies_parsed_at":"2024-03-25T16:16:20.999Z","dependency_job_id":"16e935e6-b016-4b28-882a-e23cf0ebe0d2","html_url":"https://github.com/travis-ci/travis-api","commit_stats":{"total_commits":3971,"total_committers":93,"mean_commits":42.69892473118279,"dds":0.8839083354318811,"last_synced_commit":"d456c3f01fe0a737a87794b03421f6aee74e6480"},"previous_names":[],"tags_count":331,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travis-ci%2Ftravis-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travis-ci%2Ftravis-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travis-ci%2Ftravis-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travis-ci%2Ftravis-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/travis-ci","download_url":"https://codeload.github.com/travis-ci/travis-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190251,"owners_count":20898702,"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":[],"created_at":"2024-11-12T01:09:02.916Z","updated_at":"2025-04-04T14:08:28.548Z","avatar_url":"https://github.com/travis-ci.png","language":"Ruby","funding_links":[],"categories":["Continuous Integration"],"sub_categories":[],"readme":"# Travis API\n\n[![Build Status](https://travis-ci.com/travis-ci/travis-api.svg?branch=master)](https://travis-ci.com/travis-ci/travis-api)\n\n\nhttps://api.travis-ci.org\n\n## WARNING!!!!!\nMaster branch is designed for .com only. If you would like to deploy changes for .org please use org-only branch\n## Requirements\n\nYou will need the following packages to get travis-api to work:\n\n1. PostgreSQL 9.3 or higher\n2. Bundler\n3. Redis\n4. *Optional:* RabbitMQ Server\n5. *Optional:* Nginx -\n    *If working in Ubuntu please install nginx manually from source: Download and extract latest nginx version, open a terminal in extracted folder and then run the following:*\n```sh-session\n    $ sudo apt-get install libpcre3 libpcre3-dev\n    $ auto/configure --user=$USER\n    $ make\n    $ sudo make install\n    $ sudo ln -s /usr/local/nginx/sbin/nginx /bin/nginx\n```\n\n## Installation\n\n### Setup\n```sh-session\n$ bundle install\n```\n### Main Database \u0026 Logs Database setup\n\n*You might need to create a role first. For this you should run the following:*\n\n```sh-session\n$ sudo -u postgres psql -c \"CREATE USER yourusername WITH SUPERUSER PASSWORD 'yourpassword'\"\n```\n\nDatabases are set up with a Rake task that uses the database schemas (`structure.sql`) in `travis-migrations`. Details can be found in the `Rakefile`.\nYou can override the `travis-migrations` branch that is being used by setting the environment variable `TRAVIS_MIGRATIONS_BRANCH`.\n\n\nTo create and migrate the Databases:\n\n```sh-session\n$ ENV=development bundle exec rake db:create\n$ ENV=test bundle exec rake db:create\n```\n\nPlease Note: The database names are configured using the environment variable ENV. If you are using a different configuration you will have to make your own adjustments. The default environment is `test`.\n\n\n### Run tests\n```sh-session\n$ bundle exec rake\n```\n\n### Run the server (development)\n```sh-session\nENV=development bundle exec ruby -Ilib -S rackup\n```\n\n### To test your branch locally:\n- checkout your branch\n- run the local server:\n```sh-session\nENV=development bundle exec ruby -Ilib -S rackup\n```\n\n- get the correct token in another window:\n```sh-session\ntravis login --api-endpoint=http://localhost:9292\ntravis token --api-endpoint=http://localhost:9292\n```\n- run a request:\n```sh-session\ncurl -H \"Travis-API-Version: 3\" \\\n     -H \"Authorization: token xxxxxxxxxxxx\" \\\n     http://localhost:9292/repos\n```\n\n(The database connection can be overwritten by setting a DATABASE_URL env var. Please ensure you also set ENV to the corresponding env and add encryption key config to `config/travis.yml`)\n\n### Test billing locally:\nTo test billing locally add the following code to the config/travis.yml:\n\n```\ndevelopment:\n  billing:\n    url: \"http://localhost:9292\"\n    auth_key: \"auth_keys\"\n```\ngo to your local api repo and make sure API is running on port 9293:\n\n```\nENV=development  bundle exec ruby -Ilib -S rackup -p 9293\n```\n\ngo to your local billing repo and run which runs on 9292:\n```\nmake start\n```\nand then you can run:\n\n```\ncurl -H \"Travis-API-Version: 3\" \\\n     -H \"content-type: application/json\" \\\n     -H \"Authorization: token \u003cyour-token\u003e\" \\\n     http://localhost:9293/subscriptions\n```\nand get:\n```  \n{\n  \"@type\": \"subscriptions\",\n  \"@href\": \"/subscriptions\",\n  \"@representation\": \"standard\",\n  \"subscriptions\": [\n\n  ]\n}\n```\n\n\n\n### Run the server (production)\n```sh-session\n$ bundle exec script/server\n```\nIf you have problems with Nginx because the websocket is already in use, try restarting your computer.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n### API documentation\n\nv3 documentation can be found at https://developer.travis-ci.org which is a repository that can be found at https://github.com/travis-pro/developer\n\n### Adding V3 Endpoints Developer Documentation\nStart with the find/get spec (for example: spec/v3/services/caches/find_spec.rb) for your new endpoint. If you don't have a find route start with whatever route you want to add first. Run the test and add the files you need to clear the errors. They should be:\n - A service (lib/travis/api/v3/services/caches/find.rb)\n - A query (lib/travis/api/v3/queries/caches.rb)\n - Register the service in v3/services.rb (alphabetical order please)\n - Add a route (v3/routes.rb)\n Re-run the test at this point. Depending on what objects you are returning you may also need to add:\n - Add a model (either pulls from the DB or a wrapper for the class of the objects returned from another source (s3 for example), or that structures the result you will be passing back to the client)\n - Add a renderer (if needed to display your new model/object/collection).\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravis-ci%2Ftravis-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftravis-ci%2Ftravis-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravis-ci%2Ftravis-api/lists"}