-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,19 +11,40 @@ on: | |
# branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
build: | ||
name: build and deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: Build with Maven | ||
run: | | ||
cd source | ||
mvn -Dcerberus.delivery.username=${{secrets.CERBERUS_DELIVERY_USERNAME}} -Dcerberus.delivery.password=${{secrets.CERBERUS_DELIVERY_PASSWORD}} clean deploy -Pdelivery-deploy --file pom.xml | ||
mvn --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean install --file pom.xml | ||
- name: Push file to core VM | ||
env: | ||
source-war: 'target/*.war' | ||
source-zip: 'target/*.zip' | ||
destination: '[email protected]:/opt/delivery/' | ||
run: | | ||
cd source | ||
echo "${{secrets.DEPLOY_KEY}}" > deploy_key | ||
chmod 600 ./deploy_key | ||
sudo rsync -chav \ | ||
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ | ||
${{env.source-war}} ${{env.destination}} | ||
sudo rsync -chav \ | ||
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ | ||
${{env.source-zip}} ${{env.destination}} | ||
- name: Deploy to QA | ||
run: | | ||
cd source | ||
echo "${{secrets.DEPLOY_KEY}}" > deploy_key | ||
chmod 600 ./deploy_key | ||
ssh -i ./deploy_key -o StrictHostKeyChecking=no [email protected] "/opt/bin/deployQA.sh /opt/delivery/`find -type f -name cerberus-core*war | sed 's/.\/target\///g'`" |