Skip to content

Commit

Permalink
(OPS): 2.x and 3.x pipeline alignment
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Murithi <[email protected]>
  • Loading branch information
Murithijoshua committed Jun 5, 2024
1 parent 3266a16 commit 4cc0cee
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/cicd_process.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: deploy to prod 8600
on:
push:
branches: [ master ]
branches: [ master, 2.x ]
jobs:

build:
name: Deploy
name: deploying to 2.x instance
if: github.ref == 'refs/heads/2.x'
runs-on: ubuntu-latest
steps:
- name: executing remote connection
Expand All @@ -23,7 +23,7 @@ jobs:
sudo chown -R cicd2:cicd2 openmrs-module-kenyaemr-machine-learning
cd openmrs-module-kenyaemr-machine-learning
git config --global --add safe.directory /apps/github-workflows/kenyaemr-modules/openmrs-module-kenyaemr-machine-learning
git clone -b master https://github.com/palladiumkenya/openmrs-module-kenyaemr-machine-learning.git .
git clone -b 2.x https://github.com/palladiumkenya/openmrs-module-kenyaemr-machine-learning.git .
sudo chown -R cicd2:cicd2 /apps/github-workflows/kenyaemr-modules/openmrs-module-kenyaemr-machine-learning
git status
mvn clean install -DskipTests
Expand All @@ -34,3 +34,33 @@ jobs:
sudo chmod 755 /var/lib/OpenMRS/modules/*.omod
sudo systemctl stop tomcat
sudo systemctl start tomcat
dev_server_deployment:
name: deploying to 3.x dev instance
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: executing remote connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.CICD_HOST }}
username: ${{ secrets.CICD_USERNAME }}
key: ${{ secrets.CICD_SECRET }}
port: ${{ secrets.PORT }}
command_timeout: 200m
script: |
cd /apps/githubworkflows/kenyaemr-modules
sudo rm -rf openmrs-module-kenyaemr-machine-learning
sudo mkdir openmrs-module-kenyaemr-machine-learning
sudo chown -R cicd:cicd openmrs-module-kenyaemr-machine-learning
git config --global --add safe.directory /apps/githubworkflows/kenyaemr-modules/openmrs-module-kenyaemr-machine-learning
cd /apps/githubworkflows/kenyaemr-modules/openmrs-module-kenyaemr-machine-learning
git clone -b master https://github.com/palladiumkenya/openmrs-module-kenyaemr-machine-learning.git .
git status
mvn license:format
sudo mvn clean install -DskipTests
sudo rm -rf /var/lib/OpenMRS/modules/kenyaemr-*.omod
sudo cp -r /apps/githubworkflows/kenyaemr-modules/openmrs-module-kenyaemr-machine-learning/omod/target/kenyaemr-*.omod /var/lib/OpenMRS/modules/
sudo chown -R tomcat:tomcat /var/lib/OpenMRS/modules/
sudo chmod +r /var/lib/OpenMRS/modules/*.omod
sudo chmod 755 /var/lib/OpenMRS/modules/*.omod
sudo service tomcat9 restart

0 comments on commit 4cc0cee

Please sign in to comment.