Skip to content

Commit

Permalink
ci deploy 1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hqnghi88 committed Oct 2, 2021
1 parent 3a998b9 commit 7c31afb
Show file tree
Hide file tree
Showing 19 changed files with 749 additions and 648 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/github-travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,25 @@ jobs:
- name: Set up JDK 15
uses: actions/setup-java@v2
with:
distribution: 'adopt'
distribution: 'adopt-openj9'
java-version: '15'
java-package: jdk

- name: Prepare build
run: |
echo "MAVEN_OPTS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2048m'" >> ~/.mavenrc
sudo chmod +x $GITHUB_WORKSPACE/*.sh
bash custom_mvn.sh
cat ~/.m2/settings.xml
env:
MSG: ${ github.event.head_commit.message }
SSH_USER_PWD: ${{ secrets.USER_PWD }}
SSH_HOST: ${{ secrets.SSH_HOST }}
GITHUB_TOKEN: ${{ github.token }}
SSHPASS: ${{ secrets.USER_PWD }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
TRAVIS_COMMIT: ${ GITHUB_SHA }
TRAVIS_EVENT_TYPE: ${{ github.event_name }}

- name: Cache local Maven repository
uses: actions/cache@v2
Expand All @@ -39,11 +47,19 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
shell: bash
run: $GITHUB_WORKSPACE/travis_build.sh
- name: Build with Maven
run: |
bash decrypt_secret.sh
bash $GITHUB_WORKSPACE/travis_build.sh
env:
MSG: ${ github.event.head_commit.message }
MSG: ${ github.event.head_commit.message }
SSH_USER_PWD: ${{ secrets.USER_PWD }}
SSH_HOST: ${{ secrets.SSH_HOST }}
GITHUB_TOKEN: ${{ github.token }}
SSHPASS: ${{ secrets.USER_PWD }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
TRAVIS_COMMIT: ${ GITHUB_SHA }
TRAVIS_EVENT_TYPE: ${{ github.event_name }}

- name: Publish to Github
shell: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
**********************************************************************************************/
package cict.gama.extensions.websocket;

import ummisco.gama.ui.utils.PlatformHelper;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
Expand Down Expand Up @@ -61,10 +59,10 @@
import msi.gama.precompiler.GamlAnnotations.doc;
import msi.gama.runtime.GAMA;
import msi.gama.runtime.IScope;
import msi.gama.runtime.PlatformHelper;
import msi.gaml.expressions.IExpression;
import msi.gaml.operators.Cast;
import ummisco.gama.dev.utils.DEBUG;
import ummisco.gama.ui.utils.PlatformHelper;
import ummisco.gama.ui.utils.WorkbenchHelper;
import ummisco.gama.ui.views.displays.DisplaySurfaceMenu;

Expand Down Expand Up @@ -213,27 +211,27 @@ public void dispatchKeyEvent(final char e) {
}
}

@Override
public void setMousePosition(final int xm, final int ym) {
final int x = PlatformHelper.autoScaleUp(xm);
final int y = PlatformHelper.autoScaleUp(ym);
if (mousePosition == null) {
mousePosition = new Point(x, y);
} else {
mousePosition.setLocation(x, y);
}
}

@Override
public void draggedTo(final int x, final int y) {
final Point origin = getOrigin();
setOrigin(origin.x + PlatformHelper.autoScaleUp(x) - getMousePosition().x, origin.y + PlatformHelper.autoScaleUp(y) - getMousePosition().y);
DEBUG.OUT("Translation on X : " + (PlatformHelper.autoScaleUp(x) - getMousePosition().x) + " | on Y : "
+ (PlatformHelper.autoScaleUp(y) - getMousePosition().y));
DEBUG.OUT("Old Origin = " + origin + " | New Origin = " + getOrigin());
setMousePosition(x, y);
updateDisplay(true);
}
// @Override
// public void setMousePosition(final int xm, final int ym) {
// final int x = PlatformHelper.autoScaleUp(xm);
// final int y = PlatformHelper.autoScaleUp(ym);
// if (mousePosition == null) {
// mousePosition = new Point(x, y);
// } else {
// mousePosition.setLocation(x, y);
// }
// }
//
// @Override
// public void draggedTo(final int x, final int y) {
// final Point origin = getOrigin();
// setOrigin(origin.x + PlatformHelper.autoScaleUp(x) - getMousePosition().x, origin.y + PlatformHelper.autoScaleUp(y) - getMousePosition().y);
// DEBUG.OUT("Translation on X : " + (PlatformHelper.autoScaleUp(x) - getMousePosition().x) + " | on Y : "
// + (PlatformHelper.autoScaleUp(y) - getMousePosition().y));
// DEBUG.OUT("Old Origin = " + origin + " | New Origin = " + getOrigin());
// setMousePosition(x, y);
// updateDisplay(true);
// }

