Skip to content

Commit

Permalink
Automated website deployment
Browse files Browse the repository at this point in the history
Signed-Off-By: Parth <[email protected]>
  • Loading branch information
parthyadav3105 committed Feb 23, 2020
1 parent 010c159 commit 09677e3
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 3 deletions.
6 changes: 6 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
for imagename in $(docker images --format {{.Repository}} | grep webhunt/)
do
url=${imagename##*/}
helm install $url webhunt-charts/ --set url=$url
done
5 changes: 2 additions & 3 deletions playbook.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

# build all docker images
- hosts: build_machine
remote_user: root
vars:
- target_dir: riddles
- target_dir: riddles
roles:
- {role: build_images}
- {role: deploy_websites}
Binary file added webhunt-charts/.Chart.yaml.swp
Binary file not shown.
23 changes: 23 additions & 0 deletions webhunt-charts/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
21 changes: 21 additions & 0 deletions webhunt-charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v2
name: webhunt-charts
description: A Helm chart for Web Hunt

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.16.0
22 changes: 22 additions & 0 deletions webhunt-charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{.Values.url}}-deployment
labels:
website: {{.Values.url}}
spec:
replicas: 1
selector:
matchLabels:
website: {{.Values.url}}
template:
metadata:
labels:
website: {{.Values.url}}
spec:
containers:
- name: {{.Values.url}}
image: webhunt/{{.Values.url}}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
9 changes: 9 additions & 0 deletions webhunt-charts/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{.Values.url}}
spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
2 changes: 2 additions & 0 deletions webhunt-charts/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
url: no-url

0 comments on commit 09677e3

Please sign in to comment.