This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<dependencies> | |
<dependency> | |
<groupId>com.homeaway.devtools.jenkins</groupId> | |
<artifactId>jenkins-spock</artifactId> | |
<version>${jenkins-spock.version}</version> | |
<scope>test</scope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<!-- Other code omitted for brevity --> | |
<repositories> | |
<repository> | |
<id>jenkins-releases</id> | |
<name>Jenkins Releases</name> | |
<url>http://repo.jenkins-ci.org/releases</url> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.mycompany.colinbut.Constants | |
import com.mycompany.colinbut.DockerEcr | |
def call(Map args) { | |
node { | |
stage("Checkout") { | |
git credentialsId: Constants.JENKINS_GITHUB_CREDENTIALS_ID, url: "https://github.com/colinbut/${args.repo}.git" | |
} | |
stage("Compile") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.colinbut | |
class Git implements Serializable { | |
private final def script | |
Git(def script) { | |
this.script = script | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.colinbut | |
class DockerEcr implements Serializable { | |
private final def script | |
static final String awsRegion = "eu-west-2" | |
static final String dockerUser = "AWS" | |
static final String dockerRegistryIdentifier = "{AWS_ACCOUNT_ID}.dkr.ecr.eu-west-2.amazonaws.com" | |
static final String dockerRegistryUrl = "https://${dockerRegistryIdentifier}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.mvc.examples.button.example1; | |
import java.util.Observable; | |
/** | |
* This is the model of the MVC. It knows nothing of the Views or the Controller. | |
* It only knows of Observers where it sends them update when anything changes | |
* | |
* @author colin | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void findWinners(List<Player> players) { | |
Map<Player, Integer> playersPoints = new HashMap<>(); | |
for (Player player: players){ | |
List<Card> cards = player.getHand(); | |
int totalCount = 0; | |
for (Card card : cards) { | |
totalCount += card.getPoint(); | |
} | |
if (totalCount > 21) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.fluentlenium</groupId> | |
<artifactId>fluentlenium-core</artifactId> | |
<version>${fluentlenium-lib-version}</version> | |
<exclusions> | |
<exclusion> | |
<groupId>org.seleniumhq.selenium</groupId> | |
<artifactId>selenium-java</artifactId> | |
</exclusion> | |
</exclusions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Money { | |
private BigDecimal price; | |
private Currency currency; | |
public Money(BigDecimal price, Currency currency) { | |
this.price = price; | |
this.currency = currency; | |
} | |
public BigDecimal getPrice() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8 | |
COPY target/app-*-SNAPSHOT.jar /usr/local/bin/app.jar | |
RUN chmod +x /usr/local/bin/app.jar | |
CMD ["java", "-jar", "/usr/local/bin/app.jar"] |