public void setMousePosition(final Point point) {
mousePosition = point;
Expand Down Expand Up @@ -800,14 +798,26 @@ public boolean isDisposed() {
return disposed;
}

// @Override
// public Font computeFont(final Font f) {
// if (f == null) { return null; }
// if (PlatformHelper.isWindows() && PlatformHelper.isHiDPI()) {
// return f.deriveFont((float) PlatformHelper.autoScaleUp(f.getSize2D()));
// }
// return f;
//
// }

@Override
public Font computeFont(final Font f) {
if (f == null) { return null; }
if (PlatformHelper.isWindows() && PlatformHelper.isHiDPI()) {
return f.deriveFont((float) PlatformHelper.autoScaleUp(f.getSize2D()));
}
return f;
public void setMousePosition(int x, int y) {
// TODO Auto-generated method stub

}

@Override
public void draggedTo(int x, int y) {
// TODO Auto-generated method stub

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.awt.EventQueue;
import java.awt.Frame;

import msi.gama.runtime.PlatformHelper;
import javax.swing.JApplet;
import javax.swing.LayoutFocusTraversalPolicy;

Expand All @@ -27,8 +28,7 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;

import ummisco.gama.dev.utils.DEBUG;
import ummisco.gama.ui.utils.PlatformHelper;
import ummisco.gama.dev.utils.DEBUG;
import ummisco.gama.ui.utils.WorkbenchHelper;

public abstract class WebSwingControl extends Composite {
Expand Down
5 changes: 1 addition & 4 deletions custom_mvn.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/bin/sh



sed -i "s/<\/settings>/<mirrors><mirror><id>insecure-repo<\/id><mirrorOf>p2Repo<\/mirrorOf><url>http:\/\/51.255.46.42\/updates\/v1.8.2<\/url><blocked>false<\/blocked><\/mirror><mirror><id>insecure-buchen-maven-repo<\/id><mirrorOf>buchen-maven-repo<\/mirrorOf><url>http:\/\/buchen.github.io\/maven-repo<\/url><blocked>false<\/blocked><\/mirror><\/mirrors><\/settings>/" ~/.m2/settings.xml
sed -i "s/<\/settings>/<mirrors><mirror><id>insecure-repo<\/id><mirrorOf>p2Repo<\/mirrorOf><url>http:\/\/updates.gama-platform.org\/1.8.2<\/url><blocked>false<\/blocked><\/mirror><mirror><id>insecure-repoip<\/id><mirrorOf>p2Repo<\/mirrorOf><url>http:\/\/$SSH_HOST<\/url><blocked>false<\/blocked><\/mirror><mirror><id>insecure-repoexp<\/id><mirrorOf>p2Repo<\/mirrorOf><url>http:\/\/updates.gama-platform.org\/experimental\/1.8.2<\/url><blocked>false<\/blocked><\/mirror><mirror><id>insecure-buchen-maven-repo<\/id><mirrorOf>buchen-maven-repo<\/mirrorOf><url>http:\/\/buchen.github.io\/maven-repo<\/url><blocked>false<\/blocked><\/mirror><mirror><id>maven-default-http-blocker<\/id><mirrorOf>external:http:*<\/mirrorOf><url>http:\/\/0.0.0.0\/<\/url><blocked>false<\/blocked><\/mirror><\/mirrors><\/settings>/" ~/.m2/settings.xml
23 changes: 19 additions & 4 deletions decrypt_secret.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/bin/sh
gpg --quiet --batch --yes --decrypt --passphrase="$SSH_USER_PWD" --output settings_auth.xml settings_auth.xml.gpg

# Decrypt the file
# --batch to prevent interactive command
# --yes to assume "yes" for questions
gpg --quiet --batch --yes --decrypt --passphrase="$SSH_USER_PWD" --output settings_auth.xml settings_auth.xml.gpg

header=$(<$GITHUB_WORKSPACE/settings_header.xml)
core=$(<$GITHUB_WORKSPACE/settings_auth.xml)
footer=$(<$GITHUB_WORKSPACE/settings_footer.xml)
echo "$header $core $footer"> $GITHUB_WORKSPACE/settings.xml


echo "DEPLOY"
mkdir -m 0700 -p ~/.ssh
chmod 750 ~
chmod 700 ~/.ssh
echo -e "Host *\n" >> ~/.ssh/config
echo -e "IdentitiesOnly yes\n" >> ~/.ssh/config
echo -e "Port 22\n" >> ~/.ssh/config
echo -e "StrictHostKeyChecking no\n" >> ~/.ssh/config
echo -e "PubkeyAuthentication no\n" >> ~/.ssh/config
cat ~/.ssh/config
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
8 changes: 4 additions & 4 deletions msi.gama.experimental.p2updatesite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
</parent>
<artifactId>msi.gama.experimental.p2updatesite</artifactId>
<packaging>eclipse-repository</packaging>


<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>p2Repo</id>
<url>scp://51.255.46.42/./var/www/gama_updates/experimental/v1.8.2</url>
<url>scp://51.255.46.42/./var/www/gama_updates/experimental/1.8.2</url>
</repository>
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>p2Repo</id>
<url>scp://51.255.46.42/./var/www/gama_updates/experimental/v1.8.2</url>
<url>scp://51.255.46.42/./var/www/gama_updates/experimental/1.8.2</url>
</snapshotRepository>
</distributionManagement>

Expand All @@ -34,7 +34,7 @@
<properties>
<!-- Properties relative to the distant host where to upload the repo -->
<ftp.url>scp://51.255.46.42</ftp.url>
<ftp.toDir>./var/www/gama_updates/experimental/v1.8.2</ftp.toDir>
<ftp.toDir>./var/www/gama_updates/experimental/1.8.2</ftp.toDir>
<!-- Relative path to the repo being uploaded -->
<repo.path>${project.build.directory}/repository/</repo.path>
</properties>
Expand Down
Loading

0 comments on commit 7c31afb

Please sign in to comment.