Skip to content

Commit

Permalink
Integrate code artifact with a2d2 (#398)
Browse files Browse the repository at this point in the history
* Updated shell script

* Updated readme.md file

* Make improvment in the README.md file

* Update README.md

* Update README.md

* Integrating code artifact suggestions (#400)

* fix indentation and added release

* Fix indentation

---------

Co-authored-by: Mariano De Maio <[email protected]>
  • Loading branch information
vdeshkar and marianbuenosayres authored Nov 22, 2023
1 parent 018900c commit 72e3851
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 22 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,37 @@ You will need to install the following:

mvn test


## Versioning

Whenever changes are made to the project, it's important to update the version numbers in the project's POM files. This includes both the sub-project POM files the parent POM file and POM files where we want latest version changes mandatory.

### Updating Sub-Project POM Version

If you make changes to a specific sub-project, navigate to its POM file and update the version number accordingly. Look for the `<version>` element and modify it appropriately.

```xml
<project>
<groupId>com.example</groupId>
<artifactId>sub-project</artifactId>
<version>1.0.0</version> <!-- Update this version number -->
<!-- ... other configurations ... -->
</project>
```

### Updating Parent-Project POM Version

If you make changes to a project, navigate to its POM file of parent and update the version number accordingly. Look for the `<version>` element and modify it appropriately.

```xml
<project>
<groupId>com.example</groupId>
<artifactId>project</artifactId>
<version>1.0.0</version> <!-- Update this version number -->
<!-- ... other configurations ... -->
</project>
```

## Deployment

### Deploying as a WAR file in Tomcat
Expand Down Expand Up @@ -108,3 +139,5 @@ You will need to install the following:

-Dcache.jedis.use_ssl=true -Dcache.jedis.password=<your-optional-redis-password> -Dcache.jedis.connection.timeout=<your-optional-conn-timeout-in-millis-defaults-to-10-seconds>



51 changes: 35 additions & 16 deletions a2d2-settings.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,58 @@
<settings>
<profiles>
<profile>
<id>elimu-a2d2-api</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>default</id>
<repositories>
<repository>
<id>maven-central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>elimu-a2d2-api</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>elimu-a2d2-api</id>
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/a2d2-api/</url>
</repository>
</repository>
</repositories>
</profile>
<profile>
<id>elimu-java-commons</id>
<activation>
<activeByDefault>true</activeByDefault>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>elimu-java-commons</id>
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/java-commons/</url>
</repository>
<repository>
<id>elimu-java-commons</id>
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/java-commons/</url>
</repository>
</repositories>
</profile>
<profile>
<id>elimu-ecdm</id>
<activation>
<activeByDefault>true</activeByDefault>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>elimu-ecdm</id>
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/ecdm/</url>
</repository>
<repository>
<id>elimu-ecdm</id>
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/ecdm/</url>
</repository>
</repositories>
</profile>
</profiles>
Expand All @@ -54,4 +73,4 @@
<password>${env.CODEARTIFACT_AUTH_TOKEN}</password>
</server>
</servers>
</settings>
</settings>
10 changes: 4 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash
echo "inside shell"
sub_folders=( "cds-hook-model" "generic-model" "generic-helpers" "core-dependencies" "kie-based-services" "service-daos" "cds-hook-services" "core-wih" "cql-mods" "cql-wih" "ftl-transform-wih" "fhir-resource-wih" "cdshooks-wih" "web-util" "fhir-query-helper-base" "fhir-query-helper-dstu2" "fhir-query-helper-dstu3" "fhir-query-helper-r4" "oauth-helpers" "fhir-helpers" "task-utilities" "sms-wih" "a2d2-api")

sub_projects=($(find "$(pwd)" -maxdepth 1 -type d -not -path "$(pwd)" -exec test -e '{}/pom.xml' ';' -printf '%f\n'))

mvn deploy --settings a2d2-settings.xml -Durl=https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/a2d2-api/ -DpomFile=pom.xml -DrepositoryId=elimu-a2d2-api -DupdateReleaseInfo=true -DskipTests -U

for sub_folder in "${sub_folders[@]}"; do
cd "$sub_folder" || exit 1

for sub_project in "${sub_projects[@]}"; do
cd "$sub_project" || exit 1
mvn deploy --settings ../a2d2-settings.xml -Durl=https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/a2d2-api/ -DpomFile=pom.xml -DrepositoryId=elimu-a2d2-api -DupdateReleaseInfo=true -DskipTests -U

cd ..
done
21 changes: 21 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,27 @@
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/a2d2-api/</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>maven-central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>elimu-a2d2-api</id>
<name>elimu-a2d2-api</name>
<url>https://elimu-435911253355.d.codeartifact.us-west-2.amazonaws.com/maven/a2d2-api/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
Expand Down

0 comments on commit 72e3851

Please sign in to comment.