Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29539

How to properly set AWSElastic Beanstalk default template to Grails (Gradle) project?

$
0
0

New to DevOps so bare with me...

I am trying to setup up a continuous delivery structure for a Grails web-app with AWS using Jenkins. Jenkins is running on an AWS EC2 instance, its pipeline is build from a Jenkinsfile from the Git repo.

I am getting an error message on the deployment stage of the Jenkins pipeline:

+ ./gradlew :web-sandbox:deployTest
:web-sandbox:deployTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':web-sandbox:deployTest'.
> No Configuration Template named 'project/default' found. (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 62838836-cf2c-46b9-a9e1-cd82f9ac2cfb)

Is the AWSElasticBeanstalk template mentioned here the YAML config file used to launch a new environment or is it something else?

I have been searching for a way to generate a config file for a Tomcat server with my build. That seems to be possible with the EB CLI. I have yet to find a way to do so.

Are there more efficient ways of generating a AWSElasticBeanstalk template in a Gradle project?

Here is my Jenkinsfile used to create a pipeline:

#!groovy

node{

stage('checkout'){
    checkout scm
}

stage('check tools'){
    sh "ls"
    sh "pwd"
    sh "./gradlew --version"
}

stage('clean'){
    sh "./gradlew clean"
}

stage('test'){
    sh "./gradlew :web-sandbox:test"
}

stage('packaging'){
    sh "./gradlew :web-sandbox:war"
}

stage('deploying'){
    sh "./gradlew :web-sandbox:deployTest"
}

}

And my gradle.build file of the web-app:

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
    }
}

plugins {
    id "fi.evident.beanstalk" version "0.2.2"
}

version "0.4"
group "web.sandbox"

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"

repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
}

dependencies {
    compile project(":mod-sandbox")
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-web-boot"
    compile "org.grails:grails-logging"
    compile "org.grails:grails-plugin-rest"
    compile "org.grails:grails-plugin-databinding"
    compile "org.grails:grails-plugin-i18n"
    compile "org.grails:grails-plugin-services"
    compile "org.grails:grails-plugin-url-mappings"
    compile "org.grails:grails-plugin-interceptors"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:async"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:events"
    compile "org.grails.plugins:hibernate5"
    compile "org.hibernate:hibernate-core:5.1.16.Final"
    compile "org.grails.plugins:gsp"
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime "org.glassfish.web:el-impl:2.1.2-b03"
    runtime "com.h2database:h2"
    runtime "org.apache.tomcat:tomcat-jdbc"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
    testCompile "org.grails:grails-gorm-testing-support"
    testCompile "org.grails.plugins:geb"
    testCompile "org.grails:grails-web-testing-support"
    testCompile "org.grails.plugins:geb:1.1.2"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
    testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:2.47.1"
}

bootRun {
    jvmArgs('-Dspring.output.ansi.enabled=always')
    addResources = true
    String springProfilesActive = 'spring.profiles.active'
    systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}

tasks.withType(Test) {
    systemProperty "geb.env", System.getProperty('geb.env')
    systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
    systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
    systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
}

assets {
    minifyJs = true
    minifyCss = true
}

beanstalk {
    s3Endpoint = "s3-eu-west-2.amazonaws.com"
    beanstalkEndpoint = "elasticbeanstalk.eu-west-2.amazonaws.com"

    deployments {
        // Example to deploy to the same env
        test {
            file = "build/libs/web-sandbox-${version}.war"
            application = 'project'
            environment = 'Project-env'
            template = 'default'
        }

    }
}

Open to any tips or tricks for debugging AWS deployment issues with Gradle

Let me know if you need any additional information.


Viewing all articles
Browse latest Browse all 29539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>