summaryrefslogtreecommitdiff
path: root/scripts/create_release.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-01-11 14:24:20 +0900
committerShinya Maeda <shinya@gitlab.com>2019-01-11 14:24:20 +0900
commitb26db14d62cfbbe11d0e84630a5809c6ac67656a (patch)
treeb268002210822811148e2e976b7833a7dd062f53 /scripts/create_release.rb
parent89c4d2ae623dbd666e2eaa58812323b81e02b4ea (diff)
downloadgitlab-ce-create-release-entry-in-pipeline.tar.gz
Create release entry in pipelinecreate-release-entry-in-pipeline
Diffstat (limited to 'scripts/create_release.rb')
-rw-r--r--scripts/create_release.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/create_release.rb b/scripts/create_release.rb
new file mode 100644
index 00000000000..29dfe0a2bb4
--- /dev/null
+++ b/scripts/create_release.rb
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+class Release
+ attr_reader :edition, :tag
+
+ def initialize(edition, tag)
+ @edition = edition
+ @tag = tag
+ end
+
+ def valid?
+ /^$/.match(tag) && /^$/.match(previous_tag)
+ end
+
+ def create
+ return unless valied?
+
+ # curl --header 'Content-Type: application/json' \
+ # --header "PRIVATE-TOKEN: $GITLAB_RELEASE_API_TOKEN" \
+ # --data '{ "name": "${name}", "tag_name": "${tag_name}", "description": "${changelog}" }' \
+ # --request POST \
+ # http://gitlab.com/api/v4/projects/$CI_PROJECT_ID/releases
+ end
+
+ private
+
+ def previous_release
+
+ end
+
+ def changelog_path
+ './CHANGELOG.md'
+ end
+
+ def changelog_diff
+
+ end
+end
+
+Release.new("CE", ENV['CI_COMMIT_TAG']).create