[libre-riscv-dev] email support for gitlab-ci-archiver

Jacob Lifshay programmerjake at gmail.com
Mon Apr 13 12:50:46 BST 2020


I fixed the issues with ignoring new jobs.
I also added support for calling external programs/shell scripts to
build the emails and stuff, since after thinking about it a bit, we're
going to probably want to reconfigure which emails get sent to who
relatively often, so having that logic in a shell script may make it
easier to maintain.

The program to run is configured in the email.command value in the config toml:

[email]
command = ["bash", "-c", "env | sort | grep '^GITLAB_CI_ARCHIVER_' && cat"]

The build log is piped to the stdin and everything gitlab-ci-archiver
knows (except for things like access tokens which shouldn't be spread
around) is sent in a whole list of environment variables. The above
email command will print all the environment variables as well as the
build log.

The list of environment variables is constructed from the JSON that
the server returns.

Part of the list of env vars:
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_0_FILENAME=job.log
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_0_FILE_FORMAT=null
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_0_FILE_TYPE=trace
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_0_SIZE=1470134
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_EXPIRE_AT=null
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_FILE=null
GITLAB_CI_ARCHIVER_JOB_ARTIFACTS_LEN=1
GITLAB_CI_ARCHIVER_JOB_COMMIT_AUTHORED_DATE=2020-04-10T16:07:07Z
GITLAB_CI_ARCHIVER_JOB_COMMIT_AUTHOR_EMAIL=lkcl at lkcl.net
GITLAB_CI_ARCHIVER_JOB_COMMIT_AUTHOR_NAME=Luke Kenneth Casson Leighton
GITLAB_CI_ARCHIVER_JOB_COMMIT_COMMITTED_DATE=2020-04-10T16:07:07Z
GITLAB_CI_ARCHIVER_JOB_COMMIT_COMMITTER_EMAIL=lkcl at lkcl.net
GITLAB_CI_ARCHIVER_JOB_COMMIT_COMMITTER_NAME=Luke Kenneth Casson Leighton
GITLAB_CI_ARCHIVER_JOB_COMMIT_CREATED_AT=2020-04-10T16:07:07Z
GITLAB_CI_ARCHIVER_JOB_COMMIT_ID=93d7d7931939585cce484b468f516412514f2719
GITLAB_CI_ARCHIVER_JOB_COMMIT_MESSAGE=connect up ALU properly to pass
full InternalOp subset over, MUL now works

Jacob



More information about the libre-riscv-dev mailing list