Skip to content
Snippets Groups Projects
Commit e404aa69 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

chore: Add opts to mvn deploy, remove verbose ssh

parent 5b0b94c2
No related branches found
No related tags found
1 merge request!35build: New dummy version for testing the pipeline
......@@ -180,7 +180,7 @@ deploy-to-production:
- echo "deploy $TMP_PATH/$WAR_FILE --force" > deploy.cli
- scp deploy.cli $SERVER_USER@$SERVER_IP:$TMP_PATH
# Find name of currently deployed application. Undeploy.
- CURRENTLY_DEPLOYED=$(ssh -vvv $SERVER_USER@$SERVER_IP "$CLI_PATH/jboss-cli.sh --user=$WILDFLY_ADMIN_USERNAME --password=$WILDFLY_ADMIN_PASSWORD --connect --commands=ls\ deployment | tr ' ' '\n' | grep VIPSCore-.*war")
- CURRENTLY_DEPLOYED=$(ssh $SERVER_USER@$SERVER_IP "$CLI_PATH/jboss-cli.sh --user=$WILDFLY_ADMIN_USERNAME --password=$WILDFLY_ADMIN_PASSWORD --connect --commands=ls\ deployment | tr ' ' '\n' | grep VIPSCore-.*war")
- echo $CURRENTLY_DEPLOYED
- if [ -n "$CURRENTLY_DEPLOYED" ]; then ssh $SERVER_USER@$SERVER_IP "$CLI_PATH/jboss-cli.sh --user=$WILDFLY_ADMIN_USERNAME --password=$WILDFLY_ADMIN_PASSWORD --connect --command='undeploy $CURRENTLY_DEPLOYED'"; fi
# Deploy war file using JBoss CLI and credentials given in CI/CD variables
......@@ -225,14 +225,8 @@ upload-and-tag-release:
# Find name of war file in target folder (built previously in build stage), exit if none exists
- WAR_FILE=$(find target -maxdepth 1 -type f -name "*.war" | sort -n | tail -1 | xargs basename)
- if [ -z "$WAR_FILE" ]; then echo "No war file found in target directory"; exit 1; fi
- echo "War file built in build job '$WAR_FILE'"
# Old way of deploying newly built war:
# - "./mvnw $MAVEN_POM_WITH_MODELS $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests"
# TRY THIS - MIGHT NOT WORK DUE TO MISSING repositoryId and url - https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html
- "./mvnw deploy:deploy-file -DpomFile=pom.xml -Dfile=target/$WAR_FILE -Durl=$MAVEN_PACKAGE_REGISTRY"
- echo "Deploy war file built in build job '$WAR_FILE'"
- "./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS deploy:deploy-file -DpomFile=pom.xml -Dfile=target/$WAR_FILE"
- git tag -a $RELEASE_TAG -m "Tag release ${RELEASE_TAG}"
- git push origin $RELEASE_TAG
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment