Skip to content
Snippets Groups Projects
Commit b5743794 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: handle quoted docker compose strings

parent fb71523e
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ function extractDependencies(content) {
const deps = [];
let lineNumber = 0;
for (const line of content.split('\n')) {
const match = line.match(/^\s*image:\s*([^\s]+)\s*$/);
const match = line.match(/^\s*image:\s*'?"?([^\s'"]+)'?"?\s*$/);
if (match) {
const currentFrom = match[1];
const {
......
......@@ -7,7 +7,7 @@ function setNewValue(currentFileContent, upgrade) {
logger.debug(`setNewValue: ${upgrade.newFrom}`);
const lines = currentFileContent.split('\n');
const lineToChange = lines[upgrade.lineNumber];
const imageLine = new RegExp(/^(\s*image:\s*)[^\s]+(\s*)$/);
const imageLine = new RegExp(/^(\s*image:\s*'?"?)[^\s'"]+('?"?\s*)$/);
if (!lineToChange.match(imageLine)) {
logger.debug('No image line found');
return null;
......
......@@ -16,7 +16,7 @@ services:
condition: on-failure
db:
image: postgres:9.4.0
image: "postgres:9.4.0"
volumes:
- db-data:/var/lib/postgresql/data
networks:
......@@ -41,7 +41,7 @@ services:
condition: on-failure
result:
image: dockersamples/examplevotingapp_result:before
image: 'dockersamples/examplevotingapp_result:before'
ports:
- 5001:80
networks:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment