fix(download):update the downloads files directory EE-2473 (#6734)

* update the downloads files directory
pull/6620/head
sunportainer 2022-04-17 11:04:04 +08:00 committed by GitHub
parent 69c34cdf0c
commit da9ef7dfcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

View File

@ -19,7 +19,7 @@ export function EdgeScriptForm({ edgeKey, edgeId }: Props) {
envVars: '',
edgeIdGenerator: '',
os: 'linux',
platform: 'swarm',
platform: 'k8s',
});
const settingsQuery = useSettings((settings) => settings.AgentSecret);

View File

@ -10,6 +10,11 @@ import { EdgeProperties, Platform } from './types';
const commandsByOs = {
linux: [
{
id: 'k8s',
label: 'Kubernetes',
command: buildKubernetesCommand,
},
{
id: 'swarm',
label: 'Docker Swarm',
@ -20,11 +25,6 @@ const commandsByOs = {
label: 'Docker Standalone',
command: buildLinuxStandaloneCommand,
},
{
id: 'k8s',
label: 'Kubernetes',
command: buildKubernetesCommand,
},
],
win: [
{
@ -67,7 +67,7 @@ export function Scripts({
useEffect(() => {
if (!commandsByOs[os].find((p) => p.id === platform)) {
onPlatformChange('standalone');
onPlatformChange('swarm');
}
}, [os, platform, onPlatformChange]);
@ -271,7 +271,7 @@ function buildKubernetesCommand(
? `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 -- "${
!edgeIdScript && edgeId ? edgeId : '$PORTAINER_EDGE_ID'
}" "${edgeKey}" "${allowSelfSignedCerts ? '1' : '0'}" "${agentSecret}"`;

View File

@ -55,8 +55,8 @@ angular
$scope.agentSecret = '';
$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`,
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`,
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/ce${agentShortVersion}/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml`,
agentLinux: agentLinuxSwarmCommand,
agentWindows: agentWindowsSwarmCommand,
};

View File

@ -1,4 +1,4 @@
export function getAgentShortVersion(agentVersion) {
const numbers = agentVersion.split('.');
return numbers[0] + numbers[1];
return numbers[0] + '-' + numbers[1];
}

View File

@ -227,8 +227,8 @@ export default class WizardDockerController {
const agentShortVersion = getAgentShortVersion(agentVersion);
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 `,
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 `,
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/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" `,
winSocket: `-v \.\pipe\docker_engine:\.\pipe\docker_engine `,
};

View File

@ -106,8 +106,8 @@ export default class WizardKubernetesController {
const agentShortVersion = getAgentShortVersion(agentVersion);
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 `,
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 `,
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/ce${agentShortVersion}/portainer-agent-k8s-nodeport.yaml -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml `,
};
});
}