Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
325 commits
Select commit Hold shift + click to select a range
f239454
fixed the if condition from main to master
pkatira Aug 22, 2021
478ba17
Merge branch 'master' of https://github.com/piyush7/workshop-hello-gi…
pkatira Aug 22, 2021
3d7583a
Bump docker tag
actions-user Aug 22, 2021
5c6d80f
checkov warnings
pkatira Aug 22, 2021
385b1f8
Merge branch 'master' of https://github.com/piyush7/workshop-hello-gi…
pkatira Aug 22, 2021
2f9c194
Bump docker tag
actions-user Aug 22, 2021
6fe4f5b
checkov warnings
pkatira Aug 22, 2021
7a21c35
Merge branch 'master' of https://github.com/piyush7/workshop-hello-gi…
pkatira Aug 22, 2021
f0f0d94
Bump docker tag
actions-user Aug 22, 2021
54c7d1d
minor changes
pkatira Aug 22, 2021
de4ad32
minor changes
pkatira Aug 22, 2021
c463643
Bump docker tag
actions-user Aug 22, 2021
3e24b47
some minor changes
pkatira Aug 22, 2021
8b0b6b0
Some more minor Changes
pkatira Aug 22, 2021
08e4479
Bump docker tag
actions-user Aug 22, 2021
1af093c
minor changes to app.yaml
pkatira Aug 22, 2021
bb44e97
minor changes to app.yaml
pkatira Aug 22, 2021
e9b9316
minor changes to app.yaml
pkatira Aug 22, 2021
b36f989
minor changes to deployment.yaml
pkatira Aug 22, 2021
21d3c3e
minor changes to deployment.yaml to fix annotations
pkatira Aug 22, 2021
74362fb
minor changes to deployment.yaml to fix annotations
pkatira Aug 22, 2021
290ba23
minor changes to deployment.yaml to fix annotations
pkatira Aug 22, 2021
e160dfd
Bump docker tag
actions-user Aug 22, 2021
ebc85d6
added vault integration
pkatira Aug 23, 2021
be0eef7
added vault integration
pkatira Aug 23, 2021
36d2066
changed vault token secret
pkatira Aug 23, 2021
a0bd9a9
changed vault step
pkatira Aug 23, 2021
fb1b209
changed tlskskipverify to true
pkatira Aug 23, 2021
7bdc931
added a path to vault action
pkatira Aug 23, 2021
cfe598e
added a path to vault action
pkatira Aug 23, 2021
4dd2829
added a path to vault action
pkatira Aug 23, 2021
0d7e4d2
added manual procedure to retrieve vault token
pkatira Aug 23, 2021
54c7f15
added manual procedure to retrieve vault token
pkatira Aug 23, 2021
7ed2bfb
added manual procedure to retrieve vault token with curl
pkatira Aug 23, 2021
eab4596
added manual procedure to retrieve vault token with curl
pkatira Aug 23, 2021
21cd733
added manual procedure to retrieve vault token with curl
pkatira Aug 23, 2021
52ca99a
added manual procedure to retrieve vault token with curl
pkatira Aug 23, 2021
2466eaa
added manual procedure to retrieve vault token with curl
pkatira Aug 23, 2021
b1aad9e
added manual procedure to retrieve vault token with curl
pkatira Aug 23, 2021
ea190ed
added -r output to jq
pkatira Aug 23, 2021
daed871
Bump docker tag
actions-user Aug 23, 2021
6b51482
minor changes
pkatira Aug 23, 2021
f4917f6
minor changes to pipeline
pkatira Aug 23, 2021
4bd92a3
minor changes
pkatira Aug 23, 2021
cf3975e
minor changes
pkatira Aug 23, 2021
8eb2790
Bump docker tag
actions-user Aug 23, 2021
0c5eb74
Merge branch 'master' into development
piyush7 Aug 23, 2021
e7f73ad
commented out checkov
pkatira Aug 23, 2021
4fdeb9f
commented out checkov
pkatira Aug 23, 2021
dbf58e4
Merge pull request #2 from piyush7/development
piyush7 Aug 23, 2021
f2c3f26
Bump docker tag
actions-user Aug 23, 2021
639c1bb
commented out checkov
pkatira Aug 23, 2021
f942da0
commented out checkov
pkatira Aug 23, 2021
dd72581
Bump docker tag
actions-user Aug 23, 2021
add4a46
commented out checkov
pkatira Aug 23, 2021
31c7b90
commented out checkov
pkatira Aug 23, 2021
3518747
Bump docker tag
actions-user Aug 23, 2021
750de2a
made changes to kustomization.yaml
pkatira Aug 23, 2021
35c7611
made changes to kustomization.yaml
pkatira Aug 23, 2021
18bc0d9
Bump docker tag
actions-user Aug 23, 2021
04ef1f8
renamed the workflow file
pkatira Aug 23, 2021
39e5d48
Bump docker tag
actions-user Aug 23, 2021
c8d6cc6
minor changes to workflow file
pkatira Aug 23, 2021
ec3fe30
minor changes to workflow file
pkatira Aug 23, 2021
4524ebb
Bump docker tag
actions-user Aug 23, 2021
6d28968
minor changes to workflow file
pkatira Aug 23, 2021
8903055
minor changes
pkatira Aug 23, 2021
2ced92a
Bump docker tag
actions-user Aug 23, 2021
9f96715
minor changes to workflow file
pkatira Aug 23, 2021
9c903ce
minor changes
pkatira Aug 23, 2021
9fd2b88
Bump docker tag 9c903ce08e03dfcc602825d5b24657c77db3b9f1
actions-user Aug 23, 2021
62a60da
minor change
pkatira Aug 23, 2021
49493eb
minor changes
pkatira Aug 23, 2021
4364c42
Bump docker tag 49493eb8651a43ab6784d1c2d7270cf2d7199391
actions-user Aug 23, 2021
95f8634
added lint step
pkatira Aug 23, 2021
a3c8f17
minor step to add lint
pkatira Aug 23, 2021
40c9024
added lint step
pkatira Aug 23, 2021
974f53d
added lint step
pkatira Aug 23, 2021
75b57c5
added lint step
pkatira Aug 23, 2021
ad68a78
Bump docker tag 75b57c5595d7d747def8b9d1330f1efa1bfc2e20
actions-user Aug 23, 2021
aadaa84
application name change
pkatira Aug 23, 2021
38381e4
namespace change
pkatira Aug 23, 2021
7d6d373
namespace change
pkatira Aug 23, 2021
92156f5
namespace change
pkatira Aug 23, 2021
cd20042
namespace change
pkatira Aug 23, 2021
3c6c740
message change
pkatira Aug 23, 2021
df16a83
minor change to the argo application
pkatira Aug 23, 2021
7e20e1b
minor change to the argo application
pkatira Aug 23, 2021
a8a901e
message change in master branch
pkatira Aug 24, 2021
88dd9bd
message change in master branch
pkatira Aug 24, 2021
91e848a
Bump docker tag 88dd9bdd7ceb926cc9c05d302456e063f7ba46ab
actions-user Aug 24, 2021
98c34db
changes to the pipeline.yaml
pkatira Aug 24, 2021
f5da214
commented out checkov in dev branch
pkatira Aug 24, 2021
dc85829
Bump docker tag
actions-user Aug 24, 2021
1aefae1
fixed the conflicts
pkatira Aug 24, 2021
fbf0dc8
fixed the conflicts
pkatira Aug 24, 2021
045d296
Bump docker tag
actions-user Aug 24, 2021
3652e0f
Merge branch 'master' into development
piyush7 Aug 24, 2021
34f53ef
Merge pull request #3 from piyush7/development
piyush7 Aug 24, 2021
0be845d
Bump docker tag
actions-user Aug 24, 2021
f3d4413
modified the tags
pkatira Aug 24, 2021
f4eeda7
made changes to the code
pkatira Aug 24, 2021
1afc426
Bump docker tag
actions-user Aug 24, 2021
86b3765
made changes to the code
pkatira Aug 24, 2021
32ab640
made changes to the code
pkatira Aug 24, 2021
367e6d5
Bump docker tag
actions-user Aug 24, 2021
a2348c7
made changes to the code
pkatira Aug 24, 2021
7b5a215
made changes to the code
pkatira Aug 24, 2021
025981d
Bump docker tag
actions-user Aug 24, 2021
15209d7
made changes to the tag
pkatira Aug 24, 2021
773011c
Merge branch 'development' of https://github.com/piyush7/workshop-hel…
pkatira Aug 24, 2021
3fc0621
Bump docker tag
actions-user Aug 24, 2021
39aca1b
commented out lint
pkatira Aug 24, 2021
227f1d1
commented out lint
pkatira Aug 24, 2021
ae5a103
commented out lint
pkatira Aug 24, 2021
3584da4
Bump docker tag
actions-user Aug 24, 2021
a590790
Merge pull request #4 from piyush7/development
piyush7 Aug 24, 2021
1d371bd
made a minor change to the deploy-prod step
pkatira Aug 24, 2021
b89b496
made a minor change to the deploy-prod step
pkatira Aug 24, 2021
afb6202
Bump docker tag
actions-user Aug 24, 2021
9ff4369
Merge pull request #5 from piyush7/development
piyush7 Aug 24, 2021
297dc76
changes to deploy prod step
pkatira Aug 24, 2021
a7ce36d
changes to deploy prod step
pkatira Aug 24, 2021
a738ddb
Bump docker tag
actions-user Aug 24, 2021
9c7603d
Merge pull request #6 from piyush7/development
piyush7 Aug 24, 2021
1e09347
changes to deploy prod step including sed fix and needs step
pkatira Aug 24, 2021
21b13bd
changes to deploy-prod step and needs step
pkatira Aug 24, 2021
343b2e1
Bump docker tag
actions-user Aug 24, 2021
2e53b6a
Merge pull request #7 from piyush7/development
piyush7 Aug 24, 2021
c83ae53
Bump docker tag 2e53b6a3719bcdb9fb4d2caa7208486b69d034df
actions-user Aug 24, 2021
e2e8deb
changes to deploy prod step adding one more sed
pkatira Aug 24, 2021
fbedaaf
added one more sed
pkatira Aug 24, 2021
cf9cbbb
Bump docker tag
actions-user Aug 24, 2021
ad059a9
Merge branch 'master' into development
piyush7 Aug 24, 2021
55b1102
Merge pull request #8 from piyush7/development
piyush7 Aug 24, 2021
9c2d21b
Bump docker tag 55b1102a41887594ef2c534e86675d63982a5e1b
actions-user Aug 24, 2021
066a7ed
changes to app name
pkatira Aug 24, 2021
d170130
Bump docker tag
actions-user Aug 24, 2021
7219331
changes to workflow file
pkatira Aug 24, 2021
46f8ce8
changes to workflow file
pkatira Aug 24, 2021
6f9c850
Bump docker tag
actions-user Aug 24, 2021
8897c73
Merge branch 'master' into development
piyush7 Aug 24, 2021
66a0162
Merge pull request #9 from piyush7/development
piyush7 Aug 24, 2021
ba55675
Bump docker tag 66a01620ebe53a32a0457d74528bb4f24285ddec
actions-user Aug 24, 2021
2e2f66a
Bump docker tag
actions-user Aug 24, 2021
b797968
major changes to push command
pkatira Aug 24, 2021
afdd4b8
Bump docker tag
actions-user Aug 24, 2021
b047d84
Update hello-world.yaml
piyush7 Aug 24, 2021
9d36955
Bump docker tag
actions-user Aug 24, 2021
56df239
Merge branch 'master' into development
piyush7 Aug 24, 2021
ea3543a
Bump docker tag
actions-user Aug 24, 2021
ecc18c5
minor changes
pkatira Aug 24, 2021
f758647
Merge branch 'development' of https://github.com/piyush7/workshop-hel…
pkatira Aug 24, 2021
781d0f5
Bump docker tag
actions-user Aug 24, 2021
7cd5b75
Update hello-world.yaml
piyush7 Aug 24, 2021
473f861
Bump docker tag 7cd5b759f0f1f968b21da8687de9a707c52cb664
actions-user Aug 24, 2021
1043136
change in message
pkatira Aug 24, 2021
14ee89d
Bump docker tag
actions-user Aug 24, 2021
d5dd285
Merge branch 'master' into development
piyush7 Aug 24, 2021
111643f
Merge pull request #11 from piyush7/development
piyush7 Aug 24, 2021
1014fbd
Bump docker tag
actions-user Aug 24, 2021
bc4f0fd
Bump docker tag 111643f5a30f220ce460fba9beba2e6e65138733
actions-user Aug 24, 2021
9a6888b
changed the messge
pkatira Aug 28, 2021
58e7369
changed msg
pkatira Aug 28, 2021
e871faa
Bump docker tag
actions-user Aug 28, 2021
d582c17
Merge branch 'master' into development
piyush7 Aug 28, 2021
a92343d
Merge pull request #12 from piyush7/development
piyush7 Aug 28, 2021
86e1704
Bump docker tag a92343da69c3155d558c2060c71585a6c918cc7d
actions-user Aug 28, 2021
845c2ea
Bump docker tag
actions-user Aug 28, 2021
e2062ab
added image scan
pkatira Aug 28, 2021
cfd8c8b
updated alpine image in dockerFile
pkatira Aug 28, 2021
6e12b02
Bump docker tag
actions-user Aug 28, 2021
d0a44a0
added image scan
pkatira Aug 28, 2021
161653b
minor changes
pkatira Aug 28, 2021
6e2b298
Bump docker tag
actions-user Aug 28, 2021
f116f43
changed a step name and uncommented checkov
pkatira Aug 28, 2021
dfcea27
changed a step name and uncommented checkov
pkatira Aug 28, 2021
73c5de6
changed a step name and uncommented checkov
pkatira Aug 28, 2021
b687f40
Bump docker tag
actions-user Aug 28, 2021
e8d8611
made changes to the deployment yaml
pkatira Aug 28, 2021
b280454
made changes to the deployment yaml
pkatira Aug 28, 2021
f367eb1
made changes to the deploy.yaml
pkatira Aug 28, 2021
d52e104
Image version: f367eb103c63ba946cc98d7d1bb67a7bdb607a58
actions-user Aug 28, 2021
481a9aa
minor changes to deployment.yaml
pkatira Aug 28, 2021
a8944ff
Image version: 481a9aa26e82264471945e92ae36e75b0a587abc
actions-user Aug 28, 2021
be048ad
changed rootonlyFS
pkatira Aug 28, 2021
6bece76
changed rootonlyFS
pkatira Aug 28, 2021
f959763
Image version: 6bece76a82122a8c4cd8d23406cbe7353bdc374f
actions-user Aug 28, 2021
9174248
changed rootonlyFS
pkatira Aug 28, 2021
692ba5a
Image version: 9174248f944fe7fe5ace0512d420e49a3a158ad9
actions-user Aug 28, 2021
fa6583f
commented out resources
pkatira Aug 28, 2021
b71f399
commented out resources
pkatira Aug 28, 2021
d1106ca
commented out checkkov
pkatira Aug 28, 2021
2007dbd
Image version: d1106ca317828d3ace36ad3b82e8fd86a95b4d50
actions-user Aug 28, 2021
83653de
uncommented resources section
pkatira Aug 28, 2021
e4c0982
Image version: 83653debbe2e5e97c4bc98ca1fcfc82e4b998c13
actions-user Aug 28, 2021
acab06e
minor changes
pkatira Aug 28, 2021
9e1c5e0
liveness probe added
pkatira Aug 28, 2021
e2c0c55
readiness probe added
pkatira Aug 28, 2021
0075a29
drop and net raw capabilities removed
pkatira Aug 28, 2021
6fe5b49
Image version: 0075a291a564fa8f2f43d179b3dfc8b19e9fd037
actions-user Aug 28, 2021
9fa490a
Merge branch 'master' into development
piyush7 Aug 28, 2021
7175a2d
Image version: 9fa490a4d2db68b90291ab493db8061a7083fea8
actions-user Aug 28, 2021
f5a420d
Merge pull request #13 from piyush7/development
piyush7 Aug 28, 2021
97d8c04
checkov changes to deploy-prod step
pkatira Aug 28, 2021
5667bf4
checkov changes to deploy prod step
pkatira Aug 28, 2021
9ed017c
Image version: 5667bf493485f9be1b9d53047096164effc8bf03
actions-user Aug 28, 2021
aef1920
Merge pull request #14 from piyush7/development
piyush7 Aug 28, 2021
edb5cf5
Image version: aef1920d5e593690d48d42b4447356aa916f8710
actions-user Aug 28, 2021
c76b767
changed message
pkatira Aug 28, 2021
2f1fc2f
alpine version
pkatira Aug 28, 2021
613e542
Image version: 2f1fc2fe3bc706bf48823deb3f17b31735b6a366
actions-user Aug 28, 2021
0bcb14f
Merge branch 'master' into development
piyush7 Aug 28, 2021
75a9ee1
Merge pull request #15 from piyush7/development
piyush7 Aug 28, 2021
c4151c3
Image version: 0bcb14f0af81abe2ed4981fe0a7292511b1d9b4a
actions-user Aug 28, 2021
ec2b820
Image version: 75a9ee12480e2f6836eab50e6ee5aea81a9c637d
actions-user Aug 28, 2021
257da60
changed message
pkatira Aug 28, 2021
c294a80
changed the pod message
pkatira Aug 28, 2021
02781cf
Image version: c294a8087c57fc922274c2fa28f421ff748de85f
actions-user Aug 28, 2021
4655005
Merge branch 'master' into development
piyush7 Aug 28, 2021
8a3e01d
Image version: 46550054edf198abb0bc4b7119e0344d4e2f3f12
actions-user Aug 28, 2021
4fed181
Development (#16)
piyush7 Aug 28, 2021
5e41930
Image version: 4fed1814386bf671622040fbca92b90e062e2450
actions-user Aug 28, 2021
62457d7
changed hello-world.yaml
pkatira Aug 28, 2021
2ee4fa0
changed hello-world.yaml
pkatira Aug 28, 2021
a7ef75c
Image version: 2ee4fa06369fcaa8305e5df68d697c5d60f4a7bd
actions-user Aug 28, 2021
71575e2
changed msg
pkatira Aug 28, 2021
6f675b9
changed msg
pkatira Aug 28, 2021
0ac6262
Image version: 6f675b928b0a9306e10106d1d6aab30617cdcdd1
actions-user Aug 28, 2021
c90e665
Merge branch 'master' into development
piyush7 Aug 28, 2021
9608443
Development (#17)
piyush7 Aug 28, 2021
1b13068
Image version: c90e66595d326238550f030fa6a3033078a80cf8
actions-user Aug 28, 2021
b5c3634
Image version: 9608443a80897d1afbe5d3b005d21f374ecf3e4d
actions-user Aug 28, 2021
9e27e9d
made changes to the pod message
pkatira Aug 31, 2021
56548d8
Image version: 9e27e9d6a4ddccca528ba5cb4eb9b0ea52f23edf
actions-user Aug 31, 2021
9d0f543
Merge branch 'master' into development
piyush7 Aug 31, 2021
ecb9147
changed the pod message (#18)
piyush7 Aug 31, 2021
1f97559
Image version: 9d0f543f5497ce4a9289f57767f5086054d6479b
actions-user Aug 31, 2021
a2592ab
Image version: ecb9147145c0bf2d65277acf166aa5d676560ca1
actions-user Aug 31, 2021
1833703
made changes to the pod messaging
pkatira Sep 1, 2021
58e4e89
made changes to the pod messaging
pkatira Sep 1, 2021
60d32ce
Image version: 58e4e89a9205f4334b4227ac0106ea28c5cd040c
actions-user Sep 1, 2021
212c0a3
made changes to the pod message and test.go
pkatira Sep 1, 2021
07604e4
made changes to pod message and test.go
pkatira Sep 1, 2021
e179dab
Image version: 07604e449e2d3a40dfe2f3a280671fb1ae271a3d
actions-user Sep 1, 2021
63c3e19
Merge branch 'master' into development
piyush7 Sep 1, 2021
4e6e3c3
Image version: 63c3e19b7dfd1ea3287ab16ed63be630ccf0a3bd
actions-user Sep 1, 2021
a2d533e
made change to the pod message
pkatira Sep 1, 2021
c3ec201
made change to the pod message again
pkatira Sep 1, 2021
aa170f3
Image version: c3ec2010f46b2d4173a5e64492aa0519b3902ec3
actions-user Sep 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/linters/.shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC2086
64 changes: 0 additions & 64 deletions .github/workflows/go.yml

This file was deleted.

203 changes: 203 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
name: Go

on:
push:
branches: [ '*' ]

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14

- name: Check out code
uses: actions/checkout@v2

- name: Check Path
run: echo $PATH

lint:
name: lint
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Lint Code Base
uses: github/super-linter@v4
env:
DEFAULT_BRANCH: master
VALIDATE_KUBERNETES_KUBEVAL: false
# VALIDATE_JSCPD: false
VALIDATE_MARKDOWN: false
VALIDATE_GO: false
GITHUB_TOKEN: ${{secrets.secret_token}}
SHELLCHECK_OPTS: "-e SC2086 -e SC2046"

# GOENV: "/home/runner/.config/go/env"
# GOROOT: "/opt/hostedtoolcache/go/1.16.7/x64"

# - name: lint
# uses: golangci/golangci-lint-action@v2
# with:
# skip-go-installation: true
# github-token: ${{secrets.secret_token}}
# only-new-issues: false
# skip-pkg-cache: true
# skip-build-cache: true

push:
name: push-scan
runs-on: ubuntu-latest
needs: [build,lint]
steps:
# - name: Import Secrets
# uses: hashicorp/[email protected]
# with:
# url: https://vault-cluster.vault.52a7c979-da4b-40f2-94d6-7d4c5ead3d3a.aws.hashicorp.cloud:8200
# token: ${{ secrets.VAULT_TOKEN }}
# #path: vmware-demo
# secrets: |
# secret/vmware-demo/docker-registry DOCKER_USERNAME | DOCKER_USERNAME ;
# secret/vmware-demo/docker-registry DOCKER_PASSWORD | DOCKER_PASSWORD ;
# tlsSkipVerify: true



- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
uses: asdf-vm/actions/install@v1
- name: Import Docker registry creds from Vault
id: creds
env:
VAULT_ADDR: https://vault-cluster.vault.52a7c979-da4b-40f2-94d6-7d4c5ead3d3a.aws.hashicorp.cloud:8200
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
run: |
echo ::set-output name=DOCKER_PASSWORD::$(curl -X 'GET' \
'${{env.VAULT_ADDR}}/v1/vmware-demo/docker-registry' \
-H 'accept: */*' \
-H 'X-Vault-Token: ${{env.VAULT_TOKEN}}' \
-H 'X-Vault-Namespace: admin' | jq -r .data.DOCKER_PASSWORD)
echo ::set-output name=DOCKER_USERNAME::$(curl -X 'GET' \
'${{env.VAULT_ADDR}}/v1/vmware-demo/docker-registry' \
-H 'accept: */*' \
-H 'X-Vault-Token: ${{env.VAULT_TOKEN}}' \
-H 'X-Vault-Namespace: admin'|jq -r .data.DOCKER_USERNAME)
- name: Get docker username
run: |
echo "docker username is ${{steps.creds.outputs.DOCKER_USERNAME}}"

- name: Build and push Docker image
uses: docker/[email protected]
with:
username: ${{ steps.creds.outputs.DOCKER_USERNAME }}
password: ${{ steps.creds.outputs.DOCKER_PASSWORD }}
repository: ${{ steps.creds.outputs.DOCKER_USERNAME }}/hello-gitops
tags: ${{ github.sha }}, latest
- name: Scan image
uses: azure/container-scan@v0
with:
image-name: ${{ steps.creds.outputs.DOCKER_USERNAME }}/hello-gitops:${{ github.sha }}
deploy:



name: Deploy
runs-on: ubuntu-latest
needs: [build,lint,push]
if: ${{ github.ref != 'refs/heads/master' }}
steps:


- name: Check out code
uses: actions/checkout@v2

- name: Run Checkov scan
id: checkov
uses: bridgecrewio/checkov-action@master
with:
directory: kustomize/base
skip_check: CKV_K8S_21,CKV_K8S_31,CKV_K8S_43,CKV_K8S_14
if: ${{ github.ref != 'refs/heads/master' }}


- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.6.1"

- name: Update Kubernetes resources
env:
DOCKER_USERNAME: pkatira7
run: |
echo $GITHUB_SHA
cd kustomize/base
kustomize edit set image hello-gitops=${{env.DOCKER_USERNAME}}/hello-gitops:$GITHUB_SHA
cat kustomization.yaml
sed -i "s/production/development/" kustomization.yaml
sed -i "s/hello-world-prod/hello-world-dev/" ../../argo-apps/hello-world.yaml
sed -i "s/master/development/" ../../argo-apps/hello-world.yaml



- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "Image version: $GITHUB_SHA "


- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
####If all the above steps complete deploy to main

deploy-prod:
name: Deploy to Production
runs-on: ubuntu-latest
needs: [lint,build,push]
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Run Checkov scan
id: checkov
uses: bridgecrewio/checkov-action@master
with:
directory: kustomize/base
skip_check: CKV_K8S_21,CKV_K8S_31,CKV_K8S_43,CKV_K8S_14
- name: Update Kubernetes resources
env:
DOCKER_USERNAME: pkatira7
run: |
echo $GITHUB_SHA
cd kustomize/base
kustomize edit set image hello-gitops=${DOCKER_USERNAME}/hello-gitops:$GITHUB_SHA
cat kustomization.yaml

sed -i "s/development/production/" kustomization.yaml
sed -i "s/hello-world-dev/hello-world-prod/" ../../argo-apps/hello-world.yaml
sed -i "s/development/master/" ../../argo-apps/hello-world.yaml


- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "Image version: $GITHUB_SHA"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}


2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vault 1.7.3
jq 1.6
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 go build -o hello-gitops cmd/main.go

FROM alpine:3.12
FROM alpine:3.14.2
EXPOSE 8080
WORKDIR /app
COPY --from=build /build/hello-gitops .
CMD ["./hello-gitops"]
CMD ["./hello-gitops"]

#3.12 alpine image had following issues - CVE-2021-36159,CVE-2021-3711,CVE-2021-3711,
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workshop Hello GitOps
# Hello World GitOps Demo

Example project to demonstrate GitOps using [Kustomize](https://github.com/kubernetes-sigs/kustomize), GitHub Actions and [ArgoCD](https://github.com/argoproj/argo-cd/)

Expand Down
17 changes: 17 additions & 0 deletions argo-apps/hello-world.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: hello-world-dev
namespace: argocd
spec:
project: default
source:
targetRevision: development
repoURL: https://github.com/piyush7/workshop-hello-gitops
path: kustomize/base
destination:
server: https://kubernetes.default.svc
syncPolicy:
syncOptions:
- replace=true
- force=true
20 changes: 20 additions & 0 deletions cert-mgr/stage-cert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
namespace: cert-manager
spec:
acme:
# The ACME server URL
server: https://acme-staging-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: [email protected]
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-staging
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx

8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ func startServer(handler func(http.ResponseWriter, *http.Request)){

func handler(w http.ResponseWriter, r *http.Request){
log.Printf("received request from %s", r.Header.Get("User-Agent"))
host, err := os.Hostname()
_, err := os.Hostname()
if err != nil {
host = "unknown host"
log.Printf("unknown host")
}
resp := fmt.Sprintf("Hello from %s", host)
resp := fmt.Sprintf("Hello to VMware tanzu folks from Piyush",)
_, err = w.Write([]byte(resp))
if err != nil {
log.Panicf("not able to write http output: %s", err)
}
}
}
2 changes: 1 addition & 1 deletion cmd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Test_handler(t *testing.T) {
}{
{
"status OK",
args{"/", http.StatusOK, fmt.Sprintf("Hello from %s", host)},
args{"/", http.StatusOK, fmt.Sprintf("Hello %s", host)},
},
}

Expand Down
13 changes: 13 additions & 0 deletions contour/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-gitops
labels:
app: hello-gitops
namespace: development
spec:
defaultBackend:
service:
name: development
port:
number: 8080
15 changes: 15 additions & 0 deletions contour/production-httpproxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: prod-http-proxy
namespace: production
spec:
virtualhost:
fqdn: prod.hello-gitops.com
routes:
- conditions:
- prefix: /
services:
- name: hello-gitops
port: 8080

Binary file added hello-gitops
Binary file not shown.
Loading