Sync dev to master (#63) #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- develop | |
- master | |
- "release/*" | |
pull_request: | |
types: [opened, synchronize, reopened] | |
name: Deployment Test | |
jobs: | |
deployment_test: | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:22.04 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Install git | |
# Installing git for checkout action | |
run: | | |
apt update | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get install -y git | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
path: ${{ github.event.repository.name }} | |
submodules: recursive | |
- name: Move source code | |
run: mv $GITHUB_WORKSPACE/${{ github.event.repository.name }} /home/carma-cloud | |
- name: Install dependencies | |
run: | | |
cd /home/carma-cloud/scripts | |
./install_dependencies.sh | |
- name: Build | |
run: | | |
cd /home/carma-cloud/scripts | |
./build.sh | |
- name: Configure network and set privileges | |
run: | | |
echo -e '127.0.0.1\tcarmacloud' | tee -a /etc/hosts | |
groupadd tomcat | |
useradd -g tomcat -m tomcat | |
chmod g+r /opt/tomcat/conf/* | |
chmod -R o-rwx /opt/tomcat/webapps/* | |
chown -R root:tomcat /opt/tomcat | |
chown -R tomcat:tomcat /opt/tomcat/logs | |
chown -R tomcat:tomcat /opt/tomcat/temp | |
chown -R tomcat:tomcat /opt/tomcat/work | |
- name: Start Tomcat and verify deployment | |
run: | | |
/opt/tomcat/bin/catalina.sh start | |
sleep 10 | |
if [[ `grep "startup in" /opt/tomcat/logs/catalina.out | wc -l` -ne "1" ]]; then exit 1; fi | |
if [[ `wget -O - http://carmacloud:8080 | grep "CARMAcloud Login" | wc -l` -ne "1" ]]; then exit 2; fi | |
if [[ `wget -O - --post-data="uname=ccadmin&pword=admin_testpw" http://carmacloud:8080/api/auth/login | grep "token" | wc -l` -ne "1" ]]; then exit 3; fi |