{"id":22865567,"url":"https://github.com/pipelight/deno.pipelight","last_synced_at":"2025-03-31T09:47:27.222Z","repository":{"id":165278055,"uuid":"640628417","full_name":"pipelight/deno.pipelight","owner":"pipelight","description":"Typescript helpers for pipelight","archived":false,"fork":false,"pushed_at":"2025-03-19T10:31:54.000Z","size":171,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T11:34:28.504Z","etag":null,"topics":["deno","docker","framew","pipelight","ssh","typescript"],"latest_commit_sha":null,"homepage":"https://pipelight.dev","language":"TypeScript","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/pipelight.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":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-14T18:01:39.000Z","updated_at":"2025-03-19T10:31:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae1615f6-9cce-4521-9e1f-9470f15d8fac","html_url":"https://github.com/pipelight/deno.pipelight","commit_stats":null,"previous_names":[],"tags_count":86,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fdeno.pipelight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fdeno.pipelight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fdeno.pipelight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fdeno.pipelight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pipelight","download_url":"https://codeload.github.com/pipelight/deno.pipelight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450403,"owners_count":20779406,"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":["deno","docker","framew","pipelight","ssh","typescript"],"created_at":"2024-12-13T11:37:39.338Z","updated_at":"2025-03-31T09:47:27.196Z","avatar_url":"https://github.com/pipelight.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pipelight Helpers\n\n**Self-hosted automation pipelines.**\nThese are the javascript/typescript functions to help define trivial tests and deployments.\n\n[Helpers Documentation](https://pipelight.dev/helpers/composition).\n\n## Overview\n\nHelpers are functions that take an Object as argument and generate executable strings for pipelight to process.\nThey are presented from the lowest to the highest level of abstraction they provide.\n\n## Common helpers\n\nDefine pipelines quicker.\n\n```ts\n// define a pipeline\npipeline(\"deploy\", () =\u003e [\n  // define steps and add your bash commands\n  step(\"build\", () =\u003e [\"vite build\"]),\n]);\n```\n\nSend commands to remotes.\n\n```ts\nstep(\"build\", () =\u003e ssh([host], [\"nginx -t\", \"systemclt restart nginx\"])),\n```\n\nEarly exec some commands to process the result.\n\n```ts\nconst pwd = await exec(\"pwd\");\n```\n\n## Docker helpers\n\nEdit a Docker Object.\n\n```ts\nconst docker = new Docker({\n  containers: [\n    {\n      name: \"my_container\",\n      image: {\n        name: \"node:latest\",\n      },\n    },\n  ],\n});\n```\n\nAdd autogenerated bash commands to your pipeline.\n\n```ts\npipeline(\"deploy\", () =\u003e [\n  // add bash commands autogenerated by the docker helper\n  step(\"create:containers\", () =\u003e [docker.images.create()]),\n  step(\"create:containers\", () =\u003e [docker.containers.create()]),\n]);\n```\n\n## Service helpers (alpha)\n\nMade on top of **docker helpers**\n\nSet global variables and then only declare containers.\nIt will auto create and link images,volumes and networks.\n\nHere we tend to use suffix instead of names.\nUsing suffix will autogenerate names based on suffix and globals to avoid colisions.\n\nYou can still use a ressource name (full name) if you want to link a known network or volume to a container.\n\n```ts\nconst service = new Service({\n  globals:{\n    version: \"production\",\n    dns: \"example.com\"\n  },\n  containers: [\n    {\n      suffix: \"api\",\n      image: {\n        name: \"node:latest\",\n      },\n      volume: {\n        suffix: \"vol\",\n        path: {\n          inside: \"/path/in/container/data\",\n        },\n      },\n      network:{\n        suffix: \"net\"\n        ip: \"172.20.40.4\"\n      }\n    },\n    {\n      suffix: \"front\",\n      image: {\n        suffix: \"front\",\n      },\n      volume: {\n        suffix: \"vol\",\n        path: {\n          inside: \"/path/in/container/data\",\n        },\n      },\n      network:{\n        suffix: \"net\"\n        ip: \"172.20.40.2\"\n      }\n    },\n  ],\n});\n```\n\nAdd autogenerated bash commands to your pipeline.\n\n```ts\npipeline(\"deploy\", () =\u003e [\n  // add bash commands autogenerated by the docker helper\n  step(\"bring full container architecture up\", () =\u003e [service.up()]),\n]);\n```\n\nOr use the internal Docker Object to tweak the commands.\nFor example if you want to build images locally.\n\n```ts\nstep(\"create:images\", ()=\u003e\nservice.docker.images.create()\n)\nstep(\"send:images\", ()=\u003e\n    service.docker.images.send([host])\n)\nstep(\"create:containers:on_remote\", ()=\u003e\n    ssh(host,[\n    ...service.docker.network.remove()\n    ...service.docker.network.create()\n    ...service.docker.volumes.create()\n    ...service.docker.containers.create()\n    ])\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpipelight%2Fdeno.pipelight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpipelight%2Fdeno.pipelight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpipelight%2Fdeno.pipelight/lists"}