Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manoj pull update #49

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6d30279
Create openshift.yml
devopscicd17 Jul 28, 2022
56aa8f7
Update openshift.yml
devopscicd17 Jul 28, 2022
9ee3c2b
Update script.sh
devopscicd17 Aug 2, 2022
8ab6668
Update openshift.yml
devopscicd17 Aug 2, 2022
ca4a8d6
Update openshift.yml
devopscicd17 Aug 2, 2022
a1b8da8
Update openshift.yml
devopscicd17 Aug 2, 2022
8fd6219
Update openshift.yml
devopscicd17 Aug 2, 2022
15f5e95
Update openshift.yml
devopscicd17 Aug 2, 2022
a5b5c89
Update openshift.yml
devopscicd17 Aug 2, 2022
13b798c
Update openshift.yml
devopscicd17 Aug 3, 2022
a39a50a
Update openshift.yml
devopscicd17 Aug 3, 2022
29173e5
Update README.adoc
devopscicd17 Aug 4, 2022
5ef82c4
Update README.adoc
devopscicd17 Aug 22, 2022
9cdb616
Update openshift.yml
devopscicd17 Aug 22, 2022
3f13721
Update README.adoc
devopscicd17 Sep 8, 2022
5c75fa5
Update PIPELINE.md
devopscicd17 Sep 30, 2022
00159de
Update PIPELINE.md
devopscicd17 Sep 30, 2022
c8a1398
Update README.adoc
devopscicd17 Nov 14, 2022
ce4c38d
Update README.adoc
devopscicd17 Nov 29, 2022
ec2d133
Update README.adoc
devopscicd17 Mar 21, 2023
431a97c
Update README.adoc
devopscicd17 Mar 21, 2023
fd93d6d
Update README.adoc
devopscicd17 May 24, 2023
3bf9652
Update README.adoc
devopscicd17 Jun 7, 2023
84f4e91
Update README.adoc
devopscicd17 Jul 10, 2023
5780650
Update README.adoc
devopscicd17 Aug 3, 2023
8740308
Update README.adoc
devopscicd17 Aug 31, 2023
2c1de50
Update README.adoc
devopscicd17 Sep 30, 2023
19e7da7
Update script.sh
devopscicd17 Sep 30, 2023
23ece46
Update script.sh
devopscicd17 Sep 30, 2023
2ddde6a
Update README.adoc
devopscicd17 Oct 6, 2023
5cc9fc6
Update script.sh
devopscicd17 Oct 6, 2023
b2f4ccc
Update README.adoc
devopscicd17 Jan 17, 2024
911b88c
Update script.sh
devopscicd17 Jan 17, 2024
d708f29
Update README.adoc
devopscicd17 Mar 19, 2024
6e6953b
Update README.adoc
devopscicd17 Oct 17, 2024
33919dd
Merge branch 'openshift-roadshow:master' into master
devopscicd17 Oct 17, 2024
13b3fa7
Update README.adoc
devopscicd17 Oct 17, 2024
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
6 changes: 3 additions & 3 deletions .github/script.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

app_name=$1
image=$2
namespace=$3
app_name=nationalparks
image=nationalparks
namespace=manoj-singh8-dev

deploy=`oc get deployment $app_name -n $namespace`
if [[ "$?" -eq 0 ]]; then
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/openshift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: OpenShift

env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
APP_NAME: nationalparks
IMAGE_TAGS: latest ${{ github.sha }}

OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_NAMESPACE: "manoj-singh8-dev"

pcc_console_url: ${{ secrets.PCC_CONSOLE_URL }}
pcc_user: ${{ secrets.PCC_USER }}
pcc_pass: ${{ secrets.PCC_PASS }}

APP_PORT: "8080"

on:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
push:
branches: [ master ]

jobs:
build-and-push:
name: Build and push to github container registry
runs-on: ubuntu-22.04
environment: development

outputs:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2

# https://github.com/redhat-actions/s2i-build#readme
- name: S2I Build
id: build_image
uses: redhat-actions/s2i-build@v2
with:
path_context: '.'
builder_image: 'registry.access.redhat.com/ubi8/openjdk-11'
image: ${{ env.APP_NAME }}
tags: ${{ env.IMAGE_TAGS }}

# https://github.com/redhat-actions/push-to-registry#readme
- name: Push to Registry
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}

# The path the image was pushed to is now stored in ${{ steps.push-to-registry.outputs.registry-path }}

# https://github.com/redhat-actions/oc-login#readme
- name: Log in to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.OPENSHIFT_NAMESPACE }}

