Das Problem, mit dem ich konfrontiert bin, ist, dass die Kopierbefehle bei mir nicht funktionieren ein Fehler - cp: ungültige Option -- 'w'
Der Befehl zum Starten/Stoppen funktioniert jedoch ohne Probleme. Gibt es bitte eine Möglichkeit, dieses Problem zu beheben?
Code: Select all
displayName: "Deployment"
inputs:
sshEndpoint: $(serviceconnection)
runOptions: inline
inline: |
# Step 1: Backup the existing WAR file
echo "Backing up $WAR_FILE from $DEPLOY_DIR to $BACKUP_DIR..."
cp -p $DEPLOY_DIR/$WAR_FILE $BACKUP_DIR/
# Step 2: Stop the JBoss service
dzdo systemctl stop jboss.service
# Step 3: Deploy the new WAR file
echo "Deploying new $WAR_FILE from $MAIN_DIR to $DEPLOY_DIR..."
cp -p $MAIN_DIR/$WAR_FILE $DEPLOY_DIR/
# Step 4: Start the JBoss service
dzdo systemctl start jboss.service```