{"id":15055540,"url":"https://github.com/bilby91/ddsl","last_synced_at":"2025-08-02T13:09:48.700Z","repository":{"id":56844100,"uuid":"158868063","full_name":"bilby91/ddsl","owner":"bilby91","description":"Docker Declarative Specific Language","archived":false,"fork":false,"pushed_at":"2020-04-05T20:15:57.000Z","size":197,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T13:52:11.685Z","etag":null,"topics":["ci","circleci","ddsl","docker","gitlab","ruby","travis-ci"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/bilby91.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-23T18:51:23.000Z","updated_at":"2021-05-12T23:31:09.000Z","dependencies_parsed_at":"2022-08-26T13:51:37.144Z","dependency_job_id":null,"html_url":"https://github.com/bilby91/ddsl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/bilby91/ddsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilby91%2Fddsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilby91%2Fddsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilby91%2Fddsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilby91%2Fddsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilby91","download_url":"https://codeload.github.com/bilby91/ddsl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilby91%2Fddsl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268393956,"owners_count":24243326,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ci","circleci","ddsl","docker","gitlab","ruby","travis-ci"],"created_at":"2024-09-24T21:44:17.562Z","updated_at":"2025-08-02T13:09:48.679Z","avatar_url":"https://github.com/bilby91.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ddsl\n\n\u003e Docker Declarative Specific Language\n\n`ddsl` allow developers to express in a declarative way how application are built, run and tested. Building, running and testing applications should be semlessly, independently on what environment your are. `ddsl` makes the latter easy by providing one cli to use in CI and development environments.\n\n## Dependencies\n\n- ruby\n- docker\n- docker-compose\n\n## Installation\n\nYou can install `ddsl` with either of this mechansims\n\n### Gem\n\nLike any ruby gem\n\n`gem install ddsl`\n\n### Docker\n\nWhen running on modern CI providers like [Circle CI](https://circleci.com) or [GitLab](https://gitlab.com) you can install it using the docker image `bilby91/ddsl:latest`. You can find more information on how to use it by looking at ddsl's [Circle CI implementation](https://github.com/bilby91/ddsl/blob/master/.circleci/config.yml) or [GitLab implementation](https://github.com/bilby91/ddsl/blob/master/.gitlab-ci.yml)\n\n## Usage\n\n`ddsl` it's a command line tool that works with a companion `.ddsl.yml` file. In the `.ddsl.yml` file you can declare the diferent builds and runs that your application will need. A very simple example would look like this:\n\n```yaml\nversion: 1\n\nbuilds:\n  - name: feature-branch\n    type: docker\n    context: .\n    file: docker/Dockerfile\n    tags:\n      - bilby91/ddsl:$CI_SHA1\n    push: true\n    cache_from:\n      - bilby91/ddsl:latest\n\nruns:\n  - name: test\n    type: docker\n    image: bilby91/ddsl:$CI_SHA1\n    cmd: bundle exec rspec spec\n\n  - name: lint\n    type: docker\n    image: bilby91/ddsl:$CI_SHA1\n    cmd: rubocop .\n```\n\n### Build\n\nIn order to run our feature-branch build we invoke\n\n`ddsl build feature-branch`\n\n### Run\n\nNow that we have our image built we can run things on it\n\n`ddsl run test lint`\n\n### Environment Variables\n\nIf you want to inject environmental variables in your build or run definition it's really easy with `ddsl`. You just need to interpolate the environmental variable name in your `.ddsl.yml` file like you would do\nin a bash script in order to get them injected.\n\nLets take a look at a section of the previous example:\n\n```yaml\nbuilds:\n  - name: feature-branch\n    type: docker\n    context: .\n    file: docker/Dockerfile\n    tags:\n      - bilby91/ddsl:$CI_SHA1\n    push: true\n    cache_from:\n      - bilby91/ddsl:latest\n```\n\nIn this case, our feature-branch build depends on the `CI_SHA1` enviromental variable. When invoking `CI_SHA1=XXXX ddsl build feature-branch`, ddsl will replace `CI_SHA1` with the appropiate value (in this case, XXXX) and continue it's normal work.\n\n### Templates\n\nTemplates let you [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) your `.ddsl.yml` configurations. If you have multiple builds in your project, templates will be very useful for encapsulating common options that all or some of your builds need. Templates can be used in either builds or runs.\n\nLets take a look at a possible scenario where using templates would make sense.\n\n```yaml\nversion: 1\n\ntemplates:\n  - name: base-build\n    context: .\n    file: docker/Dockerfile\n    push: true\n    tags:\n      - bilby91/ddsl:$CI_SHA1\n    cache_from:\n      - bilby91/ddsl:latest\n\nbuilds:\n  - name: feature-branch\n    type: docker\n    templates:\n      - base-build\n\n  - name: master\n    type: docker\n    templates:\n      - base-build\n    tags:\n      - bilby91/ddsl:latest\n```\n\nIn the example above we have introduced a new build called master. We have encapsulated all the common options between master and feature-branch in a template called base-build. When ddsl runs either feature-branch or master builds it will merge the options from the template into each build's options.\n\nSome important things to note in regards to templates implementation:\n\nIf the templateable object (either a build or a run) have the same key defined, ddsl will behave like this:\n\n1. If the key's value is either a string or a number, the templetable object value will be favored. This allows overriding certain keys when inheriting from a template.\n2. If the key's value is an array, the template items of the array will be added to the templatable object array.\n3. If the key's value is a map, the template items of the map will be merged in the templatable object map.\n    1. If we have a collision here, `ddsl` will behave like described in point 1.\n\n## Documentation\n\nFor the moment, looking at how `ddsl` uses itself is the best documentation. You can find it here [`.ddsl.yml`](https://github.com/bilby91/ddsl/blob/master/.ddsl.yml).\n\nYou can also look at how `ddsl` integrates with different CI providers\n\n- [Circle CI](https://github.com/bilby91/ddsl/blob/master/.circleci/config.yml) \n- [GitLab](https://github.com/bilby91/ddsl/blob/master/.gitlab-ci.yml)\n- [Travis](https://github.com/bilby91/ddsl/blob/master/.travis.yml)\n\n### Schema\n\nThe `.ddsl.yml` schema [documentation](https://github.com/bilby91/ddsl/blob/master/docs/ddsl.schema.md) can found [here](https://github.com/bilby91/ddsl/blob/master/docs/ddsl.schema.md) \n\n## Continuous Integration\n\n| Provider  | Status                                                                                                                                   |\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------|\n| GitLab CI | [![Gitlab CI](https://img.shields.io/gitlab/pipeline/bilby91/ddsl/master.svg)](https://gitlab.com/bilby91/ddsl)                          |\n| Circle CI | [![Circle CI](https://img.shields.io/circleci/project/github/bilby91/ddsl/master.svg)](https://circleci.com/gh/bilby91/ddsl/tree/master) |\n| Travis CI | [![Travis CI](https://img.shields.io/travis/com/bilby91/ddsl/master.svg)](https://travis-ci.com/bilby91/ddsl)                                |\n## Contact\n\n- Martín Fernández \u003cfmartin91@gmail.com\u003e\n- Iván Etchart \u003civan.etchart@me.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilby91%2Fddsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilby91%2Fddsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilby91%2Fddsl/lists"}