fix: Add visible Rsync CMD for debugging
This commit is contained in:
		
							parent
							
								
									4f233a7f45
								
							
						
					
					
						commit
						91b6d280ae
					
				
							
								
								
									
										24
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							@ -12,7 +12,7 @@ on:
 | 
			
		||||
      EXCLUDE:
 | 
			
		||||
        description: 'EXCLUDE'
 | 
			
		||||
        required: true
 | 
			
		||||
        default: '/dist/, /node_modules/'
 | 
			
		||||
        default: 'skip_dir/, /node_modules/'
 | 
			
		||||
      SSH_CMD_ARGS:
 | 
			
		||||
        description: 'SSH_CMD_ARGS'
 | 
			
		||||
        required: true
 | 
			
		||||
@ -63,15 +63,18 @@ jobs:
 | 
			
		||||
 | 
			
		||||
      - name: Create project file
 | 
			
		||||
        run: |
 | 
			
		||||
          mkdir test_project
 | 
			
		||||
          cd test_project
 | 
			
		||||
          mkdir test_project && cd "$_"
 | 
			
		||||
          touch index.html
 | 
			
		||||
          truncate -s 50MB image.svg
 | 
			
		||||
          truncate -s 5MB text.txt
 | 
			
		||||
          truncate -s 500MB big_file.txt
 | 
			
		||||
          date +"%Y-%m-%d %H:%M:%S,%3N" >> index.html
 | 
			
		||||
          truncate -s 50MB image.svg
 | 
			
		||||
          truncate -s 5MB info.txt
 | 
			
		||||
          truncate -s 500MB big_file.txt
 | 
			
		||||
          mkdir skip_dir && cd "$_"
 | 
			
		||||
          truncate -s 5MB text_in_skip_dir.txt
 | 
			
		||||
          cd ../
 | 
			
		||||
          cat index.html
 | 
			
		||||
          ls -l
 | 
			
		||||
          echo "test_project: \n" && ls -l
 | 
			
		||||
          echo "skip_dir: \n" && ls -l skip_dir
 | 
			
		||||
 | 
			
		||||
      - name: e2e Test published ssh-deploy action
 | 
			
		||||
        uses: easingthemes/ssh-deploy@main
 | 
			
		||||
@ -84,11 +87,10 @@ jobs:
 | 
			
		||||
          SSH_CMD_ARGS: ${{ github.event.inputs.SSH_CMD_ARGS || '-o StrictHostKeyChecking=no, -o UserKnownHostsFile=/dev/null' }}
 | 
			
		||||
          SOURCE: "test_project/"
 | 
			
		||||
          TARGET: "/var/www/html/"
 | 
			
		||||
          EXCLUDE: ${{ github.event.inputs.EXCLUDE || '/dist/, /node_modules/' }}
 | 
			
		||||
          EXCLUDE: ${{ github.event.inputs.EXCLUDE || 'skip_dir/, /node_modules/' }}
 | 
			
		||||
          SCRIPT_BEFORE: |
 | 
			
		||||
            whoami
 | 
			
		||||
            ls -al
 | 
			
		||||
            ls -al /var/www/html/
 | 
			
		||||
          SCRIPT_AFTER: |
 | 
			
		||||
            whoami
 | 
			
		||||
            ls -al
 | 
			
		||||
            ls -al /var/www/html/
 | 
			
		||||
            echo $RSYNC_STDOUT
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -2,6 +2,12 @@ const { execSync } = require('child_process');
 | 
			
		||||
const nodeRsync = require('rsyncwrapper');
 | 
			
		||||
 | 
			
		||||
const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
 | 
			
		||||
  const logCMD = (cmd) => {
 | 
			
		||||
    console.warn('================================================================');
 | 
			
		||||
    console.log(cmd);
 | 
			
		||||
    console.warn('================================================================');
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  try {
 | 
			
		||||
    nodeRsync(config, (error, stdout, stderr, cmd) => {
 | 
			
		||||
      if (error) {
 | 
			
		||||
@ -11,10 +17,12 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
 | 
			
		||||
        console.error(stderr);
 | 
			
		||||
        console.error('❌️ [Rsync] stdout: ');
 | 
			
		||||
        console.error(stdout);
 | 
			
		||||
        console.error('❌ [Rsync] cmd: ', cmd);
 | 
			
		||||
        console.error('❌ [Rsync] command: ');
 | 
			
		||||
        logCMD(cmd);
 | 
			
		||||
        reject(new Error(`${error.message}\n\n${stderr}`));
 | 
			
		||||
      } else {
 | 
			
		||||
        console.log('⭐ [Rsync] cmd finished: ', cmd);
 | 
			
		||||
        console.log('⭐ [Rsync] command finished: ');
 | 
			
		||||
        logCMD(cmd);
 | 
			
		||||
        resolve(stdout);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user