diff options
| author | can eldem <eldemcan@gmail.com> | 2020-06-17 12:01:07 +0100 |
|---|---|---|
| committer | can eldem <eldemcan@gmail.com> | 2020-06-18 10:23:11 +0100 |
| commit | 7f76fe7001fb3ce339fe5e00117a7c71b075cb79 (patch) | |
| tree | 0ba3e49647fc924e167733601116bd1d6d03cb43 /.gitlab | |
| parent | 64a83b700f63af76c5915b10dccb8745ebc4fed5 (diff) | |
WIP: Add maintenence jobs for repeating tasks
Diffstat (limited to '.gitlab')
| -rw-r--r-- | .gitlab/maintenance.yml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.gitlab/maintenance.yml b/.gitlab/maintenance.yml new file mode 100644 index 0000000..09cb530 --- /dev/null +++ b/.gitlab/maintenance.yml @@ -0,0 +1,21 @@ +update-spdx: + stage: maintenance + image: alpine:3.9 + script: + - apk add --no-cache git + - git config --global user.email "gitlab-bot@gitlab.com" + - git config --global user.name "GitLab Bot" + - git config --global credential.username "gitlab-bot" + - "before=$(cksum spdx-licenses.json | awk -F' ' '{ print $1 }')" + - echo ${before} + - ./bin/update-spdx + - "after=$(cksum spdx-licenses.json | awk -F' ' '{ print $1 }')" + - echo ${after} + - test $before -eq $after && exit 0 + - export BRANCH="$CI_JOB_NAME-$CI_PIPELINE_IID" + - git checkout -b $BRANCH + - git add spdx-licenses.json + - git commit -m "Update spdx-licenses.json" + - git push -o merge_request.label=\"group::composition analysis\" -o merge_request.create -o merge_request.remove_source_branch -o merge_request.target=$CI_COMMIT_REF_NAME ${CI_PROJECT_URL/https:\/\/gitlab.com/https://gitlab-bot:$GITLAB_TOKEN@gitlab.com}.git $BRANCH + rules: + - if: '$CI_UPDATE_SPDX == "true"'
\ No newline at end of file |
