SlideShare uma empresa Scribd logo
1 de 13
Marco Brandizi <marco.brandizi@rothamsted.ac.uk>
30/4/2021
Continuos Integration
@Knetminer
Find this presentation on SlidesShare
Background source: https://tinyurl.com/ydq2e6xn
What's Continuous Integration, by the
way?
Image source: https://pt.slideshare.net/thyagk/continuous-integration-system/3
Typical CI build workflow
1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP
2. Get and set variables (eg, github and Nexus credentials)
3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user)
4. "mvn deploy", or "mvn install"
1. depending on conditions (eg, if we're in the master branch and not in a pull request)
5. Are we releasing?
1. Tag github with new version and git-commit
2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user)
6. Local git commits (eg, because of POM's new versions and tagging)? => git push
Our (and not only)
Issues
1. Pre-check if build is needed
2. Settings
3. Pre-build Release ops
4. Maven (includes deployment)
5. Post-build release ops
6. Git Push
• Pretty much the same for all
Java/Maven projects
• Copy-pasting is hard to maintain
• Can't we factorise?
Our (and not only)
Issues
• CIs in my past five years:
• Until 2016: Bamboo
• 2017-2021: Jenkins
• 2018-2020: Travis
• 2020-2021: GitHub Actions
• 2022 Yet another one?!
• Every time:
• New system to learn
• New syntax to describe CI jobs to learn
• Migrating previous jobs and test
• Migrating settings (eg, credentials)
• Can't we make it portable?
• (At least a little more?)
My Approach
Just plug-in in your CI
1. Pre-check if build is needed
2. Settings
3. Pre-build Release ops
4. Maven (includes deployment)
5. Post-build release ops
6. Git Push
Your CI job (see archetype-resources/.github/workflows/build.yml)
mkdir -p ci-build
<Download install.sh>
./ci-build/install.sh
# was downloaded together with others (eg, maven-settings.xml)
./ci-build/build.sh
Need an example?
https://github.com/Rothamsted/rdf2pg/blob/master/.github/workflows/build.yml
Customisation
1. Pre-check if build is needed
2. Settings
3. Pre-build Release ops
4. Maven (includes deployment)
5. Post-build release ops
6. Git Push
• Uhm... aren't you throwing your CI
workflow at me?
• I've had the problem myself
• Solution: script hooks
Customisation with script hooks
1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP
2. Get and set variables (eg, github and Nexus credentials)
build-begin.sh
3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user)
4. build-before.sh
( "mvn deploy", or "mvn install" ) OR build-body.sh
build-after.sh
5. Are we releasing?
1. Tag github with new version and git-commit
2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user)
6. Local git commits (eg, because of POM's new versions and tagging)? => git push
build-end.sh
Customisation with script
hooks
Your CI job
1. Download
2. Run
1. Pre-check if build is needed
2. Settings
build-begin.sh
3. Pre-build Release ops
4. build-before.sh
Maven (includes deployment) OR build-body.sh
build-after.sh
5. Post-build release ops
6. Git Push
build-end.sh
Just add your hooks as needed
1. to <your-repo>/ci-build/
2. Only the ones you need
3. They see build variables (eg, IS_RELEASE,
NEW_RELEASE_VER)
4. They can expose their own variables (eg, for the next hook)
1. Or change existing ones (be careful)
Need an example?
https://github.com/Rothamsted/knetminer/tree/master/ci-build
• You'll see customisations for:
• Settings custom variables (docker_tag)
• Build on top of our own Docker-based environment, instead of GH Actions environment
• Much more portable
• post-build actions to push new Docker images (including release images)
• Invocation of Jenkins API to trigger internal deployment jobs
(which redeploy from the new Docker images)
Final notes
• build.sh isn't the bible, we can change/improve as we need, eg
• more hooks
• See if it can be adapted to other languages (eg, Python) or a new one is needed
• DO NOT copy it locally just because it doesn't fit your needs, try to reuse stuff!
• Please let me know about proposed/made changes
• Are there alternatives? => https://github.com/rosineygp/mkdkr
• + Entirely based on Docker + Make, more portable
• - Not sure using Docker even for the simplest builds is worth
• - I know Make very little, not sure I want to depend on it
• ~ Requires some CI configuration anyway (eg, to set up credentials and alike, should be solved with a
credential manager)
• - Presumably, would require volume mapping to manage the cache (and cache configuration at CI level)

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Github basics
Github basicsGithub basics
Github basics
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
Social Coding GitHub 2015
Social Coding GitHub 2015Social Coding GitHub 2015
Social Coding GitHub 2015
 
Gitflow. A successful Git branching model.
Gitflow. A successful Git branching model.Gitflow. A successful Git branching model.
Gitflow. A successful Git branching model.
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Workflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaWorkflows using Git GitHub | Edureka
Workflows using Git GitHub | Edureka
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using Github
 
Github
GithubGithub
Github
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.
 
Intro to Git, GitHub, and Devpost
Intro to Git, GitHub, and DevpostIntro to Git, GitHub, and Devpost
Intro to Git, GitHub, and Devpost
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
Git101
Git101Git101
Git101
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Travis CI
Travis CITravis CI
Travis CI
 

Semelhante a Continuos Integration @Knetminer

Semelhante a Continuos Integration @Knetminer (20)

Git
GitGit
Git
 
DrupalCon Los Angeles - Continuous Integration Toolbox
DrupalCon Los Angeles - Continuous Integration ToolboxDrupalCon Los Angeles - Continuous Integration Toolbox
DrupalCon Los Angeles - Continuous Integration Toolbox
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
MoldCamp - multidimentional testing workflow. CIBox.
MoldCamp  - multidimentional testing workflow. CIBox.MoldCamp  - multidimentional testing workflow. CIBox.
MoldCamp - multidimentional testing workflow. CIBox.
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Git hub visualstudiocode
Git hub visualstudiocodeGit hub visualstudiocode
Git hub visualstudiocode
 
git and github
git and githubgit and github
git and github
 
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHub
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
DevOps Workshop Part 1
DevOps Workshop Part 1DevOps Workshop Part 1
DevOps Workshop Part 1
 
Git basics
Git basicsGit basics
Git basics
 
CICD_1670665418.pdf
CICD_1670665418.pdfCICD_1670665418.pdf
CICD_1670665418.pdf
 

Mais de Rothamsted Research, UK

Mais de Rothamsted Research, UK (20)

FAIR Agronomy, where are we? The KnetMiner Use Case
FAIR Agronomy, where are we? The KnetMiner Use CaseFAIR Agronomy, where are we? The KnetMiner Use Case
FAIR Agronomy, where are we? The KnetMiner Use Case
 
Interoperable Data for KnetMiner and DFW Use Cases
Interoperable Data for KnetMiner and DFW Use CasesInteroperable Data for KnetMiner and DFW Use Cases
Interoperable Data for KnetMiner and DFW Use Cases
 
AgriSchemas: Sharing Agrifood data with Bioschemas
AgriSchemas: Sharing Agrifood data with BioschemasAgriSchemas: Sharing Agrifood data with Bioschemas
AgriSchemas: Sharing Agrifood data with Bioschemas
 
Publishing and Consuming FAIR Data A Case in the Agri-Food Domain
Publishing and Consuming FAIR DataA Case in the Agri-Food DomainPublishing and Consuming FAIR DataA Case in the Agri-Food Domain
Publishing and Consuming FAIR Data A Case in the Agri-Food Domain
 
Better Data for a Better World
Better Data for a Better WorldBetter Data for a Better World
Better Data for a Better World
 
AgriSchemas Progress Report
AgriSchemas Progress ReportAgriSchemas Progress Report
AgriSchemas Progress Report
 
AgriFood Data, Models, Standards, Tools, Use Cases
AgriFood Data, Models, Standards, Tools, Use CasesAgriFood Data, Models, Standards, Tools, Use Cases
AgriFood Data, Models, Standards, Tools, Use Cases
 
Notes about SWAT4LS 2018
Notes about SWAT4LS 2018Notes about SWAT4LS 2018
Notes about SWAT4LS 2018
 
Getting the best of Linked Data and Property Graphs: rdf2neo and the KnetMine...
Getting the best of Linked Data and Property Graphs: rdf2neo and the KnetMine...Getting the best of Linked Data and Property Graphs: rdf2neo and the KnetMine...
Getting the best of Linked Data and Property Graphs: rdf2neo and the KnetMine...
 
Knetminer Backend Training, Nov 2018
Knetminer Backend Training, Nov 2018Knetminer Backend Training, Nov 2018
Knetminer Backend Training, Nov 2018
 
A Preliminary survey of RDF/Neo4j as backends for KnetMiner
A Preliminary survey of RDF/Neo4j as backends for KnetMinerA Preliminary survey of RDF/Neo4j as backends for KnetMiner
A Preliminary survey of RDF/Neo4j as backends for KnetMiner
 
Towards FAIRer Biological Knowledge Networks 
Using a Hybrid Linked Data 
and...
Towards FAIRer Biological Knowledge Networks 
Using a Hybrid Linked Data 
and...Towards FAIRer Biological Knowledge Networks 
Using a Hybrid Linked Data 
and...
Towards FAIRer Biological Knowledge Networks 
Using a Hybrid Linked Data 
and...
 
Behind the Scenes of KnetMiner: Towards Standardised and Interoperable Knowle...
Behind the Scenes of KnetMiner: Towards Standardised and Interoperable Knowle...Behind the Scenes of KnetMiner: Towards Standardised and Interoperable Knowle...
Behind the Scenes of KnetMiner: Towards Standardised and Interoperable Knowle...
 
graph2tab, a library to convert experimental workflow graphs into tabular for...
graph2tab, a library to convert experimental workflow graphs into tabular for...graph2tab, a library to convert experimental workflow graphs into tabular for...
graph2tab, a library to convert experimental workflow graphs into tabular for...
 
Interoperable Open Data: Which Recipes?
Interoperable Open Data: Which Recipes?Interoperable Open Data: Which Recipes?
Interoperable Open Data: Which Recipes?
 
Linked Data with the EBI RDF Platform
Linked Data with the EBI RDF PlatformLinked Data with the EBI RDF Platform
Linked Data with the EBI RDF Platform
 
BioSD Linked Data: Lessons Learned
BioSD Linked Data: Lessons LearnedBioSD Linked Data: Lessons Learned
BioSD Linked Data: Lessons Learned
 
BioSD Tutorial 2014 Editition
BioSD Tutorial 2014 EdititionBioSD Tutorial 2014 Editition
BioSD Tutorial 2014 Editition
 
myEquivalents, aka a new cross-reference service
myEquivalents, aka a new cross-reference servicemyEquivalents, aka a new cross-reference service
myEquivalents, aka a new cross-reference service
 
Dev 2014 LOD tutorial
Dev 2014 LOD tutorialDev 2014 LOD tutorial
Dev 2014 LOD tutorial
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Continuos Integration @Knetminer

  • 1. Marco Brandizi <marco.brandizi@rothamsted.ac.uk> 30/4/2021 Continuos Integration @Knetminer Find this presentation on SlidesShare Background source: https://tinyurl.com/ydq2e6xn
  • 2. What's Continuous Integration, by the way? Image source: https://pt.slideshare.net/thyagk/continuous-integration-system/3
  • 3. Typical CI build workflow 1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP 2. Get and set variables (eg, github and Nexus credentials) 3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user) 4. "mvn deploy", or "mvn install" 1. depending on conditions (eg, if we're in the master branch and not in a pull request) 5. Are we releasing? 1. Tag github with new version and git-commit 2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user) 6. Local git commits (eg, because of POM's new versions and tagging)? => git push
  • 4. Our (and not only) Issues 1. Pre-check if build is needed 2. Settings 3. Pre-build Release ops 4. Maven (includes deployment) 5. Post-build release ops 6. Git Push • Pretty much the same for all Java/Maven projects • Copy-pasting is hard to maintain • Can't we factorise?
  • 5. Our (and not only) Issues • CIs in my past five years: • Until 2016: Bamboo • 2017-2021: Jenkins • 2018-2020: Travis • 2020-2021: GitHub Actions • 2022 Yet another one?! • Every time: • New system to learn • New syntax to describe CI jobs to learn • Migrating previous jobs and test • Migrating settings (eg, credentials) • Can't we make it portable? • (At least a little more?)
  • 7. Just plug-in in your CI 1. Pre-check if build is needed 2. Settings 3. Pre-build Release ops 4. Maven (includes deployment) 5. Post-build release ops 6. Git Push Your CI job (see archetype-resources/.github/workflows/build.yml) mkdir -p ci-build <Download install.sh> ./ci-build/install.sh # was downloaded together with others (eg, maven-settings.xml) ./ci-build/build.sh
  • 9. Customisation 1. Pre-check if build is needed 2. Settings 3. Pre-build Release ops 4. Maven (includes deployment) 5. Post-build release ops 6. Git Push • Uhm... aren't you throwing your CI workflow at me? • I've had the problem myself • Solution: script hooks
  • 10. Customisation with script hooks 1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP 2. Get and set variables (eg, github and Nexus credentials) build-begin.sh 3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user) 4. build-before.sh ( "mvn deploy", or "mvn install" ) OR build-body.sh build-after.sh 5. Are we releasing? 1. Tag github with new version and git-commit 2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user) 6. Local git commits (eg, because of POM's new versions and tagging)? => git push build-end.sh
  • 11. Customisation with script hooks Your CI job 1. Download 2. Run 1. Pre-check if build is needed 2. Settings build-begin.sh 3. Pre-build Release ops 4. build-before.sh Maven (includes deployment) OR build-body.sh build-after.sh 5. Post-build release ops 6. Git Push build-end.sh Just add your hooks as needed 1. to <your-repo>/ci-build/ 2. Only the ones you need 3. They see build variables (eg, IS_RELEASE, NEW_RELEASE_VER) 4. They can expose their own variables (eg, for the next hook) 1. Or change existing ones (be careful)
  • 12. Need an example? https://github.com/Rothamsted/knetminer/tree/master/ci-build • You'll see customisations for: • Settings custom variables (docker_tag) • Build on top of our own Docker-based environment, instead of GH Actions environment • Much more portable • post-build actions to push new Docker images (including release images) • Invocation of Jenkins API to trigger internal deployment jobs (which redeploy from the new Docker images)
  • 13. Final notes • build.sh isn't the bible, we can change/improve as we need, eg • more hooks • See if it can be adapted to other languages (eg, Python) or a new one is needed • DO NOT copy it locally just because it doesn't fit your needs, try to reuse stuff! • Please let me know about proposed/made changes • Are there alternatives? => https://github.com/rosineygp/mkdkr • + Entirely based on Docker + Make, more portable • - Not sure using Docker even for the simplest builds is worth • - I know Make very little, not sure I want to depend on it • ~ Requires some CI configuration anyway (eg, to set up credentials and alike, should be solved with a credential manager) • - Presumably, would require volume mapping to manage the cache (and cache configuration at CI level)