Initial commit

This commit is contained in:
Benjamin Muschko
2019-11-17 16:40:48 -07:00
commit 248499c8f6
108 changed files with 994 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# Exercise 7
You will enhance the existing job to generate a JAR file and store it on Jenkins. The job should record the MD5 hash for the artifact. Later, you will configure a downstream job that should be able to reuse the existing artifact.
## Storing and Fingerprinting Artifacts
1. Create a post-build action for archiving JAR files with the pattern `build/libs/*.jar`. Enable the fingerprinting option.
2. Execute the build. The build should list the artifact `gradle-initializr-1.0.0.jar`.
3. Have a look at the recorded fingerprints of this build.
4. Render the MD5 hash of the artifact and the usage of the artifact.
5. Install the Copy Artifacts plugin.
6. Create a downstream job named `consumer`.
7. Configure the downstream job to use the artifact produced by the upstream job.
8. Run the the build for the job `gradle-initializr`.
9. Have a look at the fingerprints of the downstream job.

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 KiB

View File

@@ -0,0 +1,29 @@
# Solution
In the job configuration, archive the artifact produced by the build. Check the box for generating fingerprints.
![Archive Artifacts](./images/archive-artifacts.png)
Execute the build and find the archived artifact.
![Archived Artifact](./images/build-artifact.png)
Have a look at the details of the fingerprinting.
![Fingerprint Details](./images/fingerprint-details.png)
Install the Copy Artifacts plugin.
![Copy Artifacts Plugin](./images/copy-artifacts-plugin.png)
Trigger the downstream job upon success.
![Trigger Downstream](./images/trigger-upstream.png)
Copy artifacts from the upstream job.
![Copy Artifact From Upstream](./images/copy-artifacts.png)
You can see the full usage of the artifact in upstream and downstream jobs.
![Fingerprint Usage](./images/fingerprints-upstream.png)