2021-10-15 06:17:05 +00:00
|
|
|
const os = require('os');
|
|
|
|
const loadGruntTasks = require('load-grunt-tasks');
|
2019-03-21 05:46:49 +00:00
|
|
|
const webpackDevConfig = require('./webpack/webpack.develop');
|
|
|
|
const webpackProdConfig = require('./webpack/webpack.production');
|
2021-09-30 09:00:54 +00:00
|
|
|
const webpackTestingConfig = require('./webpack/webpack.testing');
|
2019-09-09 00:40:22 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
let arch = os.arch();
|
|
|
|
if (arch === 'x64') {
|
|
|
|
arch = 'amd64';
|
|
|
|
}
|
2022-07-03 22:43:11 +00:00
|
|
|
let platform = os.platform();
|
|
|
|
switch (platform) {
|
|
|
|
case 'windows':
|
|
|
|
case 'darwin':
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
platform = 'linux';
|
|
|
|
}
|
2019-09-09 00:40:22 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
module.exports = function (grunt) {
|
2017-10-18 15:46:56 +00:00
|
|
|
loadGruntTasks(grunt, {
|
2020-04-10 21:54:53 +00:00
|
|
|
pattern: ['grunt-*', 'gruntify-*'],
|
2017-10-18 15:46:56 +00:00
|
|
|
});
|
2017-07-12 09:28:51 +00:00
|
|
|
|
2019-09-09 00:40:22 +00:00
|
|
|
grunt.initConfig({
|
|
|
|
root: 'dist',
|
|
|
|
distdir: 'dist/public',
|
2020-07-05 23:21:03 +00:00
|
|
|
binaries: {
|
2022-06-03 01:50:37 +00:00
|
|
|
dockerVersion: 'v20.10.9',
|
|
|
|
dockerComposePluginVersion: 'v2.5.1',
|
|
|
|
helmVersion: 'v3.9.0',
|
2021-01-18 00:02:16 +00:00
|
|
|
komposeVersion: 'v1.22.0',
|
2022-06-03 01:50:37 +00:00
|
|
|
kubectlVersion: 'v1.24.1',
|
2020-07-05 23:21:03 +00:00
|
|
|
},
|
2021-10-15 06:17:05 +00:00
|
|
|
env: gruntConfig.env,
|
|
|
|
clean: gruntConfig.clean,
|
|
|
|
shell: gruntConfig.shell,
|
|
|
|
webpack: gruntConfig.webpack,
|
2019-09-09 00:40:22 +00:00
|
|
|
});
|
2019-03-21 05:46:49 +00:00
|
|
|
|
2019-09-09 00:40:22 +00:00
|
|
|
grunt.registerTask('lint', ['eslint']);
|
2019-03-21 05:46:49 +00:00
|
|
|
|
2022-07-03 22:43:11 +00:00
|
|
|
grunt.task.registerTask('build:server', 'build:server:<platform>:<arch>', function (p = platform, a = arch) {
|
|
|
|
grunt.task.run([`shell:build_binary:${p}:${a}`, `download_binaries:${p}:${a}`]);
|
|
|
|
});
|
2020-04-10 21:54:53 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
grunt.registerTask('build:client', ['webpack:dev']);
|
2020-04-10 21:54:53 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
grunt.registerTask('build', ['build:server', 'build:client']);
|
2020-04-10 21:54:53 +00:00
|
|
|
|
2022-07-03 22:43:11 +00:00
|
|
|
grunt.registerTask('start:server', ['build:server:linux', 'shell:run_container']);
|
2020-04-10 21:54:53 +00:00
|
|
|
|
2022-07-03 22:43:11 +00:00
|
|
|
grunt.registerTask('start:localserver', [`shell:build_binary:${platform}:${arch}`, 'shell:run_localserver']);
|
2020-06-17 01:36:11 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
grunt.registerTask('start:client', ['shell:install_yarndeps', 'webpack:devWatch']);
|
2020-04-10 21:54:53 +00:00
|
|
|
|
|
|
|
grunt.registerTask('start', ['start:server', 'start:client']);
|
|
|
|
|
2020-06-17 01:36:11 +00:00
|
|
|
grunt.registerTask('start:toolkit', ['start:localserver', 'start:client']);
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
grunt.task.registerTask('release', 'release:<platform>:<arch>', function (platform = 'linux', a = arch) {
|
|
|
|
grunt.task.run(['env:prod', 'clean:all', `shell:build_binary:${platform}:${a}`, `download_binaries:${platform}:${a}`, 'webpack:prod']);
|
2020-04-10 21:54:53 +00:00
|
|
|
});
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
grunt.task.registerTask('devopsbuild', 'devopsbuild:<platform>:<arch>:<env>', function (platform, a = arch, env = 'prod') {
|
2021-11-03 10:41:59 +00:00
|
|
|
grunt.task.run([
|
|
|
|
`env:${env}`,
|
|
|
|
'clean:all',
|
|
|
|
`shell:build_binary_azuredevops:${platform}:${a}`,
|
|
|
|
`download_binaries:${platform}:${a}`,
|
|
|
|
`webpack:${env}`,
|
|
|
|
`shell:storybook:${env}`,
|
|
|
|
]);
|
2021-10-15 06:17:05 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
grunt.task.registerTask('download_binaries', 'download_binaries:<platform>:<arch>', function (platform = 'linux', a = arch) {
|
2020-04-10 21:54:53 +00:00
|
|
|
grunt.task.run([
|
2021-10-15 06:17:05 +00:00
|
|
|
`shell:download_docker_binary:${platform}:${a}`,
|
|
|
|
`shell:download_docker_compose_binary:${platform}:${a}`,
|
2021-10-19 21:02:30 +00:00
|
|
|
`shell:download_helm_binary:${platform}:${a}`,
|
2021-10-15 06:17:05 +00:00
|
|
|
`shell:download_kompose_binary:${platform}:${a}`,
|
|
|
|
`shell:download_kubectl_binary:${platform}:${a}`,
|
2020-04-10 21:54:53 +00:00
|
|
|
]);
|
|
|
|
});
|
2017-12-05 20:26:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/***/
|
2021-10-15 06:17:05 +00:00
|
|
|
const gruntConfig = {};
|
2017-12-05 20:26:45 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
gruntConfig.env = {
|
2019-03-21 05:46:49 +00:00
|
|
|
dev: {
|
2020-04-10 21:54:53 +00:00
|
|
|
NODE_ENV: 'development',
|
2019-03-21 05:46:49 +00:00
|
|
|
},
|
|
|
|
prod: {
|
2020-04-10 21:54:53 +00:00
|
|
|
NODE_ENV: 'production',
|
|
|
|
},
|
2021-08-10 22:45:53 +00:00
|
|
|
testing: {
|
|
|
|
NODE_ENV: 'testing',
|
|
|
|
},
|
2019-06-02 06:16:07 +00:00
|
|
|
};
|
2019-03-21 05:46:49 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
gruntConfig.webpack = {
|
2019-03-21 05:46:49 +00:00
|
|
|
dev: webpackDevConfig,
|
2019-09-09 00:40:22 +00:00
|
|
|
devWatch: Object.assign({ watch: true }, webpackDevConfig),
|
2020-04-10 21:54:53 +00:00
|
|
|
prod: webpackProdConfig,
|
2021-09-30 09:00:54 +00:00
|
|
|
testing: webpackTestingConfig,
|
2019-03-21 05:46:49 +00:00
|
|
|
};
|
2017-12-05 20:26:45 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
gruntConfig.clean = {
|
2019-09-09 00:40:22 +00:00
|
|
|
server: ['<%= root %>/portainer'],
|
|
|
|
client: ['<%= distdir %>/*'],
|
2018-07-28 14:12:24 +00:00
|
|
|
all: ['<%= root %>/*'],
|
2017-12-05 20:26:45 +00:00
|
|
|
};
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
gruntConfig.shell = {
|
2019-09-09 00:40:22 +00:00
|
|
|
build_binary: { command: shell_build_binary },
|
|
|
|
build_binary_azuredevops: { command: shell_build_binary_azuredevops },
|
|
|
|
download_docker_binary: { command: shell_download_docker_binary },
|
2022-06-03 01:50:37 +00:00
|
|
|
download_helm_binary: { command: shell_download_helm_binary },
|
2020-07-05 23:21:03 +00:00
|
|
|
download_kompose_binary: { command: shell_download_kompose_binary },
|
|
|
|
download_kubectl_binary: { command: shell_download_kubectl_binary },
|
2021-01-25 19:16:53 +00:00
|
|
|
download_docker_compose_binary: { command: shell_download_docker_compose_binary },
|
2020-04-10 21:54:53 +00:00
|
|
|
run_container: { command: shell_run_container },
|
2020-06-17 01:36:11 +00:00
|
|
|
run_localserver: { command: shell_run_localserver, options: { async: true } },
|
|
|
|
install_yarndeps: { command: shell_install_yarndeps },
|
2021-11-03 10:41:59 +00:00
|
|
|
storybook: { command: shell_storybook },
|
2019-09-09 00:40:22 +00:00
|
|
|
};
|
|
|
|
|
2021-11-03 10:41:59 +00:00
|
|
|
function shell_storybook(env) {
|
|
|
|
if (env === 'production') {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return `
|
|
|
|
yarn build-storybook
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
function shell_build_binary(platform, arch) {
|
|
|
|
const binfile = 'dist/portainer';
|
2021-11-24 14:05:59 +00:00
|
|
|
if (platform === 'linux' || platform === 'darwin') {
|
2021-10-15 06:17:05 +00:00
|
|
|
return `
|
|
|
|
if [ -f ${binfile} ]; then
|
|
|
|
echo "Portainer binary exists";
|
|
|
|
else
|
|
|
|
build/build_binary.sh ${platform} ${arch};
|
|
|
|
fi
|
|
|
|
`;
|
2019-01-30 22:37:16 +00:00
|
|
|
}
|
2021-10-15 06:17:05 +00:00
|
|
|
|
|
|
|
// windows
|
|
|
|
return `
|
|
|
|
powershell -Command "& {if (Get-Item -Path ${binfile}.exe -ErrorAction:SilentlyContinue) {
|
|
|
|
Write-Host "Portainer binary exists"
|
|
|
|
} else {
|
|
|
|
& ".\\build\\build_binary.ps1" -platform ${platform} -arch ${arch}
|
|
|
|
}}"
|
|
|
|
`;
|
2019-01-30 22:37:16 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
function shell_build_binary_azuredevops(platform, arch) {
|
|
|
|
return `build/build_binary_azuredevops.sh ${platform} ${arch};`;
|
2018-12-09 03:08:36 +00:00
|
|
|
}
|
|
|
|
|
2019-09-09 00:40:22 +00:00
|
|
|
function shell_run_container() {
|
2021-10-15 06:17:05 +00:00
|
|
|
const portainerData = '${PORTAINER_DATA:-/tmp/portainer}';
|
|
|
|
const portainerRoot = process.env.PORTAINER_PROJECT ? process.env.PORTAINER_PROJECT : process.env.PWD;
|
2021-11-24 02:45:42 +00:00
|
|
|
const portainerFlags = '${PORTAINER_FLAGS:-}';
|
2021-10-15 06:17:05 +00:00
|
|
|
|
|
|
|
return `
|
|
|
|
docker rm -f portainer
|
|
|
|
docker run -d \
|
|
|
|
-p 8000:8000 \
|
|
|
|
-p 9000:9000 \
|
|
|
|
-p 9443:9443 \
|
|
|
|
-v ${portainerRoot}/dist:/app \
|
|
|
|
-v ${portainerData}:/data \
|
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock:z \
|
|
|
|
-v /var/run/docker.sock:/var/run/alternative.sock:z \
|
|
|
|
-v /tmp:/tmp \
|
|
|
|
--name portainer \
|
|
|
|
portainer/base \
|
2021-11-24 02:45:42 +00:00
|
|
|
/app/portainer ${portainerFlags}
|
2021-10-15 06:17:05 +00:00
|
|
|
`;
|
2017-12-05 20:26:45 +00:00
|
|
|
}
|
|
|
|
|
2020-06-17 01:36:11 +00:00
|
|
|
function shell_run_localserver() {
|
2020-08-06 22:46:25 +00:00
|
|
|
return './dist/portainer';
|
2020-06-17 01:36:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function shell_install_yarndeps() {
|
|
|
|
return 'yarn';
|
|
|
|
}
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
function shell_download_docker_binary(platform, arch) {
|
2022-06-03 01:50:37 +00:00
|
|
|
const binaryVersion = '<%= binaries.dockerVersion %>';
|
2021-10-15 06:17:05 +00:00
|
|
|
|
|
|
|
return `
|
|
|
|
if [ -f dist/docker ] || [ -f dist/docker.exe ]; then
|
|
|
|
echo "docker binary exists";
|
|
|
|
else
|
2022-06-03 01:50:37 +00:00
|
|
|
build/download_docker_binary.sh ${platform} ${arch} ${binaryVersion};
|
2021-10-15 06:17:05 +00:00
|
|
|
fi
|
|
|
|
`;
|
2017-12-05 20:26:45 +00:00
|
|
|
}
|
2020-07-05 23:21:03 +00:00
|
|
|
|
2022-06-03 01:50:37 +00:00
|
|
|
function shell_download_docker_compose_binary(platform, arch) {
|
|
|
|
var binaryVersion = '<%= binaries.dockerComposePluginVersion %>';
|
2021-09-06 07:58:26 +00:00
|
|
|
|
|
|
|
return `
|
2022-06-03 01:50:37 +00:00
|
|
|
if [ -f dist/docker-compose.plugin ] || [ -f dist/docker-compose.plugin.exe ]; then
|
2022-06-03 02:21:55 +00:00
|
|
|
echo "docker compose binary exists";
|
2021-09-06 07:58:26 +00:00
|
|
|
else
|
2022-06-03 01:50:37 +00:00
|
|
|
build/download_docker_compose_binary.sh ${platform} ${arch} ${binaryVersion};
|
|
|
|
fi
|
|
|
|
`;
|
2021-01-25 19:16:53 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
function shell_download_helm_binary(platform, arch) {
|
feat(helm/templates): helm app templates EE-943 (#5449)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm): list and configure helm chart (#5431)
* backport and tidyup code
* --amend
* using rocket icon for charts
* helm chart bugfix - clear category button
* added matomo analytics for helm chart install
* fix web editor exit warning without changes
* editor modified exit bugfix
* fixed notifications typo
* updated helm template text
* helper text to convey slow helm templates load
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* removing redundant time-consuming api call by using prop attribute
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* bugfix: kubectl shell not opening - bearer token bug
* tidy go modules & remove yarn-error.log
* removed redundant handler (not used) - to match EE
* resolved merge conflicts, updated code
* feat(helm/views): helm release and application views EE-1236 (#5529)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* removed redundant handler (not used) - to match EE
* feat(helm) display helm charts - backend EE-1236
* copy over components for new applications view EE-1236
* Add new applications datatable component
* Add more migrated files
* removed test not applicable to CE
* baclkported EE app data table code to CE
* removed redundant helm repo url
* resolved conflicts, updated code
* using endpoint middleware
* PR review fixes
* using constants, openapi updated
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* fixed test conflicts, go linted
* feat(helm/templates-add): helm templates add repo for user support EE-1278 (#5514)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* backport EE-1278, squashed, diffed, updated
* helm install openapi spec update
* resolved conflicts, updated code
* - matching ee codebase at 0afe57034449ee0e9f333d92c252a13995a93019
- helm install using endpoint middleware
- remove trailing slash from added/persisted helm repo urls
* feat(helm) use libhelm url validator and improved path assembly EE-1554 (#5561)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562 (#5567)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562
* post review changes and further backported changes from EE
* resolved conflicts, updated code
* fixed helm_install handler unit test
* user cannot add existing repo if suffix is '/' (#5571)
* feat(helm/docs) fix broken swagger docs EE-1278 (#5572)
* Fix swagger docs
* minor correction
* fix(helm): migrating code from user handler to helm handler (#5573)
* - migrated user_helm_repos to helm endpoint handler
- migrated api operations from user factory/service to helm factory/service
- passing endpointId into helm service/factory as endpoint provider is deprecated
* upgrade libhelm to hide secrets
Co-authored-by: Matt Hook <hookenz@gmail.com>
* removed duplicate file - due to merge conflict
* dependency injection in helm factory
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
* kubernetes.templates -> kubernetes.templates.helm name conflict fix
* Validate the URL added as a public helm repo (#5579)
* fix(helm): helm app deletion fix EE-1581 (#5582)
* updated helm lib to show correct error on uninstall failure
* passing down helm app namespace on deletion
* fix(k8s): EE-1591 non-admin users cannot deploy charts containing secrets (#5590)
Co-authored-by: Simon Meng <simon.meng@portainer.io>
* fix(helm): helm epic bugfixes EE-1582 EE-1593 (#5585)
* - trim trailing slash and lowercase before persisting helm repo
- browser helm templates url /kubernetes/templates/templates -> /kubernetes/templates/helm
- fix publish url
- fix helm repo add refresh
- semi-fix k8s app expansion
* Tidy up swagger documentation related to helm. Make json consistent
* fixed helm release page for non-default namespaces
* k8s app view table expansion bugfix
* EE-1593: publish url load balancer fallback
Co-authored-by: Matt Hook <hookenz@gmail.com>
* k8s app list fix for charts with deployments containing multiple pods - which use the same label (#5599)
* fix(kubernetes): app list view fix for secrets with long keys or values EE-1600 (#5600)
* k8s app secrets key value text overflow ellipses
* wrapping key value pairs instead of ellipses
* fix(helm): helm apps bundling issue across different namespaces EE-1619 (#5602)
* helm apps bundling issue across different namespaces
* - code comments and indentation to ease reading
- moved namespace calc out of loop
* feat(helm/test) disable slow helm search test by default EE-1599 (#5598)
* skip helm_repo_search as it's an integration test
* switch to portainer built in integration test checker
* make module order match EE
* don't print test struct out when skipping integration test
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
Co-authored-by: cong meng <mcpacino@gmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-09-10 02:06:57 +00:00
|
|
|
var binaryVersion = '<%= binaries.helmVersion %>';
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
return `
|
|
|
|
if [ -f dist/helm ] || [ -f dist/helm.exe ]; then
|
|
|
|
echo "helm binary exists";
|
|
|
|
else
|
|
|
|
build/download_helm_binary.sh ${platform} ${arch} ${binaryVersion};
|
|
|
|
fi
|
|
|
|
`;
|
feat(helm/templates): helm app templates EE-943 (#5449)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm): list and configure helm chart (#5431)
* backport and tidyup code
* --amend
* using rocket icon for charts
* helm chart bugfix - clear category button
* added matomo analytics for helm chart install
* fix web editor exit warning without changes
* editor modified exit bugfix
* fixed notifications typo
* updated helm template text
* helper text to convey slow helm templates load
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* removing redundant time-consuming api call by using prop attribute
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* bugfix: kubectl shell not opening - bearer token bug
* tidy go modules & remove yarn-error.log
* removed redundant handler (not used) - to match EE
* resolved merge conflicts, updated code
* feat(helm/views): helm release and application views EE-1236 (#5529)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* removed redundant handler (not used) - to match EE
* feat(helm) display helm charts - backend EE-1236
* copy over components for new applications view EE-1236
* Add new applications datatable component
* Add more migrated files
* removed test not applicable to CE
* baclkported EE app data table code to CE
* removed redundant helm repo url
* resolved conflicts, updated code
* using endpoint middleware
* PR review fixes
* using constants, openapi updated
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* fixed test conflicts, go linted
* feat(helm/templates-add): helm templates add repo for user support EE-1278 (#5514)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* backport EE-1278, squashed, diffed, updated
* helm install openapi spec update
* resolved conflicts, updated code
* - matching ee codebase at 0afe57034449ee0e9f333d92c252a13995a93019
- helm install using endpoint middleware
- remove trailing slash from added/persisted helm repo urls
* feat(helm) use libhelm url validator and improved path assembly EE-1554 (#5561)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562 (#5567)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562
* post review changes and further backported changes from EE
* resolved conflicts, updated code
* fixed helm_install handler unit test
* user cannot add existing repo if suffix is '/' (#5571)
* feat(helm/docs) fix broken swagger docs EE-1278 (#5572)
* Fix swagger docs
* minor correction
* fix(helm): migrating code from user handler to helm handler (#5573)
* - migrated user_helm_repos to helm endpoint handler
- migrated api operations from user factory/service to helm factory/service
- passing endpointId into helm service/factory as endpoint provider is deprecated
* upgrade libhelm to hide secrets
Co-authored-by: Matt Hook <hookenz@gmail.com>
* removed duplicate file - due to merge conflict
* dependency injection in helm factory
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
* kubernetes.templates -> kubernetes.templates.helm name conflict fix
* Validate the URL added as a public helm repo (#5579)
* fix(helm): helm app deletion fix EE-1581 (#5582)
* updated helm lib to show correct error on uninstall failure
* passing down helm app namespace on deletion
* fix(k8s): EE-1591 non-admin users cannot deploy charts containing secrets (#5590)
Co-authored-by: Simon Meng <simon.meng@portainer.io>
* fix(helm): helm epic bugfixes EE-1582 EE-1593 (#5585)
* - trim trailing slash and lowercase before persisting helm repo
- browser helm templates url /kubernetes/templates/templates -> /kubernetes/templates/helm
- fix publish url
- fix helm repo add refresh
- semi-fix k8s app expansion
* Tidy up swagger documentation related to helm. Make json consistent
* fixed helm release page for non-default namespaces
* k8s app view table expansion bugfix
* EE-1593: publish url load balancer fallback
Co-authored-by: Matt Hook <hookenz@gmail.com>
* k8s app list fix for charts with deployments containing multiple pods - which use the same label (#5599)
* fix(kubernetes): app list view fix for secrets with long keys or values EE-1600 (#5600)
* k8s app secrets key value text overflow ellipses
* wrapping key value pairs instead of ellipses
* fix(helm): helm apps bundling issue across different namespaces EE-1619 (#5602)
* helm apps bundling issue across different namespaces
* - code comments and indentation to ease reading
- moved namespace calc out of loop
* feat(helm/test) disable slow helm search test by default EE-1599 (#5598)
* skip helm_repo_search as it's an integration test
* switch to portainer built in integration test checker
* make module order match EE
* don't print test struct out when skipping integration test
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
Co-authored-by: cong meng <mcpacino@gmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-09-10 02:06:57 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
function shell_download_kompose_binary(platform, arch) {
|
|
|
|
const binaryVersion = '<%= binaries.komposeVersion %>';
|
2021-08-26 00:05:28 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
return `
|
|
|
|
if [ -f dist/kompose ] || [ -f dist/kompose.exe ]; then
|
|
|
|
echo "kompose binary exists";
|
|
|
|
else
|
|
|
|
build/download_kompose_binary.sh ${platform} ${arch} ${binaryVersion};
|
|
|
|
fi
|
|
|
|
`;
|
2020-07-05 23:21:03 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
function shell_download_kubectl_binary(platform, arch) {
|
2020-07-05 23:21:03 +00:00
|
|
|
var binaryVersion = '<%= binaries.kubectlVersion %>';
|
2021-08-26 00:05:28 +00:00
|
|
|
|
2021-10-15 06:17:05 +00:00
|
|
|
return `
|
|
|
|
if [ -f dist/kubectl ] || [ -f dist/kubectl.exe ]; then
|
|
|
|
echo "kubectl binary exists";
|
|
|
|
else
|
|
|
|
build/download_kubectl_binary.sh ${platform} ${arch} ${binaryVersion};
|
|
|
|
fi
|
|
|
|
`;
|
2020-07-05 23:21:03 +00:00
|
|
|
}
|