From ecdab9f96f5ab94292b52010618847e88e8573fd Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 7 Sep 2017 15:43:20 +0000 Subject: [PATCH] Add script and job to trigger a docs build --- .gitlab-ci.yml | 42 ++++++++- doc/development/img/manual_build_docs.png | Bin 0 -> 14869 bytes doc/development/writing_documentation.md | 21 +++++ scripts/trigger-build-docs | 80 ++++++++++++++++++ .../{trigger-build => trigger-build-omnibus} | 0 5 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 doc/development/img/manual_build_docs.png create mode 100755 scripts/trigger-build-docs rename scripts/{trigger-build => trigger-build-omnibus} (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b42e661dff..dadce073309 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,7 @@ stages: - test - post-test - pages + - post-cleanup # Predefined scopes .dedicated-runner: &dedicated-runner @@ -153,8 +154,7 @@ stages: - master@gitlab/gitlabhq - master@gitlab/gitlab-ee -# Trigger a package build on omnibus-gitlab repository - +# Trigger a package build in omnibus-gitlab repository build-package: image: ruby:2.3-alpine before_script: [] @@ -166,11 +166,47 @@ build-package: cache: {} when: manual script: - - scripts/trigger-build + - scripts/trigger-build-omnibus only: - //@gitlab-org/gitlab-ce - //@gitlab-org/gitlab-ee +# Review docs base +.review-docs: &review-docs + image: ruby:2.4-alpine + before_script: [] + services: [] + variables: + SETUP_DB: "false" + USE_BUNDLE_INSTALL: "false" + cache: {} + when: manual + only: + - branches + +# Trigger a docs build in gitlab-docs +# Useful to preview the docs changes live +review-docs-deploy: + <<: *review-docs + stage: build + environment: + name: review-docs/$CI_COMMIT_REF_NAME + on_stop: review-docs-cleanup + script: + - gem install gitlab --no-doc + - scripts/trigger-build-docs deploy + +# Cleanup remote environment of gitlab-docs +review-docs-cleanup: + <<: *review-docs + stage: post-cleanup + environment: + name: review-docs/$CI_COMMIT_REF_NAME + action: stop + script: + - gem install gitlab --no-doc + - scripts/trigger-build-docs cleanup + # Retrieve knapsack and rspec_flaky reports retrieve-tests-metadata: <<: *tests-metadata-state diff --git a/doc/development/img/manual_build_docs.png b/doc/development/img/manual_build_docs.png new file mode 100644 index 0000000000000000000000000000000000000000..fef767c2a793f2bcf576e0f7fd9e51c92af92ce3 GIT binary patch literal 14869 zcmbt*1yGgU*Y82#fN%gwIdmv0(ueK_6$R;%=Fr_;QqrQNctAuzq@=q`N~EPhO1c~F zKJWYg=6*Bx-nnz<&M?e*V(ci9x@WJ?P%O#Mgsoi~}i8 zSWX!3HtmdW9C)wyAqEfn;=RNVd{GuFX9T#x3=v%)=c3)P(Z5Q=`vMtogPR?AsR$JB zkwhMPZV0gT2Fo%fD8^NF!_cQ>k&@u(9uFq?$y90vMV~V1`R7vmTX;PBmiq_>a0kh= zfA37{3q+4+OT_>K614x{2I4(E+7kZ2ZYeh~Gr(QkYc}RtJs=|^v$nRjo1c}H#oc6( z_3$BrD^2S#46{QrVFWfhb*q?fk(765cI03|I z#Wz~w+p67PUn}b@@M8X2VlK)$QD{jT8Xph;`0-<4EPNcPqNCH}u(Pp&+54S~5+>-m z%Rs@QAE8r*G@kr!-re0jAD3TPD5tMagI+u5S@PoL*?|!yG~i-tuK7FLkKW!EF4(6} zpH5AAczBw*U_e@(4hI@9badd0OH14q12laZB6n@Zi{vyk$hDI?$_B+B<9a!ni}b2d zWxNP)@HsJQ3C50i^QQF;`QzPQ&L+=#_lk-Nu)@LWVAuL^ZmChrt-cg)%#E=^88tOh zeuvrUyu63?yRG=A+jTpa!V(;VH7=`*^DQ9}k&!KvWfm>p+0QVCt3a^CxMuB3Ev3Z1?FLROn)9Cze% zhA%{sOCfPNC2+*VB*prbZ|?o=*sFsv8lYNE!cF9y{sylfj9V-Y>N%?nEuMZWDf>TFz0w$%TTOru{CGe5JV`(o6HUb2mYcAXFpxc)$O~K4a?;>TR6j6k8Vo} z{JR-fE!tQ&`&ww~V0R>pt(~?3yKsO~MW^vETftvx*2WOS$ zOPw)mTU!J+KCZ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j!FLzVSu~By^V%6G~kdC_>=z&dle*~9R#?? zN!zedYl01YyCvHHJn_Gz*N6UQOWwC=iYyeL6p*)4|8qv*VF0xXyqys*)zIW*4=3pp zK>Y!PnN?Pn2#t@NcjCtcwf~?XjKia&p|4ti{{wy005pRhZ1Axicw$FT>H5wF{I4+= zC8$M%NrYAmneHVhHjYkCMz*v_QNo}wBBBs;9T4jr!Fs1om_;67Gq4&A;?VP+oB)C; zPL?SKaddKG3JedRazH-#76(#u0u*w~1o-BkA|PIX^*~9Pl7{BBLGfzN@Ver?UzELP zAOCn`0epol)A{+B0g(cE=c>+JmxHDA{D)IkpFH+wf{toU&aUDLxoTat2*d5=rPaT_ zX6nmg>N#wdSNa*@!7DuA2}vT!f}`b`Il;RwEEt34{#jhQDgz8IseZ}HmoeXxNX#md zne<$2rXLnGkfquQFlr=AepOxk?RVebPGf#t6T7IAEc}~c+VW{m-built-from-ce-ee` +1. Trigger a pipeline and build the docs site with your changes + +Look for the docs URL at the output of the `build-docs` job. + +>**Note:** +Make sure that you always delete the branch of the merge request you were +working on. If you don't, the remote docs branch won't be removed either, +and the server where the Review Apps are hosted will eventually be out of +disk space. diff --git a/scripts/trigger-build-docs b/scripts/trigger-build-docs new file mode 100755 index 00000000000..e58edf189cf --- /dev/null +++ b/scripts/trigger-build-docs @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby + +require 'gitlab' + +# +# Give the remote branch a different name than the current one +# in order to avoid conflicts +# +@docs_branch = "#{ENV["CI_COMMIT_REF_SLUG"]}-built-from-ce-ee" +GITLAB_DOCS_REPO = 'gitlab-com/gitlab-docs' + +# +# Configure credentials to be used with gitlab gem +# +Gitlab.configure do |config| + config.endpoint = 'https://gitlab.com/api/v4' + config.private_token = ENV["DOCS_API_TOKEN"] # GitLab Docs bot access token which has only Developer access to gitlab-docs +end + +# +# Dummy way to find out in which repo we are, CE or EE +# +def is_ee? + File.exists?('CHANGELOG-EE.md') +end + +# +# Create a remote branch in gitlab-docs +# +def create_remote_branch + Gitlab.create_branch(GITLAB_DOCS_REPO, @docs_branch, 'master') + puts "Remote branch '#{@docs_branch}' created" +rescue Gitlab::Error::BadRequest => e + puts "Remote branch '#{@docs_branch}' already exists" +end + +# +# Remove a remote branch in gitlab-docs +# +def remove_remote_branch + Gitlab.delete_branch(GITLAB_DOCS_REPO, @docs_branch) + puts "Remote branch '#{@docs_branch}' deleted" +end + +# +# Trigger a pipeline in gitlab-docs +# +def trigger_pipeline + # Overriding vars in https://gitlab.com/gitlab-com/gitlab-docs/blob/master/.gitlab-ci.yml + param_name = is_ee? ? 'BRANCH_EE' : 'BRANCH_CE' + + # The review app URL + app_url = "http://#{@docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{is_ee? ? 'ee' : 'ce'}" + + # Create the pipeline + puts "=> Triggering a pipeline..." + pipeline = Gitlab.run_trigger(GITLAB_DOCS_REPO, ENV["DOCS_TRIGGER_TOKEN"], @docs_branch, { param_name => ENV["CI_COMMIT_REF_NAME"] }) + + puts "=> Pipeline created:" + puts "" + puts "https://gitlab.com/gitlab-com/gitlab-docs/pipelines/#{pipeline.id}" + puts "" + puts "=> Preview your changes live at:" + puts "" + puts app_url + puts "" +end + +# +# When the first argument is deploy then create the branch and trigger pipeline +# When it is 'stop', it deleted the remote branch. That way, we ensure there +# are no stale remote branches and the Review server doesn't fill. +# +case ARGV[0] +when 'deploy' + create_remote_branch + trigger_pipeline +when 'cleanup' + remove_remote_branch +end diff --git a/scripts/trigger-build b/scripts/trigger-build-omnibus similarity index 100% rename from scripts/trigger-build rename to scripts/trigger-build-omnibus