Skip to content

Merge pull request #307 from njorocs/migrate-contacts #81

Merge pull request #307 from njorocs/migrate-contacts

Merge pull request #307 from njorocs/migrate-contacts #81

Workflow file for this run

name: Test Deployments
on:
push:
branches: [ master, 2.x ]
jobs:
build:
name: deploying to 2.x instance
if: github.ref == 'refs/heads/2.x'
runs-on: ubuntu-latest
steps:
- name: executing remote connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.CICD_SECRET }}
port: ${{ secrets.PORT }}
command_timeout: 200m
# script: |
# cd /apps/github-workflows/kenyaemr-modules
# sudo rm -rf openmrs-module-kenyaemrhivtesting
# sudo mkdir openmrs-module-kenyaemrhivtesting
# sudo chown -R cicd2:cicd2 openmrs-module-kenyaemrhivtesting
# git config --global --add safe.directory /apps/github-workflows/kenyaemr-modules/openmrs-module-kenyaemrhivtesting
# git clone -b 2.x https://github.com/palladiumkenya/openmrs-module-kenyaemrhivtesting.git openmrs-module-kenyaemrhivtesting
# cd /apps/github-workflows/kenyaemr-modules/openmrs-module-kenyaemrhivtesting
# git status
# mvn clean install -DskipTests
# sudo rm -rf /var/lib/OpenMRS/modules/hivtestingservices-*.omod
# sudo cp /apps/github-workflows/kenyaemr-modules/openmrs-module-kenyaemrhivtesting/omod/target/hivtestingservices-*.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 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-kenyaemrhivtesting
sudo mkdir openmrs-module-kenyaemrhivtesting
sudo chown -R cicd:cicd openmrs-module-kenyaemrhivtesting
git config --global --add safe.directory /apps/githubworkflows/kenyaemr-modules/openmrs-module-kenyaemrhivtesting
cd /apps/githubworkflows/kenyaemr-modules/openmrs-module-kenyaemrhivtesting
git clone -b master https://github.com/palladiumkenya/openmrs-module-kenyaemrhivtesting.git .
git status
mvn license:format
sudo mvn clean install -DskipTests
sudo rm -rf /var/lib/OpenMRS/modules/hivtestingservices-*.omod
sudo cp /apps/githubworkflows/kenyaemr-modules/openmrs-module-kenyaemrhivtesting/omod/target/hivtestingservices-*.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