From cff5f388eae4135e9a7e759707815d83d6b71270 Mon Sep 17 00:00:00 2001 From: Sharor Date: Tue, 19 Sep 2017 10:08:26 +0200 Subject: [PATCH] #2 minor - added Dockerfile and mocked up pipeline. The first part attemtps to run Wincrementor as part of a tollgate --- Dockerfile | 6 +++ Gemfile | 17 ++++++++ pipeline.yml | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 Dockerfile create mode 100644 Gemfile create mode 100644 pipeline.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..14ea4c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM ruby:2.3 +RUN apt-get update && \ + apt-get install -y cmake +COPY wincrementor.rb ./wincrementor.rb +COPY Gemfile ./Gemfile +RUN bundle install diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..b0336b9 --- /dev/null +++ b/Gemfile @@ -0,0 +1,17 @@ +source "https://rubygems.org" +#pdfkit and kramdown reqires sudo apt-get install wkhtmltopdf on the machines +gem 'mercurial-ruby', :require => false +gem 'pdfkit' +gem 'rake' +gem 'rugged', '~> 0.24.0' +gem 'trac4r', :require => false +gem 'docopt' +gem 'ruby-fogbugz', :require => false +gem 'flexmock' +gem 'zip' +gem 'liquid' +gem 'xml-simple', '~> 1.1', '>= 1.1.5' +gem 'simplecov' +gem 'simplecov-rcov' +gem 'ci_reporter_test_unit' +gem 'rspec' diff --git a/pipeline.yml b/pipeline.yml new file mode 100644 index 0000000..5eb290e --- /dev/null +++ b/pipeline.yml @@ -0,0 +1,113 @@ +jobs: +- name: wincrement-version + public: true + plan: + - get: version + - get: tollgate + trigger: true + - task: version + config: + platform: linux + image_resource: + type: docker-image + source: + repository: sharor/wincrementor + tag: "1.0.0" + inputs: + - name: tollgate + outputs: + - name: versioned-tollgate + run: + path: sh + args: + - -exc + - | + echo "- - - - - - - - - - Setup for modifying version on commit - - - - - - - - - -" + cd tollgate && git config --global user.email "concourse@places.com" && git config --global user.name "ConcourseCI" + ssh-keyscan github.com && git fetch && current=$(cat version) && originprefix="origin" + git branch -a --list + branch=$(git branch -r --list 'origin/wip/*') && wip=${branch#" origin/"} + echo "- - - - - - - - - - Determine new version - - - - - - - - - -" + echo $(ruby /wincrementor.rb origin/master $current)>version + git add version && git commit --amend --reuse-message HEAD + mv version ../versioned-tollgate/version + - put: tollgate + params: + repository: tollgate + timeout: 5m + - put: version + params: {file: versioned-tollgate/version} + +#- name: build +# plan: +# - get: repository +# trigger: true +# - get: version +# passed: [wincrement-version] +# - put: docker-image +# params: +# build: repository +# cache: false +# tag: version/version +# tag_as_latest: true + # on_failure: +# put: slack-alert +# params: + # channel: '#concoursebuildresults' +# text_file: | +# text: | +## The build failed for wincrementor. + +resource_types: +#- name: slack-notification +# type: docker-image +# source: +# repository: cfcommunity/slack-notification-resource +# tag: latest + +- name: tollgate + type: docker-image + source: + repository: groenborg/concourse-git-phlow + tag: '1.0.22' + +resources: +#- name: repository +# type: git +# source: +# uri: git@github.com:Sharor/testrepo.git +# branch: mimicready +# private_key: {{concourse-token}} + +#- name: slack-alert +# type: slack-notification +# source: +# url: {{slack-praqma}} + +#- name: docker-image +# type: docker-image +# source: +# email: {{docker-hub-email}} +# username: {{docker-hub-username}} +# password: {{docker-hub-password}} +# repository: {{docker-repo}} + +- name: version + type: semver + source: + driver: git + initial_version: 0.0.0 + uri: git@github.com:Sharor/testrepo.git + branch: version + file: version + private_key: {{concourse-token}} + +- name: tollgate + type: tollgate + source: + prefixready: ready/ + prefixwip: wip/ + master: master + url: https://github.com/Sharor/testrepo.git + username: {{github-username}} + password: {{github-password}}