Skip to content

Commit

Permalink
Develop (#45)
Browse files Browse the repository at this point in the history
* #Agent#2 initialized frontend project (#18)

* #Agent#1 - Initialized backend projects (#17)

* Task/agent#19 Login (#20)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* Task/agent#22 (#28)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #Agent#22 create product

* Task/agent#25 (#29)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #25 Agent view product

#25 Agent view product

* Task/agent#23 (#30)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #25 Agent view product

#25 Agent view product

* #23 Edit product

#23 Edit product

* Task/agent#24 (#31)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #25 Agent view product

#25 Agent view product

* #24 delete product

#24 delete product

* Task/agent#26 (#32)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #26 User buys product

#26 User buys product

* Task/agent#27 (#33)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #26 User buys product

#26 User buys product

* #27

#27 Generating reports

* #27 adding back button

* Task/agent#34 (#35)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #34 Integration tests

* #34 testing

* #34 Fix for frontend

* Task/agent#36 (#37)

* #Agent#19 Login backend

* git issues

* #Agent#19 added exception handling for http requests

* #Agent#19 login frontend

* #36 Move report to microservice

* Task/agent#8 (#38)

* Override services name in pom.xml file

* Converting spring boot specific tools for service discovery and API gateway (Eureka and Spring Cloud Gateway) to general tools for service discovery and API gateway (Docker DNS and NGINX

* update pom.xml report service

* For each service .gitignore, .dockerignore and Dockerfile were added

* For each service application.properties file was added

* docker-compose.yml backend setup

* .env.example

* feign client update

* jwt.secret

* api_gateway.config fix

* mysql pom.xml

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Dockerizing agent

* web_config update

* data.sql Populating Database

* login jwt

* path /{id}

* Dockerized the Angular App

* NODE_ENV

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Docker staging

* Update README.md

* staging and profiles

* CORS

* Update README.md

* Update README.md

* Update README.md

* Docker staging and pom.xml profiles test and prod env

* Update README.md

* Update README.md

* Task/agent#39 (#41)

* Override services name in pom.xml file

* Converting spring boot specific tools for service discovery and API gateway (Eureka and Spring Cloud Gateway) to general tools for service discovery and API gateway (Docker DNS and NGINX

* update pom.xml report service

* For each service .gitignore, .dockerignore and Dockerfile were added

* For each service application.properties file was added

* docker-compose.yml backend setup

* .env.example

* feign client update

* jwt.secret

* api_gateway.config fix

* mysql pom.xml

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Dockerizing agent

* web_config update

* data.sql Populating Database

* login jwt

* path /{id}

* Dockerized the Angular App

* NODE_ENV

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Docker staging

* Update README.md

* staging and profiles

* CORS

* Update README.md

* Update README.md

* Update README.md

* Docker staging and pom.xml profiles test and prod env

* Update README.md

* Update README.md

* agent frontend Dockerfile.base

* Update README.md

* npm base image

* npm base image agent frontend

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Task/agent#40 (#42)

* .dockerignore product service

* .dockerignore files

* mvn base image product service

* mvn base image report service

* mvn base image shop service

* readme.md update

* Task/agent#3 (#43)

* CI develop branch initialization

* properties pom.xml update

* ci pr pipeline

* product controller tests

* surefire plugin

* distribution management pom.xml

* sonar-project.properties

* ci-cd push dev pipeline

* publish-dockerhub.sh

* Update README.md

* Update README.md

* Update README.md

* ci push main pipeline (#44)

Co-authored-by: Mile Praštalo <mile.prastalo97@gmail.com>
  • Loading branch information
DusanStevic and MilePrastalo authored Sep 3, 2021
1 parent 631458b commit 6c3fb69
Show file tree
Hide file tree
Showing 242 changed files with 21,245 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.git
.gitignore
*.iml
*.md
mvnw
mvnw.cmd
.mvn
.idea
target
.dockerignore
Dockerfile
docker-compose*.yml
config
LICENSE
README.md
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SECRET_KEY = YOUR_SECRET_KEY_HERE
kada se sve zavrsi polepi ovde kljuceve i stavi u gitignore
55 changes: 55 additions & 0 deletions .github/workflows/ci-cd-push-develop-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# source: https://faun.pub/continuous-integration-of-java-project-with-github-actions-7a8a0e8246ef
name: CI-CD operations PUSH event DEVELOP branch pipeline
on:
push:
branches:
- 'develop'
jobs:
# https://github.com/mathieudutour/github-tag-action
prerelease:
name: Create prerelease
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub prerelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Prerelease ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
prerelease: true
outputs:
tag_name: ${{ steps.tag_version.outputs.new_tag }}

artifact:
name: Publish - GitHub Packages
runs-on: ubuntu-latest
strategy:
matrix: { dir: [ 'AgentProductService', 'AgentReportService','AgentShopService' ] }
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Publish artifact on GitHub Packages
working-directory: ${{ matrix.dir }}
run: mvn -B clean deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Publish - Docker Hub
runs-on: ubuntu-latest
needs: [prerelease]
steps:
- uses: actions/checkout@v1
- name: Build product service docker image
run: bash ./publish-dockerhub.sh ${{ needs.prerelease.outputs.tag_name }} ${{ secrets.DOCKER_USER }} ${{ secrets.DOCKER_PASS }}
54 changes: 54 additions & 0 deletions .github/workflows/ci-cd-push-main-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# source: https://faun.pub/continuous-integration-of-java-project-with-github-actions-7a8a0e8246ef
name: CI-CD operations PUSH event MAIN branch pipeline
on:
push:
branches:
- 'main'
jobs:
# https://github.com/mathieudutour/github-tag-action
release:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
outputs:
tag_name: ${{ steps.tag_version.outputs.new_tag }}

artifact:
name: Publish - GitHub Packages
runs-on: ubuntu-latest
strategy:
matrix: { dir: [ 'AgentProductService', 'AgentReportService','AgentShopService' ] }
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Publish artifact on GitHub Packages
working-directory: ${{ matrix.dir }}
run: mvn -B clean deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Publish - Docker Hub
runs-on: ubuntu-latest
needs: [release]
steps:
- uses: actions/checkout@v1
- name: Build product service docker image
run: bash ./publish-dockerhub.sh ${{ needs.release.outputs.tag_name }} ${{ secrets.DOCKER_USER }} ${{ secrets.DOCKER_PASS }}
135 changes: 135 additions & 0 deletions .github/workflows/ci-pr-develop-main-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# source: https://faun.pub/continuous-integration-of-java-project-with-github-actions-7a8a0e8246ef
name: CI operations PR event DEVELOP branch MAIN branch pipeline
on:
pull_request:
branches:
- develop
types: [opened, synchronize, reopened]
jobs:
# Test - Units & Integrations
test:
name: Test - Units & Integrations
runs-on: ubuntu-latest
strategy:
# A matrix allows you to create multiple jobs by performing variable substitution in a single job definition
matrix: { dir: [ 'AgentProductService', 'AgentReportService','AgentShopService' ] }
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Maven Package
working-directory: ${{ matrix.dir }}
run: mvn -B clean package -DskipTests
- name: Maven Verify
working-directory: ${{ matrix.dir }}
run: mvn -B clean verify -Ptest

# Analyze code with Sonar Cloud
sonar_product_service: # Generated using Sonar Cloud Maven build template
name: Test - SonarCloud scan (analysis) of product service
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# -Pdev activate dev profile -f path/to/pom.xml
run: mvn -Pdev -f AgentProductService/pom.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=DevOps-Nistagram-Organization_Agent

sonar_report_service: # Generated using Sonar Cloud Maven build template
name: Test - SonarCloud scan (analysis) of report service
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# -Pdev activate dev profile -f path/to/pom.xml
run: mvn -Pdev -f AgentReportService/pom.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=DevOps-Nistagram-Organization_Agent

sonar_shop_service: # Generated using Sonar Cloud Maven build template
name: Test - SonarCloud scan (analysis) of shop service
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# -Pdev activate dev profile -f path/to/pom.xml
run: mvn -Pdev -f AgentShopService/pom.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=DevOps-Nistagram-Organization_Agent

sonar_agent_frontend: # Generated using Sonar Cloud Other (for JS, TS, Go, Python, PHP, ...) build template
name: Test - SonarCloud scan (analysis) of agent frontend
runs-on: ubuntu-latest
# Prevents: The date of analysis cannot be older than the date of the last known analysis on this project.
# Value: "2021-08-30T19:30:38+0000". Latest analysis: "2021-08-30T19:30:54+0000". It's only possible to
# rebuild the past in chronological order.
needs: [sonar_product_service, sonar_report_service, sonar_shop_service]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,40 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

# API keys and secrets
#.env
19 changes: 19 additions & 0 deletions AgentFrontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
*.md
LICENSE
.vscode
.editorconfig
dist
tmp






13 changes: 13 additions & 0 deletions AgentFrontend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
Loading

0 comments on commit 6c3fb69

Please sign in to comment.