Feature/time source #10
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 | |
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 | |
submodules: recursive | |
- name: Move source code | |
run: mv $GITHUB_WORKSPACE/${{ github.event.repository.name }} /home/carma-cloud | |
- name: Install dependencies | |
run: | | |
/home/carma-cloud/scripts/install_dependencies.sh | |
- name: Build | |
run: | | |
/home/carma-cloud/scripts/build.sh | |
- name: Configure network and set privileges | |
run: | | |
sed -i '/<\/Engine>/ i \ \ \ \ \ <Host name="carmacloud" appBase="webapps/carmacloud" unpackWARs="false" autoDeploy="false">\n </Host>' /opt/tomcat/conf/server.xml | |
echo -e '127.0.0.1\tcarmacloud' | sudo tee -a /etc/hosts | |
sudo groupadd tomcat | |
sudo useradd -g tomcat -m tomcat | |
chmod g+r /opt/tomcat/conf/* | |
chmod -R o-rwx tomcat/webapps/* | |
sudo chown -R root:tomcat /opt/tomcat | |
sudo chown -R tomcat:tomcat /opt/tomcat/logs | |
sudo chown -R tomcat:tomcat /opt/tomcat/temp | |
sudo chown -R tomcat:tomcat /opt/tomcat/work | |
- name: Start Tomcat and verify deployment | |
run: | | |
sudo /opt/tomcat/bin/catalina.sh start | |
sleep 10 | |
if [[ `sudo 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 |