Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/com/wolox/ProjectConfiguration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.wolox.steps.Steps;

class ProjectConfiguration {
def environment;
def environmentHash;
def services;
Steps steps;
def dockerfile;
Expand Down
12 changes: 12 additions & 0 deletions src/com/wolox/parser/ConfigParser.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class ConfigParser {

// parse the environment variables
projectConfiguration.environment = parseEnvironment(yaml.environment);
// parse the environment variables
projectConfiguration.environmentHash = parseEnvironmentHash(yaml.environment);

// parse the execution steps
projectConfiguration.steps = parseSteps(yaml.steps);
Expand Down Expand Up @@ -44,6 +46,16 @@ class ConfigParser {
return environment.collect { k, v -> "${k}=${v}"};
}

static def parseEnvironmentHash(def environment) {
if (!environment) {
return "";
}

def map = [:]

return environment.each { k, v -> map[k] = v};
}

static def parseSteps(def yamlSteps) {
List<Step> steps = yamlSteps.collect { k, v ->
Step step = new Step(name: k)
Expand Down
2 changes: 1 addition & 1 deletion vars/base.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.wolox.*;

def call(ProjectConfiguration projectConfig, def _, def nextClosure) {
return { variables ->
def timeoutTime = projectConfig.env.TIMEOUT ?: 600 // timeout 10 minutes
def timeoutTime = projectConfig.environmentHash.TIMEOUT ?: 600 // timeout 10 minutes
timeout(time: timeoutTime, unit: 'SECONDS') {
withEnv(projectConfig.environment) {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
Expand Down