# Run a script to create a new app or update the current one with the previously pushed container image
- run: |
"${GITHUB_WORKSPACE}/.github/script.sh" ${{ env.APP_NAME }} ${{ env.IMAGE_REGISTRY }}/${{ steps.build_image.outputs.image }}:${{ github.sha }} ${{ env.OPENSHIFT_NAMESPACE }}
# Run Prisma Scan IBM Account
- name: Scan image
uses: PaloAltoNetworks/prisma-cloud-scan@v1
with:
pcc_console_url: ${{ secrets.PCC_CONSOLE_URL }}
pcc_user: ${{ secrets.PCC_USER }}
pcc_pass: ${{ secrets.PCC_PASS }}
image_name: ${{ env.APP_NAME }}
1 change: 1 addition & 0 deletions PIPELINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ in the same project as Jenkins. This will contain the `master` branch of each pr
to each repository will result in a new pipeline getting instantiated and a new project getting created
for that pipeline. The GitHub PR will then include a status of the build, a link to the application preview,
and a link to the approval page.

12 changes: 10 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
= NationalParks backend application
This application is a backend that provides geolocation information about NationalParks. The information is stored in a mongodb

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbcccccccccccc
This application is a backend that provides geolocation information about NationalParks. The information is stored in a mongodb

Hello DevD
== Installation
As the application needs to interact with openshift's API, you'll need to provide some permissions to the default ServiceAccount for that.

Expand Down Expand Up @@ -30,7 +32,7 @@ There's some options that can be parameterized:
* MAVEN_MIRROR_URL: Url of a maven mirror
* APPLICATION_HOSTNAME: Hostname/route to access your application

Example:
Example: Hello World Hello World hello word

----
oc new-app nationalparks -p APPLICATION_HOSTNAME=nationalparks-roadshow.127.0.0.1.xip.io -p MAVEN_MIRROR_URL=http://nexus.ci:8081/content/groups/public
Expand All @@ -41,3 +43,9 @@ oc new-app nationalparks -p APPLICATION_HOSTNAME=nationalparks-roadshow.127.0.0.
National Parks data comes from link:https://protectedplanet.net[ProtectedPlanet], listing worldwide National Parks categories, filtered as units shown link:https://en.wikipedia.org/wiki/List_of_the_United_States_National_Park_System_official_units[here]

We used this link:https://www.protectedplanet.net/en/search-areas?filters%5Bis_type%5D%5B%5D=terrestrial&filters%5Bdesignation%5D%5B%5D=Nacional+Park&filters%5Bdesignation%5D%5B%5D=National+Forest+Park&filters%5Bdesignation%5D%5B%5D=National+Historic+Park&filters%5Bdesignation%5D%5B%5D=National+Battlefield&filters%5Bdesignation%5D%5B%5D=National+Historic+Site&filters%5Bdesignation%5D%5B%5D=National+Historical+Park&filters%5Bdesignation%5D%5B%5D=National+Lakeshore&filters%5Bdesignation%5D%5B%5D=National+Military+Park&filters%5Bdesignation%5D%5B%5D=National+Monument&filters%5Bdesignation%5D%5B%5D=National+Park&filters%5Bdesignation%5D%5B%5D=National+Park+%28Category+Ii%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28Commonwealth%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28Fbih+Law%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28PN%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28Rs+Law%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28Scientific%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28Svalbard%29&filters%5Bdesignation%5D%5B%5D=National+Park+%28project%29&filters%5Bdesignation%5D%5B%5D=National+Park+-+Buffer+Zone&filters%5Bdesignation%5D%5B%5D=National+Park+-+Buffer+Zone%2FArea+Of+Adhesion&filters%5Bdesignation%5D%5B%5D=National+Park+-+Core+Area&filters%5Bdesignation%5D%5B%5D=National+Park+-+Integrale+Reserve&filters%5Bdesignation%5D%5B%5D=National+Park+-+Peripheral+Zone&filters%5Bdesignation%5D%5B%5D=National+Park+Aboriginal&filters%5Bdesignation%5D%5B%5D=National+Park+and+ASEAN+Heritage+Park&filters%5Bdesignation%5D%5B%5D=National+Park+and+Ecological+Reserve&filters%5Bdesignation%5D%5B%5D=National+Park+and+Indigenous+Territory&filters%5Bdesignation%5D%5B%5D=National+Reserve&filters%5Bdesignation%5D%5B%5D=National+River&filters%5Bdesignation%5D%5B%5D=National+Seashore[query] listing 2830 National Parks at the moment.

test testing SITA RAM HANUMAN

Hello Sita Ram Sita Ram
Hello Test
Hello World