This is the repository for the Gitlab CI source connector, written in Typescript.
To iterate on this connector, make sure to complete this prerequisites section.
From the root repository directory (NOT this folder), run:
npm run prepare
This will install all required dependencies and build all included connectors, including the Gitlab CI source connector.
Now you can cd into the Gitlab CI connector directory, sources/gitlab-ci-source
,
and iterate on the Gitlab CI source connector. After making code changes, run:
npm run build
Provide necessary credentials:
token
- Log into your GitLab account and then generate a personal Access Token.
groupName
- Name of Gitlab group (e.g. faros.io)
projects
- List of projects of the group (e.g. project1, project2, ...)
Then create a file secrets/config.json
conforming to the resources/spec.json
file. Note that any directory named
secrets
is gitignored across the entire airbyte-connectors
repo, so there is
no danger of accidentally checking in sensitive information. See
test_files/config.json
for a sample config file.
bin/main spec
bin/main check --config secrets/config.json
bin/main discover --config secrets/config.json
bin/main read --config secrets/config.json --catalog test_files/full_configured_catalog.json
Go back to the root repository directory and run: First, make sure you build the latest Docker image:
docker build . --build-arg path=sources/gitlab-ci-source --build-arg version=0.0.1 -t gitlab-ci-source
Then return to the Gitlab CI connector directory and run any of the connector commands as follows:
docker run --rm gitlab-ci-source spec
docker run --rm -v $(pwd)/secrets:/secrets gitlab-ci-source check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets gitlab-ci-source discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/test_files:/test_files gitlab-ci-source read --config /secrets/config.json --catalog /test_files/full_configured_catalog.json
To run unit tests locally, from the Gitlab CI connector directory run:
npm test
We use lerna to manage dependencies that are shared by
all connectors in this repository. Dependencies specific to this connector
should go in the connector's package.json
. Dependencies shared by all
connectors, such as linting/formatting tools, should go in the root
package.json
.