Skip to content

Adjust wellesley colors #30

Adjust wellesley colors

Adjust wellesley colors #30

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Sakai Server for Cypress
on:
push:
jobs:
sakai-deploy:
runs-on: ubuntu-20.04
env:
JAVA_OPTS: "-Dhttp.agent=Sakai -Xms2512m -Xmx2512m -Dsakai.cookieName=SAKAIID -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dsakai.demo=true -Djava.awt.headless=true --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --illegal-access=permit -Dsakai.demo=true"
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dmaven.wagon.http.retryHandler.count=2 -Dmaven.wagon.http.pool=true -Denforcer.skip
run: |
sudo systemctl start mysql.service
echo "127.0.0.1 repository.dev.java.net" | sudo tee -a /etc/hosts
echo "127.0.0.1 maven-repository.dev.java.net" | sudo tee -a /etc/hosts
echo "127.0.0.1 maven2-repository.dev.java.net" | sudo tee -a /etc/hosts
export TOMCAT_DIR=$PWD/tomcat
mkdir $TOMCAT_DIR
cd $TOMCAT_DIR
curl -s -o tomcat.tar.gz "https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.89/bin/apache-tomcat-9.0.89.tar.gz"
tar --strip-components=1 -xzf tomcat.tar.gz
git clone https://github.com/sakaiproject/nightly-config.git sakai
cp sakai/master.properties sakai/sakai.properties
sed -i 's:<Context>:<Context><JarScanner><JarScanFilter defaultPluggabilityScan="false" /></JarScanner>:g' conf/context.xml
sed -i 's:<Service name="Catalina">:<Service name="Catalina"><Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" />:g' conf/server.xml
mysql -u root -proot -e "create database sakai";
echo "[email protected]=jdbc:mysql://127.0.0.1:3306/sakai?useUnicode=true&characterEncoding=UTF-8&log=true&profileSQL=true" >> sakai/local.properties
echo "[email protected]=mysql" >> sakai/local.properties
echo "[email protected]=root" >> sakai/local.properties
echo "[email protected]=root" >> sakai/local.properties
echo "[email protected]=org.mariadb.jdbc.Driver" >> sakai/local.properties
echo "hibernate.dialect=org.hibernate.dialect.MySQL57InnoDBDialect" >> sakai/local.properties
echo "log.config=DEBUG.org.mariadb.jdbc" >> sakai/local.properties
cd ..
mvn --batch-mode -DskipTests install sakai:deploy-exploded -Dmaven.tomcat.home=$TOMCAT_DIR
cd library
scss_dir="src/skins/default/src/sass/themes"
images_dir="src/skins/default/images"
while IFS= read -r file; do
theme=${file##*/} # Extract the full filename
theme=${theme#_} # Remove leading underscore
theme=${theme%.scss} # Remove file extension
# Check if the theme image file exists
if [[ -f "src/skins/default/images/${theme}.png" ]]; then
# Copy it to the sakaiLogo.png
cp "src/skins/default/images/${theme}.png" "src/skins/default/images/sakaiLogo.png"
fi
mvn --batch-mode -o -DskipTests -Dmaven.tomcat.home=$TOMCAT_DIR install sakai:deploy-exploded -Dsakai.skin.target=$theme
done < <(find "$scss_dir" -name '_*.scss' -printf "%T@ %p\n" | sort -n | cut -d' ' -f2-)
# Most recent theme for testing
recent_theme=$(basename "$(git log -1 --format= --name-only --diff-filter=AM -- "library/src/skins/default/src/sass/themes/_*.scss")" .scss | sed 's/^_//')
echo "skin.default=$recent_theme" >> $TOMCAT_DIR/sakai/local.properties
cd $TOMCAT_DIR
bin/catalina.sh start
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: longsight-skins
path: tomcat/webapps/library/skin/
compression-level: 9
retention-days: 30
- name: Start cloudflared
run: |
curl -sL -o cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared.deb
cloudflared tunnel --url http://localhost:8443 &
sleep 1h