Skip to content

Commit

Permalink
Feature/marp 662 integration of installation frequency follow up for …
Browse files Browse the repository at this point in the history
…marp 473 (#50)
  • Loading branch information
tvtphuc-axonivy authored Jul 24, 2024
1 parent ee52b0f commit b0d28cf
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
SERVICE_PASSWORD: ${{ secrets.SERVICE_PASSWORD }}
MONGODB_DATABASE: ${{ secrets.MONGODB_DATABASE }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MARKETPLACE_INSTALLATION_URL: ${{ secrets.MARKETPLACE_INSTALLATION_URL }}
run: |
sed -i "s/^MONGODB_INITDB_ROOT_USERNAME=.*$/MONGODB_INITDB_ROOT_USERNAME=$ROOT_USERNAME/" $ENV_FILE
sed -i "s/^MONGODB_INITDB_ROOT_PASSWORD=.*$/MONGODB_INITDB_ROOT_PASSWORD=$ROOT_PASSWORD/" $ENV_FILE
Expand All @@ -45,7 +44,6 @@ jobs:
sed -i "s/^SERVICE_MONGODB_USER=.*$/SERVICE_MONGODB_USER=$SERVICE_USERNAME/" $ENV_FILE
sed -i "s/^SERVICE_MONGODB_PASSWORD=.*$/SERVICE_MONGODB_PASSWORD=$SERVICE_PASSWORD/" $ENV_FILE
sed -i "s/^MARKET_GITHUB_TOKEN=.*$/MARKET_GITHUB_TOKEN=$GH_TOKEN/" $ENV_FILE
sed -i "s/^MARKETPLACE_INSTALLATION_URL=.*$/MARKETPLACE_INSTALLATION_URL=$MARKETPLACE_INSTALLATION_URL/" $ENV_FILE
- name: Build and bring up containers without cache
working-directory: ./marketplace-build
Expand Down
3 changes: 2 additions & 1 deletion marketplace-build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ services:
service:
container_name: marketplace-service
restart: always
volumes:
- /home/axonivy/marketplace/data/market-installations.json:/home/data/market-installation.json
environment:
- MONGODB_HOST=${SERVICE_MONGODB_HOST}
- MONGODB_DATABASE=${SERVICE_MONGODB_DATABASE}
- MONGODB_USERNAME=${SERVICE_MONGODB_USER}
- MONGODB_PASSWORD=${SERVICE_MONGODB_PASSWORD}
- MARKET_GITHUB_TOKEN=${MARKET_GITHUB_TOKEN}
- MARKETPLACE_INSTALLATION_URL=${MARKETPLACE_INSTALLATION_URL}
build:
context: ../marketplace-service
dockerfile: Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions marketplace-build/release/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ services:
service:
image: ghcr.io/axonivy-market/marketplace-service:latest
restart: always
volumes:
- /home/axonivy/marketplace/data/market-installations.json:/home/data/market-installation.json
environment:
- MONGODB_HOST=${SERVICE_MONGODB_HOST}
- MONGODB_DATABASE=${SERVICE_MONGODB_DATABASE}
- MONGODB_USERNAME=${SERVICE_MONGODB_USER}
- MONGODB_PASSWORD=${SERVICE_MONGODB_PASSWORD}
- MARKET_GITHUB_TOKEN=${MARKET_GITHUB_TOKEN}
- MARKETPLACE_INSTALLATION_URL=${MARKETPLACE_INSTALLATION_URL}

volumes:
mongodata:
3 changes: 2 additions & 1 deletion marketplace-build/release/sprint-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ services:
service:
image: ghcr.io/axonivy-market/marketplace-service:sprint
restart: always
volumes:
- /home/axonivy/marketplace/data/market-installations.json:/home/data/market-installation.json
environment:
- MONGODB_HOST=${SERVICE_MONGODB_HOST}
- MONGODB_DATABASE=${SERVICE_MONGODB_DATABASE}
- MONGODB_USERNAME=${SERVICE_MONGODB_USER}
- MONGODB_PASSWORD=${SERVICE_MONGODB_PASSWORD}
- MARKET_GITHUB_TOKEN=${MARKET_GITHUB_TOKEN}
- MARKETPLACE_INSTALLATION_URL=${MARKETPLACE_INSTALLATION_URL}
volumes:
mongodata:

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import org.springframework.web.bind.annotation.CrossOrigin;
import java.util.List;

import static com.axonivy.market.constants.RequestMappingConstants.PRODUCT_DETAILS;
Expand All @@ -40,7 +40,8 @@ public ResponseEntity<ProductDetailModel> findProductDetailsByVersion(@PathVaria
return new ResponseEntity<>(detailModelAssembler.toModel(productDetail, tag), HttpStatus.OK);
}

@Operation(summary = "increase installation count by 1", description = "increase installation count by 1")
@Operation(summary = "increase installation count by 1", description = "update installation count when click download product files by users")
@CrossOrigin(originPatterns = "*")
@PutMapping("/installationcount/{key}")
public ResponseEntity<Integer> syncInstallationCount(@PathVariable("key") String key) {
int result = productService.updateInstallationCountForProduct(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ server.forward-headers-strategy=framework
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
market.cors.allowed.origin.maxAge=3600
synchronized.installation.counts.path=${MARKETPLACE_INSTALLATION_URL}
synchronized.installation.counts.path=/home/data/market-installation.json
market.github.token=${MARKET_GITHUB_TOKEN}
logging.level.org.springframework.security=DEBUG
spring.security.oauth2.client.registration.github.client-id=<replace-with-your-client-id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.verify;

@SpringBootTest(properties = { "MARKETPLACE_INSTALLATION_URL=marketplace-installation.json", "MONGODB_USERNAME=user",
"MONGODB_PASSWORD=password", "MONGODB_HOST=mongoHost", "MONGODB_DATABASE=product" })
@SpringBootTest(properties = { "MONGODB_USERNAME=user", "MONGODB_PASSWORD=password", "MONGODB_HOST=mongoHost",
"MONGODB_DATABASE=product" })
class SchedulingTasksTest {

@SpyBean
Expand Down

0 comments on commit b0d28cf

Please sign in to comment.