Skip to content

Commit

Permalink
0.4.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan committed Aug 10, 2022
1 parent 5419bac commit 29ddcab
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

# [0.4.4] (2022-08-10)

- Fixed an issue with opening a Dev Container in a development image.
- Fixed an issue with Git installation in Dev Container.
- If **demisto-sdk lint** fails when opening a Dev Container or Virtual Environment, show error message and not proceed.

# [0.4.3] (2022-08-05)

- Fixed issues with M1 Macs.
Expand Down
5 changes: 3 additions & 2 deletions Templates/integration_env/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ ADD extra-requirements-py3.txt /
RUN chmod +x /create_certs.sh \
&& /create_certs.sh /usr/local/share/ca-certificates/certs.crt \
&& update-ca-certificates \
&& apk update || apt-get update -y || echo "Could not update package mangaer" \
&& apk add bash || echo "No alpine, no need to install bash" \
&& apk add git || apt-get install git || echo "Could not install git" \
&& apk add build-base || apt-get install build-essential || echo "Could not install build-essential" \
&& apk add git || apt-get install git -y || echo "Could not install git" \
&& apk add build-base || apt-get install build-essential -y || echo "Could not install build-essential" \
# check if pip command exists
&& if [ -x "$(command -v pip)" ]; then \
pip install autopep8; \
Expand Down
3 changes: 1 addition & 2 deletions Templates/integration_env/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
// if this value is not set, make sure `demisto-sdk lint` works
"IMAGENAME": "This should be the name of the test image"
"IMAGENAME": ""
}
},
"containerUser": "demisto",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "xsoar",
"displayName": "Cortex XSOAR",
"description": "Build, Format, and Validate Cortex XSOAR with ease.",
"version": "0.4.3",
"version": "0.4.4",
"engines": {
"vscode": "^1.54.0"
},
Expand Down
6 changes: 5 additions & 1 deletion src/demistoSDKWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export async function lint(file: string, tests = true, lints = true, progress =
command.push('--no-flake8', '--no-mypy', '--no-bandit', '--no-xsoar-linter', '--no-vulture', '--no-pylint', '--no-pwsh-analyze')
}
if (progress) {
await TerminalManager.sendDemistoSdkCommandWithProgress(command)
const isSuccess = await TerminalManager.sendDemistoSdkCommandWithProgress(command)
if (!isSuccess){
await tools.isDemistoSDKinstalled()
throw new Error('Demisto-SDK lint failed')
}
}
else {
TerminalManager.sendDemistoSDKCommand(command);
Expand Down
10 changes: 8 additions & 2 deletions src/devEnvs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export async function openIntegrationDevContainer(dirPath: string): Promise<void
Logger.info('Copy launch.json')
fs.writeJsonSync(launchJsonOutput, launchJson, { spaces: 2 })

const dockerImage = ymlObject.dockerimage || ymlObject?.script.dockerimage
let dockerImage = ymlObject.dockerimage || ymlObject?.script.dockerimage
dockerImage = dockerImage.replace('demisto', 'devtestdemisto')
Logger.info(`docker image is ${dockerImage}`)
const devcontainerJsonPath = path.resolve(__dirname, '../Templates/integration_env/.devcontainer/devcontainer.json')
const devcontainer = JSON5.parse(fs.readFileSync(devcontainerJsonPath, 'utf-8'))
Expand All @@ -226,8 +227,13 @@ export async function openIntegrationDevContainer(dirPath: string): Promise<void
devcontainer.name = `XSOAR Integration: ${filePath.name}`
await dsdk.lint(dirPath, false, false, true)
try {
const testDockerImage = execSync(`docker images --format "{{.Repository}}:{{.Tag}}" | grep devtest${dockerImage} | head -1`,
const testDockerImage = execSync(`docker images --format "{{.Repository}}:{{.Tag}}" | grep ${dockerImage} | head -1`,
{ cwd: dirPath, }).toString().trim()
if (!testDockerImage) {
Logger.error('Docker image not found, exiting')
vscode.window.showErrorMessage('Docker image not found, exiting')
return
}
devcontainer.build.args.IMAGENAME = testDockerImage
fs.writeJSONSync(path.join(devcontainerFolder, 'devcontainer.json'), devcontainer, { spaces: 2 })
}
Expand Down

0 comments on commit 29ddcab

Please sign in to comment.