forked from MichaelCade/90DaysOfDevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,265 changed files
with
31,042 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM busybox:latest | ||
ENV PORT=8000 | ||
|
||
ADD index.html /www/index.html | ||
|
||
# EXPOSE $PORT | ||
|
||
HEALTHCHECK .mdnc -z localhost $PORT | ||
|
||
# Create a basic webserver and run it until the container is stopped | ||
.mdecho "httpd started" && trap "exit 0;" TERM INT; httpd -v -p $PORT -h /www -f & wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
podTemplate(yaml: ''' | ||
apiVersion: v1 | ||
kind: Pod | ||
spec: | ||
containers: | ||
- name: maven | ||
image: maven:3.8.1-jdk-8 | ||
command: | ||
- sleep | ||
args: | ||
- 99d | ||
- name: kaniko | ||
image: gcr.io/kaniko-project/executor:debug | ||
command: | ||
- sleep | ||
args: | ||
- 9999999 | ||
volumeMounts: | ||
- name: kaniko-secret | ||
mountPath: /kaniko/.docker | ||
restartPolicy: Never | ||
volumes: | ||
- name: kaniko-secret | ||
secret: | ||
secretName: dockercred | ||
items: | ||
- key: .dockerconfigjson | ||
path: config.json | ||
''') { | ||
node(POD_LABEL) { | ||
stage('Clone Repository') { | ||
git url: 'https://github.com/MichaelCade/Jenkins-HelloWorld.git', branch: 'main' | ||
container('maven') { | ||
stage('Build Image') { | ||
sh ''' | ||
echo "Tests passed" | ||
''' | ||
} | ||
} | ||
} | ||
|
||
stage('Test Image') { | ||
container('kaniko') { | ||
stage('Build Hello World App') { | ||
sh ''' | ||
/kaniko/executor --context `pwd` --destination michaelcade1/helloworld:1.0 | ||
''' | ||
} | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<pre> | ||
Hello World! | ||
</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: jenkins | ||
namespace: jenkins | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
annotations: | ||
rbac.authorization.kubernetes.io/autoupdate: "true" | ||
labels: | ||
kubernetes.io/bootstrapping: rbac-defaults | ||
name: jenkins | ||
rules: | ||
- apiGroups: | ||
- '*' | ||
resources: | ||
- statefulsets | ||
- services | ||
- replicationcontrollers | ||
- replicasets | ||
- podtemplates | ||
- podsecuritypolicies | ||
- pods | ||
- pods/log | ||
- pods/exec | ||
- podpreset | ||
- poddisruptionbudget | ||
- persistentvolumes | ||
- persistentvolumeclaims | ||
- jobs | ||
- endpoints | ||
- deployments | ||
- deployments/scale | ||
- daemonsets | ||
- cronjobs | ||
- configmaps | ||
- namespaces | ||
- events | ||
- secrets | ||
verbs: | ||
- create | ||
- get | ||
- watch | ||
- delete | ||
- list | ||
- patch | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- update | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
annotations: | ||
rbac.authorization.kubernetes.io/autoupdate: "true" | ||
labels: | ||
kubernetes.io/bootstrapping: rbac-defaults | ||
name: jenkins | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: jenkins | ||
subjects: | ||
- apiGroup: rbac.authorization.k8s.io | ||
kind: Group | ||
name: system:serviceaccounts:jenkins |
Oops, something went wrong.