I tried the postDebugTask but it doesn't seem to run the task at all. I've skimmed this as well to no avail.
./.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Node.js in Docker",
"type": "docker",
"request": "launch",
"preLaunchTask": "run",
"platform": "node",
"removeContainerAfterDebug": true,
"postDebugTask": "stop"
}
]
}
./.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "run",
"command": "docker-compose up serve ; docker-compose rm -fsv serve",
},
{
"type": "shell",
"label": "stop",
"command": "echo test | docker-compose rm -fsv serve",
},
]
}
How can I make it so that docker-compose rm -fsv serve runs in parallel if the stop event occurs in the debug?
Related
I am trying to debug a code in VSCode that runs inside of docker. After realizing the problem is not in my code but in a Library that I am using I tried to set justMyCode : false in the launch.json file.
The problem is that when one is debugging inside of docker the lauch.json don't accept justMyCode : false and even when I put it there it does not work.
My config files:
lauch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Docker: Python - General",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"justMyCode": false, #This does not work
"python": {
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
],
"projectType": "general"
}
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "docker-build",
"label": "docker-build",
"platform": "python",
"dockerBuild": {
"tag": "indeednewversionnoapi:latest",
"dockerfile": "${workspaceFolder}/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
}
},
{
"type": "docker-run",
"label": "docker-run: debug",
"dependsOn": [
"docker-build"
],
"python": {
"file": "main.py",
"args": ["--location","new_york", "--country","us","--from_age","14"]
}
}
]
}
The problem was with the placement of justMyCode field.
When you are running without docker you can use justMyCode directly in the configurations:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Arquivo Atual",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"args": [ "--location","New York", "--country","us","--from_age","14"]
}
]
}
But while using docker it must go inside of python configs:
{
"version": "0.2.0",
"configurations": [
{
"name": "Docker: Python - General",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"python": {
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
],
"projectType": "general",
"justMyCode": false,
}
}
]
}
I developed an electron app. I want to send the latest version to Gitlaba and perform automatic update.
my package.json
{
"name": "kantar-tekillestirme",
"productName": "kantar",
"version": "2.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"build": "electron-builder --win",
"build-all": "electon-builder --win",
"build-dev": "electron-builder build --win --publish never",
"deploy": "electron-builder build --win --publish always",
"release": "electron-builder --win --publish always",
"dist:win": "electron-builder -w",
"dist": "electron-builder",
"postinstall": "",
"install": "node-gyp install"
},
"repository": {
"type": "git",
"url": "git+https://my.special.domain/kantar/kantar-tekillestirme",
"release": "latest"
},
"build": {
"appId": "com.kantar.updateexample",
"artifactName": "${productName}-${version}.${ext}",
"extraFiles": [
"files"
],
"publish": [
{
"provider": "generic",
"url": "https://my.special.domain"
}
],
"win": {
"target": "nsis",
"icon": "./files/icon/kantar.png",
"verifyUpdateCodeSignature": false
},
"nsis": {
"allowElevation": false,
"allowToChangeInstallationDirectory": true,
"oneClick": false,
"perMachine": true
}
},
"author": "GitHub",
"license": "CC0-1.0",
}
I removed some of the fields and he wouldn't let me publish them all
I'm sharing my "gitlab-ci" file.
copied the gitlab-ci file from here
Here's the mistake I made
Why am I encountering this error. How do I release a new version? Can you help me?
I have 2 tasks in visual studio code to run 2 different images into containers. Only the last docker run task is recognized by vscode.
This is my tasks.json file
{
"version": "2.0.0",
"tasks": [
{
"label": "docker-build-1",
"type": "docker-build",
"platform": "python",
"dockerBuild": {
"tag": "image1:latest",
"dockerfile": "${workspaceFolder}/app1/dev.Dockerfile",
"context": "${workspaceFolder}/",
"pull": true
}
},
{
"label": "docker-build-2",
"type": "docker-build",
"platform": "python",
"dockerBuild": {
"tag": "image2:latest",
"dockerfile": "${workspaceFolder}/app2/dev.Dockerfile",
"context": "${workspaceFolder}/",
"pull": true
}
},
{
"label": "docker-run-1",
"type": "docker-run",
"dependsOn": [
"docker-build-1"
],
"python": {
"module": "app.main"
},
"dockerRun": {
"network": "mynetwork"
}
},
{
"label": "docker-run-2",
"type": "docker-run",
"dependsOn": [
"docker-build-2"
],
"python": {
"module": "app.main"
},
"dockerRun": {
"network": "mynetwork"
}
},
]
}
When vscode shows the menu for running task, only thask docker-run-2 is showing:
Actually, only the last docker run task in the tasks.json file is shown. If I change the order in the list of tasks, then vscode only recognize docker-run-1. I searched in the documentation and it doesn't says anything about this behaviour. Any idea why this is happening? The idea is to setup 2 debug configurations in vscode for the 2 apps, but running the debug config for the app that is not the last produce an error in vscode:
Came across this same issue today. Seems that the "dockerRun" attribute between the run tasks has to be different. In my case i just added a test environment variable to one of the tasks and then both started to appear in the task list.
when I test to publish on github I get this error write ECONNRESET at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
Here is my code
{
"name": "app",
"version": "1.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"scripts": {
"start": "electron .",
"dist": "electron-builder",
"publish": "electron-builder --publish always"
},
"author": "GitHub",
"license": "CC0-1.0",
"devDependencies": {
"electron": "^8.0.0",
"electron-builder": "^22.3.2"
},
"repository": {
"type" : "git",
"url" : "https://github.com/Fizo55/app.git"
},
"build": {
"appId": "com.fizo55.app",
"productName": "app",
"target": "NSIS",
"directories": {
"output": "build"
},
"publish": [
{
"provider": "github",
"private": true,
"owner": "Fizo55",
"repo": "app",
"token": "mytoken"
}
],
"nsis": {
"allowToChangeInstallationDirectory": true,
"oneClick": false
}
}
}
Thanks for your help
After some test, it was my connection the problem, I switched on my 4G and now it work perfectly.
I am getting the below error while making deb file of electronjs
Error: could not find the Electron app binary at "dist/app-linux-x64/koriwallet". You may need to re-bundle the app using Electron Packager's "executableName" option.
My package.json file is
{
"name": "wallet",
"version": "1.0.0",
"description": "wallet",
"main": "src/main.js",
"scripts": {
"start": "electron .",
"build": "electron-packager . myapp",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"deb64": "electron-installer-debian --src dist/app-linux-x64/ --dest dist/installers/ --arch amd64"
},
"author": "wallet",
"license": "ISC",
"devDependencies": {
"asar": "^2.0.1",
"electron": "^5.0.6",
"electron-builder": "^21.1.1",
"electron-installer-debian": "^2.0.0",
"electron-packager": "^14.0.2"
},
"electronPackagerConfig": {
"packageManager": "npm",
"executableName": "kori"
},
"build": {
"appId": "wallet",
"linux": {
"category": "wallet"
}
},
"dependencies": {
"cookies": "^0.7.3",
"crypto": "^1.0.1",
"dpkg": "^1.0.0",
"jquery": "^3.4.1",
"jstorage": "^0.4.8"
}
}
My 2 cents. I'm making an Fedora 30 rpm and got:
An unhandled error has occurred inside Forge:
An error occured while making for target: rpm
could not find the Electron app binary at "/home/ajm/Documents/Projects/sunstealer.ets/out/sunstealer.ets product-linux-x64/sunstealer.ets". You may need to re-bundle the app using Electron Packager's "executableName" option.
Error: could not find the Electron app binary at "/home/ajm/Documents/Projects/sunstealer.ets/out/sunstealer.ets product-linux-x64/sunstealer.ets". You may need to re-bundle the app using Electron Packager's "executableName" option.
at error.wrapError (/home/ajm/Documents/Projects/sunstealer.ets/node_modules/electron-installer-common/src/installer.js:145:15)
Fix was update package.json from
"name": "sunstealer.ets",
"productName": "sunstealer.ets product",
to:
"name": "sunstealer.ets",
"productName": "sunstealer.ets",
i.e. same value. Then npm run make with:
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"certificateFile": "./certs/adam_mauger.pfx",
"certificatePassword": "REDACTED"
}
},
{
"name": "#electron-forge/maker-dmg",
"config": {
"format": "ULFO"
}
},
{
"name": "#electron-forge/maker-rpm",
"config": {
}
},
created sunstealer.ets-1.0.0-1.x86_64.rpm. Hope that helps.
my 5 cents)
so, launch npm from root folder. there exist node_modules.
app stored in root/src. there exist node_modules.
and in root and in root/src have package.json
check root/src/package.json file. maybe there parameter "name" have default value in lowercase