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

Feature/marp 662 integration of installation frequency follow up for marp 473 #50

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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 @@ -31,7 +30,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: Refresh Docker images
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
Loading