mirror of
https://github.com/ghndrx/docker-test-image.git
synced 2026-02-10 14:55:14 +00:00
revamp static content.
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -2,7 +2,6 @@ pipeline {
|
|||||||
agent any
|
agent any
|
||||||
environment {
|
environment {
|
||||||
DOCKERHUB_CREDENTIALS=credentials('dockerhub-cred')
|
DOCKERHUB_CREDENTIALS=credentials('dockerhub-cred')
|
||||||
SSH_CREDENTIALS=credentials('ssh-cred')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Greg Test</title>
|
<title>Latest Commit</title>
|
||||||
</head>
|
<link rel="stylesheet" href="styles.css">
|
||||||
<div>
|
</head>
|
||||||
Hello World! I was built with jenkins! This is just an extension of content at this point
|
<body>
|
||||||
</div>
|
<div class="container">
|
||||||
|
<h1>Latest Commit</h1>
|
||||||
|
<div id="commit-info"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
24
static-html-directory/script.js
Normal file
24
static-html-directory/script.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
const commitInfoElement = document.getElementById('commit-info');
|
||||||
|
|
||||||
|
fetch('https://api.github.com/repos/ghndrx/docker-test-image/commits')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
if (data.length > 0) {
|
||||||
|
const latestCommit = data[0];
|
||||||
|
const commitMessage = latestCommit.commit.message;
|
||||||
|
const commitAuthor = latestCommit.commit.author.name;
|
||||||
|
const commitDate = new Date(latestCommit.commit.author.date).toLocaleString();
|
||||||
|
|
||||||
|
commitInfoElement.innerHTML = `
|
||||||
|
<p><strong>Message:</strong> ${commitMessage}</p>
|
||||||
|
<p><strong>Author:</strong> ${commitAuthor}</p>
|
||||||
|
<p><strong>Date:</strong> ${commitDate}</p>
|
||||||
|
`;
|
||||||
|
} else {
|
||||||
|
commitInfoElement.innerHTML = '<p>No commits found.</p>';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
commitInfoElement.innerHTML = '<p>Error loading commit information.</p>';
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
27
static-html-directory/styles.css
Normal file
27
static-html-directory/styles.css
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #f3f3f3;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#commit-info {
|
||||||
|
margin-top: 20px;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user