project_created.rb 647 字节
Newer Older
1 2
module Gitlab
  module Checks
3
    class ProjectCreated < PostPushMessage
4
      PROJECT_CREATED = "project_created".freeze
5

6
      def message
7
        <<~MESSAGE
8

9
        The private project #{project.full_path} was successfully created.
10 11

        To configure the remote, run:
12
          git remote add origin #{url_to_repo}
13 14 15 16 17 18 19 20 21

        To view the project, visit:
          #{project_url}

        MESSAGE
      end

      private

22
      def self.message_key(user_id, project_id)
23
        "#{PROJECT_CREATED}:#{user_id}:#{project_id}"
24 25 26 27 28 29 30 31
      end

      def project_url
        Gitlab::Routing.url_helpers.project_url(project)
      end
    end
  end
end