mirror of https://github.com/portainer/portainer
				
				
				
			fix(download):update the downloads files directory EE-2473 (#6734)
* update the downloads files directorypull/6620/head
							parent
							
								
									69c34cdf0c
								
							
						
					
					
						commit
						da9ef7dfcf
					
				| 
						 | 
					@ -19,7 +19,7 @@ export function EdgeScriptForm({ edgeKey, edgeId }: Props) {
 | 
				
			||||||
    envVars: '',
 | 
					    envVars: '',
 | 
				
			||||||
    edgeIdGenerator: '',
 | 
					    edgeIdGenerator: '',
 | 
				
			||||||
    os: 'linux',
 | 
					    os: 'linux',
 | 
				
			||||||
    platform: 'swarm',
 | 
					    platform: 'k8s',
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const settingsQuery = useSettings((settings) => settings.AgentSecret);
 | 
					  const settingsQuery = useSettings((settings) => settings.AgentSecret);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,6 +10,11 @@ import { EdgeProperties, Platform } from './types';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const commandsByOs = {
 | 
					const commandsByOs = {
 | 
				
			||||||
  linux: [
 | 
					  linux: [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      id: 'k8s',
 | 
				
			||||||
 | 
					      label: 'Kubernetes',
 | 
				
			||||||
 | 
					      command: buildKubernetesCommand,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      id: 'swarm',
 | 
					      id: 'swarm',
 | 
				
			||||||
      label: 'Docker Swarm',
 | 
					      label: 'Docker Swarm',
 | 
				
			||||||
| 
						 | 
					@ -20,11 +25,6 @@ const commandsByOs = {
 | 
				
			||||||
      label: 'Docker Standalone',
 | 
					      label: 'Docker Standalone',
 | 
				
			||||||
      command: buildLinuxStandaloneCommand,
 | 
					      command: buildLinuxStandaloneCommand,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      id: 'k8s',
 | 
					 | 
				
			||||||
      label: 'Kubernetes',
 | 
					 | 
				
			||||||
      command: buildKubernetesCommand,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  win: [
 | 
					  win: [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -67,7 +67,7 @@ export function Scripts({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  useEffect(() => {
 | 
					  useEffect(() => {
 | 
				
			||||||
    if (!commandsByOs[os].find((p) => p.id === platform)) {
 | 
					    if (!commandsByOs[os].find((p) => p.id === platform)) {
 | 
				
			||||||
      onPlatformChange('standalone');
 | 
					      onPlatformChange('swarm');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }, [os, platform, onPlatformChange]);
 | 
					  }, [os, platform, onPlatformChange]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -271,7 +271,7 @@ function buildKubernetesCommand(
 | 
				
			||||||
    ? `PORTAINER_EDGE_ID=$(${edgeIdScript}) \n\n`
 | 
					    ? `PORTAINER_EDGE_ID=$(${edgeIdScript}) \n\n`
 | 
				
			||||||
    : '';
 | 
					    : '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return `${idEnvVar}curl https://downloads.portainer.io/portainer-ee${agentShortVersion}-edge-agent-setup.sh | 
 | 
					  return `${idEnvVar}curl https://downloads.portainer.io/ce${agentShortVersion}/portainer-edge-agent-setup.sh | 
 | 
				
			||||||
  bash -s -- "${
 | 
					  bash -s -- "${
 | 
				
			||||||
    !edgeIdScript && edgeId ? edgeId : '$PORTAINER_EDGE_ID'
 | 
					    !edgeIdScript && edgeId ? edgeId : '$PORTAINER_EDGE_ID'
 | 
				
			||||||
  }" "${edgeKey}" "${allowSelfSignedCerts ? '1' : '0'}" "${agentSecret}"`;
 | 
					  }" "${edgeKey}" "${allowSelfSignedCerts ? '1' : '0'}" "${agentSecret}"`;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,8 +55,8 @@ angular
 | 
				
			||||||
      $scope.agentSecret = '';
 | 
					      $scope.agentSecret = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      $scope.deployCommands = {
 | 
					      $scope.deployCommands = {
 | 
				
			||||||
        kubeLoadBalancer: `curl -L https://downloads.portainer.io/portainer-agent-ce${agentShortVersion}-k8s-lb.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml`,
 | 
					        kubeLoadBalancer: `curl -L https://downloads.portainer.io/ce${agentShortVersion}/portainer-agent-k8s-lb.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml`,
 | 
				
			||||||
        kubeNodePort: `curl -L https://downloads.portainer.io/portainer-agent-ce${agentShortVersion}-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml`,
 | 
					        kubeNodePort: `curl -L https://downloads.portainer.io/ce${agentShortVersion}/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml`,
 | 
				
			||||||
        agentLinux: agentLinuxSwarmCommand,
 | 
					        agentLinux: agentLinuxSwarmCommand,
 | 
				
			||||||
        agentWindows: agentWindowsSwarmCommand,
 | 
					        agentWindows: agentWindowsSwarmCommand,
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
export function getAgentShortVersion(agentVersion) {
 | 
					export function getAgentShortVersion(agentVersion) {
 | 
				
			||||||
  const numbers = agentVersion.split('.');
 | 
					  const numbers = agentVersion.split('.');
 | 
				
			||||||
  return numbers[0] + numbers[1];
 | 
					  return numbers[0] + '-' + numbers[1];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,8 +227,8 @@ export default class WizardDockerController {
 | 
				
			||||||
      const agentShortVersion = getAgentShortVersion(agentVersion);
 | 
					      const agentShortVersion = getAgentShortVersion(agentVersion);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.command = {
 | 
					      this.command = {
 | 
				
			||||||
        linuxCommand: `curl -L https://downloads.portainer.io/agent-stack-ce${agentShortVersion}.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent `,
 | 
					        linuxCommand: `curl -L https://downloads.portainer.io/ce${agentShortVersion}/agent-stack.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent `,
 | 
				
			||||||
        winCommand: `curl -L https://downloads.portainer.io/agent-stack-ce${agentShortVersion}-windows.yml -o agent-stack-windows.yml && docker stack deploy --compose-file=agent-stack-windows.yml portainer-agent `,
 | 
					        winCommand: `curl -L https://downloads.portainer.io/ce${agentShortVersion}/agent-stack-windows.yml -o agent-stack-windows.yml && docker stack deploy --compose-file=agent-stack-windows.yml portainer-agent `,
 | 
				
			||||||
        linuxSocket: `-v "/var/run/docker.sock:/var/run/docker.sock" `,
 | 
					        linuxSocket: `-v "/var/run/docker.sock:/var/run/docker.sock" `,
 | 
				
			||||||
        winSocket: `-v \.\pipe\docker_engine:\.\pipe\docker_engine `,
 | 
					        winSocket: `-v \.\pipe\docker_engine:\.\pipe\docker_engine `,
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -106,8 +106,8 @@ export default class WizardKubernetesController {
 | 
				
			||||||
      const agentShortVersion = getAgentShortVersion(agentVersion);
 | 
					      const agentShortVersion = getAgentShortVersion(agentVersion);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.command = {
 | 
					      this.command = {
 | 
				
			||||||
        loadBalancer: `curl -L https://downloads.portainer.io/portainer-agent-ce${agentShortVersion}-k8s-lb.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml `,
 | 
					        loadBalancer: `curl -L https://downloads.portainer.io/ce${agentShortVersion}/portainer-agent-k8s-lb.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml `,
 | 
				
			||||||
        nodePort: `curl -L https://downloads.portainer.io/portainer-agent-ce${agentShortVersion}-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml `,
 | 
					        nodePort: `curl -L https://downloads.portainer.io/ce${agentShortVersion}/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml `,
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue