Skip to content

Commit e7b7fad

Browse files
committed
Initial commit
0 parents  commit e7b7fad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+7667
-0
lines changed

.github/workflows/api-tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: API Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
workflow_dispatch:
9+
inputs:
10+
environment:
11+
description: 'Environment to run tests against'
12+
required: true
13+
default: 'docker'
14+
type: choice
15+
options:
16+
- local
17+
- docker
18+
test_folder:
19+
description: 'Test folder to run (leave empty for all)'
20+
required: false
21+
type: string
22+
23+
jobs:
24+
api-tests:
25+
name: Run API Tests
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v3
31+
32+
- name: Set up Docker Compose
33+
run: |
34+
docker compose --version
35+
36+
- name: Start services with Docker Compose
37+
run: |
38+
docker compose up -d
39+
# Wait for services to be ready
40+
echo "Waiting for services to be ready..."
41+
sleep 120
42+
43+
- name: Set up Node.js
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: '18'
47+
cache: 'npm'
48+
cache-dependency-path: tests/postman/package-lock.json
49+
50+
- name: Install Newman and dependencies
51+
working-directory: tests/postman
52+
run: npm install
53+
54+
- name: Run API tests
55+
working-directory: tests/postman
56+
run: |
57+
58+
docker compose up -d
59+
# Wait for services to be ready
60+
echo "Waiting for services to be ready..."
61+
sleep 15
62+
# Build the Docker image
63+
docker build -t cinemaabyss-api-tests .
64+
65+
# Run the tests in Docker
66+
docker run --network=cinemaabyss-network -v "$(pwd)/reports:/app/reports" cinemaabyss-api-tests
67+
68+
69+
- name: Stop services
70+
if: always()
71+
run: docker compose down
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- 'src/**'
9+
- '.github/workflows/docker-build-push.yml'
10+
release:
11+
types: [published]
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
MONOLITH_IMAGE_NAME: ${{ github.repository }}/monolith
16+
MOVIES_SERVICE_IMAGE_NAME: ${{ github.repository }}/movies-service
17+
EVENTS_SERVICE_IMAGE_NAME: ${{ github.repository }}/events-service
18+
PROXY_SERVICE_IMAGE_NAME: ${{ github.repository }}/proxy-service
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v2
33+
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@v2
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract metadata (tags, labels) for Monolith
42+
id: meta-monolith
43+
uses: docker/metadata-action@v4
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.MONOLITH_IMAGE_NAME }}
46+
tags: |
47+
type=semver,pattern={{version}}
48+
type=semver,pattern={{major}}.{{minor}}
49+
type=sha,format=short
50+
type=ref,event=branch
51+
latest
52+
53+
- name: Build and push Monolith Docker image
54+
uses: docker/build-push-action@v4
55+
with:
56+
context: ./src/monolith
57+
push: true
58+
tags: ${{ steps.meta-monolith.outputs.tags }}
59+
labels: ${{ steps.meta-monolith.outputs.labels }}
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max
62+
63+
- name: Extract metadata (tags, labels) for Movies Service
64+
id: meta-movies
65+
uses: docker/metadata-action@v4
66+
with:
67+
images: ${{ env.REGISTRY }}/${{ env.MOVIES_SERVICE_IMAGE_NAME }}
68+
tags: |
69+
type=semver,pattern={{version}}
70+
type=semver,pattern={{major}}.{{minor}}
71+
type=sha,format=short
72+
type=ref,event=branch
73+
latest
74+
75+
- name: Build and push Movies Service Docker image
76+
uses: docker/build-push-action@v4
77+
with:
78+
context: ./src/microservices/movies
79+
push: true
80+
tags: ${{ steps.meta-movies.outputs.tags }}
81+
labels: ${{ steps.meta-movies.outputs.labels }}
82+
cache-from: type=gha
83+
cache-to: type=gha,mode=max
84+
85+

.gitignore

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Go specific
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
*.test
8+
*.out
9+
/vendor/
10+
/Godeps/
11+
12+
# Go workspace file
13+
go.work
14+
15+
# Go build and test cache
16+
.go/
17+
18+
# Compiled Object files, Static and Dynamic libs
19+
*.o
20+
*.a
21+
22+
# Folders
23+
_obj
24+
_test
25+
bin/
26+
pkg/
27+
28+
# Dependency directories
29+
vendor/
30+
31+
# IDE specific files
32+
.idea/
33+
.vscode/
34+
*.swp
35+
*.swo
36+
*~
37+
.DS_Store
38+
.history/
39+
*.sublime-workspace
40+
*.sublime-project
41+
42+
# Docker
43+
.docker/
44+
docker-compose.override.yml
45+
46+
# Kubernetes
47+
kubeconfig
48+
*.kubeconfig
49+
.kube/
50+
51+
# Environment variables
52+
.env
53+
.env.local
54+
.env.development.local
55+
.env.test.local
56+
.env.production.local
57+
*.env
58+
59+
# Logs
60+
logs/
61+
*.log
62+
npm-debug.log*
63+
yarn-debug.log*
64+
yarn-error.log*
65+
66+
# Build artifacts
67+
dist/
68+
build/
69+
out/
70+
target/
71+
.gradle/
72+
73+
# Node.js (for frontend or Node.js services)
74+
node_modules/
75+
npm-debug.log
76+
yarn-error.log
77+
.pnp/
78+
.pnp.js
79+
coverage/
80+
.next/
81+
.nuxt/
82+
.cache/
83+
.parcel-cache/
84+
reports/
85+
86+
# Postman
87+
newman/
88+
89+
# Temporary files
90+
tmp/
91+
temp/
92+
*.tmp
93+
*.bak
94+
*.swp
95+
*.swo
96+
97+
# OS specific
98+
.DS_Store
99+
.DS_Store?
100+
._*
101+
.Spotlight-V100
102+
.Trashes
103+
ehthumbs.db
104+
Thumbs.db
105+
106+
# Certificates and keys
107+
*.pem
108+
*.key
109+
*.crt
110+
*.cer
111+
*.der
112+
*.priv
113+
114+
# Database files
115+
*.db
116+
*.sqlite
117+
*.sqlite3
118+
119+
# Helm
120+
.helm/
121+
charts/*/charts/
122+
charts/*/requirements.lock
123+
.cache/
124+
125+
# Test coverage
126+
coverage.txt
127+
profile.out
128+
*.cover
129+
130+
# Terraform
131+
.terraform/
132+
terraform.tfstate
133+
terraform.tfstate.backup
134+
*.tfvars
135+
136+
# Binaries for programs and plugins
137+
*.exe
138+
*.exe~
139+
*.dll
140+
*.so
141+
*.dylib
142+
143+
# Test binary, built with `go test -c`
144+
*.test
145+
146+
# Output of the go coverage tool, specifically when used with LiteIDE
147+
*.out
148+
149+
# Dependency directories (remove the comment below to include it)
150+
# vendor/
151+
152+
# Go workspace file
153+
go.work
154+
155+
# Postman tests reports
156+
tests/postman/reports/

0 commit comments

Comments
 (0)