-
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.
Merge pull request #264 from alwinsimon/v1
V1
- Loading branch information
Showing
41 changed files
with
628 additions
and
43 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ========================================= CD - Deploy - Auth Service ========================================= | ||
|
||
name: CD - Deploy - Auth Service | ||
|
||
on: | ||
push: | ||
branches: | ||
- production | ||
paths: | ||
- "auth/**" | ||
|
||
jobs: | ||
Auth-Service-CD-Pipeline: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: cd auth && docker build -t alwinsimon/bookmyseat-auth . | ||
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
- run: docker push alwinsimon/bookmyseat-auth | ||
- uses: digitalocean/action-doctl@v2 | ||
with: | ||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
- run: doctl kubernetes cluster kubeconfig save bookmyseat-k8s | ||
- run: kubectl rollout restart deployment auth-depl |
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,22 @@ | ||
# ========================================= CD - Deploy - Manifests ========================================= | ||
|
||
name: CD - Deploy - Manifests | ||
|
||
on: | ||
push: | ||
branches: | ||
- production | ||
paths: | ||
- "infra/**" | ||
|
||
jobs: | ||
Deploy-Manifests-CD-Pipeline: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: digitalocean/action-doctl@v2 | ||
with: | ||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
- run: doctl kubernetes cluster kubeconfig save bookmyseat-k8s | ||
- run: kubectl apply -f infra/k8s |
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,16 @@ | ||
# ========================================= CI - Tests - Auth Service ========================================= | ||
|
||
name: CI - Tests - Auth Service | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "auth/**" | ||
|
||
jobs: | ||
Auth-Service-Pre-Integration-Tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: cd auth && npm install && npm run test:ci |
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,16 @@ | ||
# ========================================= CI - Tests - Orders Service ========================================= | ||
|
||
name: CI - Tests - Orders Service | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "orders/**" | ||
|
||
jobs: | ||
Orders-Service-Pre-Integration-Tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: cd orders && npm install && npm run test:ci |
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,16 @@ | ||
# ========================================= CI - Tests - Payments Service ========================================= | ||
|
||
name: CI - Tests - Payments Service | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "payments/**" | ||
|
||
jobs: | ||
Payments-Service-Pre-Integration-Tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: cd payments && npm install && npm run test:ci |
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,16 @@ | ||
# ========================================= CI - Tests - Tickets Service ========================================= | ||
|
||
name: CI - Tests - Tickets Service | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "tickets/**" | ||
|
||
jobs: | ||
Tickets-Service-Pre-Integration-Tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: cd tickets && npm install && npm run test:ci |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,34 +1,56 @@ | ||
import buildClient from "../api/build-client"; | ||
import Link from 'next/link'; | ||
|
||
const IndexPage = ({ currentUser }) => { | ||
const IndexPage = ({ currentUser, tickets }) => { | ||
if (!currentUser) { | ||
return ( | ||
<> | ||
<h1>Landing Page</h1> | ||
<br/> | ||
<br /> | ||
<h5>Signed Out</h5> | ||
</> | ||
); | ||
} | ||
|
||
let ticketList; | ||
if (currentUser) { | ||
ticketList = tickets.map((ticket) => { | ||
return ( | ||
<tr key={ticket.id}> | ||
<td>{ticket.title}</td> | ||
<td>{ticket.price}</td> | ||
<td> | ||
<Link href="/tickets/[ticketId]" as={`/tickets/${ticket.id}`}> | ||
View | ||
</Link> | ||
</td> | ||
</tr> | ||
); | ||
}); | ||
} | ||
|
||
return ( | ||
<> | ||
<h1>Landing Page</h1> | ||
<br /> | ||
<h5>Welcome {currentUser.email}</h5> | ||
|
||
<h1>Tickets</h1> | ||
<table className="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Title</th> | ||
<th>Price</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody>{currentUser && ticketList}</tbody> | ||
</table> | ||
</> | ||
); | ||
}; | ||
|
||
IndexPage.getInitialProps = async (context) => { | ||
try { | ||
const client = buildClient(context); | ||
const response = await client.get("/api/users/currentuser"); | ||
return response.data; | ||
} catch (err) { | ||
console.error("Error in making request to get current user:", err.message); | ||
return { currentUser: null }; | ||
} | ||
IndexPage.getInitialProps = async (context, client, currentUser) => { | ||
const { data } = await client.get("/api/tickets"); | ||
return { tickets: data }; | ||
}; | ||
|
||
export default IndexPage; |
Oops, something went wrong.