mirror of
				https://github.com/docker/build-push-action.git
				synced 2025-11-04 08:20:55 +00:00 
			
		
		
		
	Fixed link to dockerfile
Signed-off-by: Jyotsna <Josh-01@github.com>
This commit is contained in:
		
					parent
					
						
							
								065688b98f
							
						
					
				
			
			
				commit
				
					
						c59c0cec43
					
				
			
		
					 3 changed files with 50 additions and 15 deletions
				
			
		| 
						 | 
					@ -147,8 +147,31 @@ describe('getArgs', () => {
 | 
				
			||||||
      [
 | 
					      [
 | 
				
			||||||
        'buildx',
 | 
					        'buildx',
 | 
				
			||||||
        'build',
 | 
					        'build',
 | 
				
			||||||
        '--label', 'org.opencontainers.image.source=https://github.com/docker/build-push-action.git',
 | 
					        '--platform', 'linux/amd64,linux/arm64',
 | 
				
			||||||
        '--label', 'dockerfile-path=./test/Dockerfile',
 | 
					        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
				
			||||||
 | 
					        '--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
 | 
				
			||||||
 | 
					        '--file', './test/Dockerfile',
 | 
				
			||||||
 | 
					        '--builder', 'builder-git-context-2',
 | 
				
			||||||
 | 
					        '--push',
 | 
				
			||||||
 | 
					        'https://github.com/docker/build-push-action.git#heads/master'
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    [
 | 
				
			||||||
 | 
					      '0.4.2',
 | 
				
			||||||
 | 
					      new Map<string, string>([
 | 
				
			||||||
 | 
					        ['context', 'https://github.com/docker/build-push-action.git#heads/master'],
 | 
				
			||||||
 | 
					        ['tag', 'localhost:5000/name/app:latest'],
 | 
				
			||||||
 | 
					        ['platforms', 'linux/amd64,linux/arm64'],
 | 
				
			||||||
 | 
					        ['secrets', 'GIT_AUTH_TOKEN=abcdefghijklmno=0123456789'],
 | 
				
			||||||
 | 
					        ['file', './test/Dockerfile'],
 | 
				
			||||||
 | 
					        ['builder', 'builder-git-context-2'],
 | 
				
			||||||
 | 
					        ['push', 'true'],
 | 
				
			||||||
 | 
					        ['trace-data', 'true']
 | 
				
			||||||
 | 
					      ]),
 | 
				
			||||||
 | 
					      [
 | 
				
			||||||
 | 
					        'buildx',
 | 
				
			||||||
 | 
					        'build',
 | 
				
			||||||
 | 
					        '--label', 'dockerfile-path=https://github.com/docker/build-push-action.git#test-jest/./test/Dockerfile',
 | 
				
			||||||
        '--platform', 'linux/amd64,linux/arm64',
 | 
					        '--platform', 'linux/amd64,linux/arm64',
 | 
				
			||||||
        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
					        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
				
			||||||
        '--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
 | 
					        '--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
 | 
				
			||||||
| 
						 | 
					@ -162,14 +185,13 @@ describe('getArgs', () => {
 | 
				
			||||||
      '0.4.2',
 | 
					      '0.4.2',
 | 
				
			||||||
      new Map<string, string>([
 | 
					      new Map<string, string>([
 | 
				
			||||||
        ['context', '.'],
 | 
					        ['context', '.'],
 | 
				
			||||||
        ['labels', 'org.opencontainers.image.source=UserProvidedSourceLabel'],
 | 
					        ['outputs', 'type=image,dest=./release-out'],
 | 
				
			||||||
        ['outputs', 'type=image,dest=./release-out']
 | 
					        ['trace-data', 'true']
 | 
				
			||||||
      ]),
 | 
					      ]),
 | 
				
			||||||
      [
 | 
					      [
 | 
				
			||||||
        'buildx',
 | 
					        'buildx',
 | 
				
			||||||
        'build',
 | 
					        'build',
 | 
				
			||||||
        '--label', 'org.opencontainers.image.source=UserProvidedSourceLabel',
 | 
					        '--label', 'dockerfile-path=https://github.com/docker/build-push-action.git#test-jest/Dockerfile',
 | 
				
			||||||
        '--label', 'dockerfile-path=Dockerfile',
 | 
					 | 
				
			||||||
        '--output', 'type=image,dest=./release-out',
 | 
					        '--output', 'type=image,dest=./release-out',
 | 
				
			||||||
        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
					        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
				
			||||||
        '--file', 'Dockerfile',
 | 
					        '--file', 'Dockerfile',
 | 
				
			||||||
| 
						 | 
					@ -180,13 +202,13 @@ describe('getArgs', () => {
 | 
				
			||||||
      '0.4.2',
 | 
					      '0.4.2',
 | 
				
			||||||
      new Map<string, string>([
 | 
					      new Map<string, string>([
 | 
				
			||||||
        ['context', '.'],
 | 
					        ['context', '.'],
 | 
				
			||||||
        ['outputs', 'type=registry,dest=./release-out']
 | 
					        ['outputs', 'type=registry,dest=./release-out'],
 | 
				
			||||||
 | 
					        ['trace-data', 'true']
 | 
				
			||||||
      ]),
 | 
					      ]),
 | 
				
			||||||
      [
 | 
					      [
 | 
				
			||||||
        'buildx',
 | 
					        'buildx',
 | 
				
			||||||
        'build',
 | 
					        'build',
 | 
				
			||||||
        '--label', 'org.opencontainers.image.source=https://github.com/docker/build-push-action.git',
 | 
					        '--label', 'dockerfile-path=https://github.com/docker/build-push-action.git#test-jest/Dockerfile',
 | 
				
			||||||
        '--label', 'dockerfile-path=Dockerfile',
 | 
					 | 
				
			||||||
        '--output', 'type=registry,dest=./release-out',
 | 
					        '--output', 'type=registry,dest=./release-out',
 | 
				
			||||||
        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
					        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
				
			||||||
        '--file', 'Dockerfile',
 | 
					        '--file', 'Dockerfile',
 | 
				
			||||||
| 
						 | 
					@ -197,14 +219,13 @@ describe('getArgs', () => {
 | 
				
			||||||
      '0.4.2',
 | 
					      '0.4.2',
 | 
				
			||||||
      new Map<string, string>([
 | 
					      new Map<string, string>([
 | 
				
			||||||
        ['context', '.'],
 | 
					        ['context', '.'],
 | 
				
			||||||
        ['labels', 'org.opencontainers.image.source=UserProvidedSourceLabel'],
 | 
					        ['load', 'true'],
 | 
				
			||||||
        ['load', 'true']
 | 
					        ['trace-data', 'true']
 | 
				
			||||||
      ]),
 | 
					      ]),
 | 
				
			||||||
      [
 | 
					      [
 | 
				
			||||||
        'buildx',
 | 
					        'buildx',
 | 
				
			||||||
        'build',
 | 
					        'build',
 | 
				
			||||||
        '--label', 'org.opencontainers.image.source=UserProvidedSourceLabel',
 | 
					        '--label', 'dockerfile-path=https://github.com/docker/build-push-action.git#test-jest/Dockerfile',
 | 
				
			||||||
        '--label', 'dockerfile-path=Dockerfile',
 | 
					 | 
				
			||||||
        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
					        '--iidfile', '/tmp/.docker-build-push-jest/iidfile',
 | 
				
			||||||
        '--file', 'Dockerfile',
 | 
					        '--file', 'Dockerfile',
 | 
				
			||||||
        '--load',
 | 
					        '--load',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										9
									
								
								dist/index.js
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								dist/index.js
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
					@ -12092,7 +12092,14 @@ function getInputs(defaultContext) {
 | 
				
			||||||
                userInputs.outputs.find(val => val.indexOf('type=image') > -1 || val.indexOf('type=registry') > -1))) {
 | 
					                userInputs.outputs.find(val => val.indexOf('type=image') > -1 || val.indexOf('type=registry') > -1))) {
 | 
				
			||||||
            //Add link to dockerfile as label
 | 
					            //Add link to dockerfile as label
 | 
				
			||||||
            let dockerfilePath = userInputs.file;
 | 
					            let dockerfilePath = userInputs.file;
 | 
				
			||||||
            let repoPath = defaultContext.replace('#head', '/blob');
 | 
					            let stringToReplace = '';
 | 
				
			||||||
 | 
					            if (defaultContext.indexOf('#heads')) {
 | 
				
			||||||
 | 
					                stringToReplace = '.git#heads';
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (defaultContext.indexOf('#tags')) {
 | 
				
			||||||
 | 
					                stringToReplace = '.git#tags';
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            let repoPath = defaultContext.replace(stringToReplace, '/blob');
 | 
				
			||||||
            userInputs.labels.push(`dockerfile-path=${repoPath}/${dockerfilePath}`);
 | 
					            userInputs.labels.push(`dockerfile-path=${repoPath}/${dockerfilePath}`);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return userInputs;
 | 
					        return userInputs;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,14 @@ export async function getInputs(defaultContext: string): Promise<Inputs> {
 | 
				
			||||||
  ) {
 | 
					  ) {
 | 
				
			||||||
    //Add link to dockerfile as label
 | 
					    //Add link to dockerfile as label
 | 
				
			||||||
    let dockerfilePath = userInputs.file;
 | 
					    let dockerfilePath = userInputs.file;
 | 
				
			||||||
    let repoPath = defaultContext.replace('#head', '/blob');
 | 
					    let stringToReplace = '';
 | 
				
			||||||
 | 
					    if (defaultContext.indexOf('#heads')) {
 | 
				
			||||||
 | 
					      stringToReplace = '.git#heads';
 | 
				
			||||||
 | 
					    } else if (defaultContext.indexOf('#tags')) {
 | 
				
			||||||
 | 
					      stringToReplace = '.git#tags';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let repoPath = defaultContext.replace(stringToReplace, '/blob');
 | 
				
			||||||
    userInputs.labels.push(`dockerfile-path=${repoPath}/${dockerfilePath}`);
 | 
					    userInputs.labels.push(`dockerfile-path=${repoPath}/${dockerfilePath}`);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue