I have a Input file which I read in a env variable InputConf.
[ { "name": "administrators", "description": "Default group for DSS administrators", "sourceType": "LOCAL", "admin": true, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": false, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-se-npr", "description": "ElevatedSupport", "ldapGroupNames": "dss-se-npr", "sourceType": "LDAP", "admin": true, "mayManageUDM": true, "mayCreateProjects": true, "mayCreateProjectsFromMacros": true, "mayCreateProjectsFromTemplates": true, "mayCreateProjectsFromDataikuApps": true, "mayWriteUnsafeCode": true, "mayWriteSafeCode": true, "mayCreateAuthenticatedConnections": true, "mayCreateCodeEnvs": true, "mayCreateClusters": false, "mayDevelopPlugins": true, "mayEditLibFolders": true, "mayManageCodeEnvs": true, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": true, "mayWriteInRootProjectFolder": true, "mayCreateActiveWebContent": true, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-au-npr", "description": "Auditor", "ldapGroupNames": "dss-au-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": false, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-ba-npr", "description": "BusinessAnalyst", "ldapGroupNames": "dss-ba-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": false, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-ds-npr", "description": "DataScientist", "sourceType": "LDAP", "ldapGroupNames": "dss-ds-npr", "admin": false, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": true, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-dsfe-npr", "description": "DataScientistFeatureEnhancement", "ldapGroupNames": "dss-dsfe-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": true, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": true, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-ls-npr", "description": "LeadScientist", "ldapGroupNames": "dss-ls-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": true, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": true, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-sp-npr", "description": "Support", "ldapGroupNames": "dss-sp-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": true, "mayCreateProjects": true, "mayCreateProjectsFromMacros": true, "mayCreateProjectsFromTemplates": true, "mayCreateProjectsFromDataikuApps": true, "mayWriteUnsafeCode": false, "mayWriteSafeCode": true, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": true, "mayCreateClusters": false, "mayDevelopPlugins": true, "mayEditLibFolders": true, "mayManageCodeEnvs": true, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-rm-npr", "description": "ReleaseManager", "ldapGroupNames": "dss-rm-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": false, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" }, { "name": "dss-te-npr", "description": "Tester", "ldapGroupNames": "dss-te-npr", "sourceType": "LDAP", "admin": false, "mayManageUDM": false, "mayCreateProjects": false, "mayCreateProjectsFromMacros": false, "mayCreateProjectsFromTemplates": false, "mayCreateProjectsFromDataikuApps": false, "mayWriteUnsafeCode": false, "mayWriteSafeCode": false, "mayCreateAuthenticatedConnections": false, "mayCreateCodeEnvs": false, "mayCreateClusters": false, "mayDevelopPlugins": false, "mayEditLibFolders": false, "mayManageCodeEnvs": false, "mayManageClusters": false, "mayViewIndexedHiveConnections": false, "mayCreatePublishedAPIServices": false, "mayWriteInRootProjectFolder": false, "mayCreateActiveWebContent": false, "canObtainAPITicketFromCookiesForGroupsRegex": "" } ]
I need the variable to be copied to the Linux VM - /dss/data/groups.txt
I call the script using Invoke-AzVMRunCommand using RunShellScript
Invoke-AzVMRunCommand -ResourceGroupName $ResourceGroupName -VMName $VirtualMachineName -CommandId RunShellScript -ScriptPath "$($PSScriptRoot)/scripts/$PatchScript" -Parameter #{InputConfParam=$InputConf}
In the script, I do the below
echo $InputConf > /dss/data/groups.txt
However I do not get the entire string, but only get the first character of the InputString.
This is because of the spaces/tabs in the variable.
Is there a way I can get the entire JSON passed to the shell script? so I can copy the variable to the file on the server?
Thanks
Just did a very crude workaround or replacing the newline chars and spaces and sending the parameter to the shell script and replacing it back in the script.
Blob Storage was a good option - will surely try the approach.
I have this simple example, where statements dont have semicolons. Prettier settings have the semi to false but eslint has the semi to true. I order to not have conflicts between them i installed the eslint-config-prettier. But i still get an error with the semicolons. It is supposed to prevail the prettier setting, but its does not.
var var1, var2
var1 = 3
var2 = 4
var a = { name: "" }
"devDependencies": {
"eslint": "^7.8.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.1.1"
}
.prettierrcc
{
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 86,
"proseWrap": "preserve",
"quoteProps": "preserve",
"requirePragma": false,
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
.eslintrcc
{
"root": true,
"env": {
"node": true
},
"extends": ["prettier"],
"plugins": ["prettier"],
"rules": {
"semi": ["error", "always"],
"prettier/prettier": ["error"]
}
}
I get the following error:
/home/nick/Documents/Coding/NodeJs/simple-node/vanilla.js
1:17 error Missing semicolon semi
2:11 error Missing semicolon semi
3:9 error Missing semicolon semi
4:21 error Missing semicolon semi
You are overwriting the Prettier config which is indeed set to "off" by default (link to config), with a custom rule who does the opposite of what you want. Simply remove it:
"rules": {
"prettier/prettier": ["error"]
}
Browsersync is working fine with a PHP/Symfony 3 project with the following command:
browser-sync start --proxy http://localhost:8000 --files "web/css/**/*.css"
The browser will open at http://localhost:3000 and if I change something in web/css I can see the updated stylesheets without a full page reload. So far so good.
However it doesn't work with the following bs-config.js:
module.exports = {
"files": [
"web/css/**/*.css"
],
"server": false,
"proxy": "http://localhost:8000"
};
And the command:
browser-sync start
Browser will not load, changes aren't detected and reloading doesn't work. What I'm missing?
try this:
1º Create "bs-config.js" with: browser-sync init
2º Open file and edit like this:
module.exports = {
"ui": {
"port": 3001,
"weinre": {
"port": 8080
}
},
"files": "web/css/**/*.css",
"watchOptions": {},
"server": false,
"proxy": "http://localhost:8000",
"port": 3000,
"middleware": false,
"serveStatic": [],
"ghostMode": {
"clicks": true,
"scroll": true,
"forms": {
"submit": true,
"inputs": true,
"toggles": true
}
},
"logLevel": "info",
"logPrefix": "BS",
"logConnections": false,
"logFileChanges": true,
"logSnippet": true,
"rewriteRules": [],
"open": "local",
"browser": "default",
"cors": false,
"xip": false,
"hostnameSuffix": false,
"reloadOnRestart": false,
"notify": true,
"scrollProportionally": true,
"scrollThrottle": 0,
"scrollRestoreTechnique": "window.name",
"scrollElements": [],
"scrollElementMapping": [],
"reloadDelay": 0,
"reloadDebounce": 0,
"reloadThrottle": 0,
"plugins": [],
"injectChanges": true,
"startPath": null,
"minify": true,
"host": null,
"localOnly": false,
"codeSync": true,
"timestamps": true,
"clientEvents": [
"scroll",
"scroll:element",
"input:text",
"input:toggles",
"form:submit",
"form:reset",
"click"
],
"socket": {
"socketIoOptions": {
"log": false
},
"socketIoClientConfig": {
"reconnectionAttempts": 50
},
"path": "/browser-sync/socket.io",
"clientPath": "/browser-sync",
"namespace": "/browser-sync",
"clients": {
"heartbeatTimeout": 5000
}
},
"tagNames": {
"less": "link",
"scss": "link",
"css": "link",
"jpg": "img",
"jpeg": "img",
"png": "img",
"svg": "img",
"gif": "img",
"js": "script"
}};
3º Run the server: php -S localhost:8000
4º Start BrowserSync: browser-sync start --config bs-config.js