Export multi CI service build data for analyzing.
npm ci
npm run build- services
- GITHUB_TOKEN
- CIRCLECI_TOKEN
- JENKINS_USER
- JENKINS_TOKEN
- exporter
- GOOGLE_APPLICATION_CREDENTIALS=/path/to/gcp/service_account.json
- CI_ANALYZER_DEBUG=1
If you want bigquery_exporter, you need to setup BigQuery before execute.
You have to create dataset and table.
example:
bq mk
--project_id=${YOUR_GCP_PROJECT_ID} \
--table \
--time_partitioning_field=createdAt \
${DATASET}.${TABLE} \
./bigquery_schema/workflow_report.jsonEdit config yaml ci_analyzer.yaml or copy to another one and editing it.
npm run start
npx ci_analyzer
node dist/index.js -c your_custom_config.yamldocker pull kesin/ci_analyzer:latest
docker run \
--mount type=bind,src=${PWD}/ci_analyzer.yaml,dst=/app/ci_analyzer.yaml \
--mount type=bind,src=${PWD}/output,dst=/app/output \
--mount type=bind,src=${PWD}/.ci_analyzer,dst=/app/.ci_analyzer \
--mount type=bind,src=/path/to/gcp/service_account.json,dst=/app/service_account.json
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
-e CIRCLECI_TOKEN=${CIRCLECI_TOKEN} \
-e JENKINS_USER=${JENKINS_USER} \
-e JENKINS_TOKEN=${JENKINS_TOKEN} \
-e GOOGLE_APPLICATION_CREDENTIALS=/app/service_account.json \
ci_analyzer:latestSee sample cron jenkins job script
- ci_analyzer.yaml: Your config file.
- output/:
local_exporteroutput default directory. you can change it by config. - .ci_analyzer/: CIAnalyzer internal using directory for multi purpose.
- Store last run number.
If your jenkins is working on docker host machine, you should not use "localhost" to jenkins.baseUrl config. Docker can not access your Jenkins server by "localhost".
For resolve this issue, you should use host machine IP address. For example, "http://192.168.0.1:8080".
It is good idea to execute with cron on some CI services.
We put sample code for some services. See sample directory.
MIT