Skip to content

Commit

Permalink
update structure and adds new configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Salih Bozkaya authored and Salih Bozkaya committed Dec 4, 2024
1 parent fb62b4e commit 4d59588
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 6 deletions.
4 changes: 0 additions & 4 deletions argocd_1/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ metadata:
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io

spec:
project: default

source:
repoURL: https://github.com/rsship/argomaton.git
targetRevision: HEAD
path: myapp

destination:
server: https://kubernetes.default.svc

syncPolicy:
automated:
prune: true
Expand Down
26 changes: 26 additions & 0 deletions envs/staging/apps/myapp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp-staging
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/rsship/argomaton.git
targetRevision: HEAD
path: envs/staging/myapp
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- Validate=true
- CreateNamespace=false
- PrunePropagationPolicy=foreground
- PruneLast=true
26 changes: 26 additions & 0 deletions envs/staging/apps/secondapp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: secondapp-production
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/rsship/argomaton.git
targetRevision: HEAD
path: envs/staging/second-app
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- Validate=true
- CreateNamespace=false
- PrunePropagationPolicy=foreground
- PruneLast=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: foo
name: staging
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: foo
namespace: staging
labels:
app: nginx
spec:
Expand Down
5 changes: 5 additions & 0 deletions envs/staging/second-app/0-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: production
23 changes: 23 additions & 0 deletions envs/staging/second-app/1-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: production
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: salihbozkaya1001/nginx:0.0.2
ports:
- containerPort: 80
26 changes: 26 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

set -xe

new_ver=$1

echo "New version $1"

docker tag nginx salihbozkaya1001/nginx:$new_ver

docker push salihbozkaya1001/nginx:$new_ver

tmp_dir=$(mktemp -d)
echo $tmp_dir

git clone git@github.com:rsship/argomaton.git $tmp_dir

sed -i '' -e "s/salihbozkaya1001\/nginx:.*/salihbozkaya1001\/nginx:$new_ver/g" $tmp_dir/myapp/1-deployment.yaml

cd $tmp_dir
git add .
git commit -m "Update Image $new_ver"
git push

rm -rf $tmp_dir

0 comments on commit 4d59588

Please sign in to comment.