From e4cd1e03cac23eb98fb4b0d5b5bac54f906db0b9 Mon Sep 17 00:00:00 2001 From: Meng JiaFeng Date: Mon, 5 Sep 2022 16:37:34 +0800 Subject: [PATCH] feat: jenkins-gitlab support push merge request event Signed-off-by: Meng JiaFeng --- pkg/util/scm/gitlab/repo.go | 7 +++--- .../.gitignore | 24 +++++++++++++++++++ .../README.md.tpl | 9 +++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 staging/dtm-repo-scaffolding-java-springboot/.gitignore create mode 100644 staging/dtm-repo-scaffolding-java-springboot/README.md.tpl diff --git a/pkg/util/scm/gitlab/repo.go b/pkg/util/scm/gitlab/repo.go index 9030e677b..dbb28433a 100644 --- a/pkg/util/scm/gitlab/repo.go +++ b/pkg/util/scm/gitlab/repo.go @@ -87,9 +87,10 @@ func (c *Client) AddWebhook(webhookConfig *git.WebhookConfig) error { return nil } p := &gitlab.AddProjectHookOptions{ - PushEvents: gitlab.Bool(true), - Token: gitlab.String(webhookConfig.SecretToken), - URL: gitlab.String(webhookConfig.Address), + PushEvents: gitlab.Bool(true), + Token: gitlab.String(webhookConfig.SecretToken), + URL: gitlab.String(webhookConfig.Address), + MergeRequestsEvents: gitlab.Bool(true), } _, _, err = c.Projects.AddProjectHook(c.GetRepoPath(), p) if err != nil { diff --git a/staging/dtm-repo-scaffolding-java-springboot/.gitignore b/staging/dtm-repo-scaffolding-java-springboot/.gitignore new file mode 100644 index 000000000..524f0963b --- /dev/null +++ b/staging/dtm-repo-scaffolding-java-springboot/.gitignore @@ -0,0 +1,24 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* diff --git a/staging/dtm-repo-scaffolding-java-springboot/README.md.tpl b/staging/dtm-repo-scaffolding-java-springboot/README.md.tpl new file mode 100644 index 000000000..a9430bcc1 --- /dev/null +++ b/staging/dtm-repo-scaffolding-java-springboot/README.md.tpl @@ -0,0 +1,9 @@ +# [[.AppName]] + +This is a repo for app [[.AppName]]; bootstrapped by DevStream. + +By default, the automatically generated scaffolding contains: + +- a piece of sample java web app code using the [SpringBoot](https://spring.io/projects/spring-boot/) +- Dockerfile +- .gitignore