Setting up a Jenkinsfile to tar and commit a repo to S3

Notes on Jenkinsfile‘s

agenttells Jenkins to allocate an executor and workspace for the Pipeline.

More here:

https://jenkins.io/doc/book/pipeline/jenkinsfile/

First draft:

This creates Build, Test and Deploy stages.

 

Jenkins: Blue Ocean

Return to standard Jenkins interface – click on Administration button at top.

Notes: it’s not obvious how to Fetch from Git and Rebuild via Blue Ocean.

E.g.

http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-3.56.25-PM-300x115.png 300w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-3.56.25-PM-768x294.png 768w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-3.56.25-PM-588x225.png 588w" sizes="(max-width: 474px) 100vw, 474px" />

the circular icons to the right just rebuild the currently checked out code. See the Replayed entries (i.e. it uses the same commit as last time).

In Classic you have the Schedule a Scan button which does a rebuild (i.e. it takes the current commit in Github). See on the right here:

http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-3.56.59-PM-300x115.png 300w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-3.56.59-PM-768x295.png 768w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-3.56.59-PM-588x226.png 588w" sizes="(max-width: 474px) 100vw, 474px" />

The button says Scan scheduled and a job appears in Build Executor Status saying:

Building pipeline » Scan Repository

Oddly, this doesn’t happen immediately even on my instance where there are no other jobs running. It also seems a little intermittent. E.g. a few more clicks later sometimes trigger the job.

If there are no Github updates you get a Branch indexing in Blue Ocean.

 

In Blue Ocean you can do a Rebuild by going to the branch, hover over the row and a new Run icon should appear to the right

http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-4.47.05-PM-300x74.png 300w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-4.47.05-PM-768x189.png 768w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-4.47.05-PM-588x145.png 588w, http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-28-at-4.47.05-PM.png 1062w" sizes="(max-width: 474px) 100vw, 474px" />

which, for maximum confusion, hides itself when your mouse is not near.