Skip to content

Instantly share code, notes, and snippets.

@fespino
Forked from jsuwo/BankAccount.java
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save fespino/403ae6bc8bd215cd09ea to your computer and use it in GitHub Desktop.

Select an option

Save fespino/403ae6bc8bd215cd09ea to your computer and use it in GitHub Desktop.

Revisions

  1. fespino revised this gist Jul 9, 2014. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    Continuous Integration with Jenkins on Amazon EC2
    =================================================

    [Videos](https://www.youtube.com/watch?v=zojMg2c6k3Q)

    ## Initial Setup

    ### Fixing Locales in Ubuntu 13.04 on Amazon EC2
    @@ -56,4 +58,12 @@ sudo service apache2 reload
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer maven git-core
    ```
    ```

    ## Creating public keys to connect to Github as Jenkins user

    ```
    sudo su - jenkins
    ssh-keygen -t dsa
    ```
  2. fespino revised this gist Jul 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Continuous Integration with Jenkins on Amazon EC2
    ### Fixing Locales in Ubuntu 13.04 on Amazon EC2

    ```bash
    sudo apt-get install language-pack-en
    sudo apt-get install language-pack-es
    ```

    ### Installing Jenkins
  3. fespino revised this gist Jul 9, 2014. 5 changed files with 2 additions and 76 deletions.
    20 changes: 0 additions & 20 deletions BankAccount.java
    Original file line number Diff line number Diff line change
    @@ -1,20 +0,0 @@
    package ca.uwo.csd.cs2212.USERNAME;

    public class BankAccount {

    private double balance;

    public BankAccount(double balance) {
    this.balance = balance;
    }

    public double debit(double amount) {
    if (balance < amount) {
    amount = balance;
    }

    balance -= amount;
    return amount;
    }

    }
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -50,10 +50,10 @@ sudo a2ensite jenkins
    sudo service apache2 reload
    ```

    ## Installing Java / Maven / Git
    ## Installing Java 8 / Maven / Git

    ```bash
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer maven git-core
    sudo apt-get install oracle-java8-installer maven git-core
    ```
    9 changes: 0 additions & 9 deletions TestBankAccount.java
    Original file line number Diff line number Diff line change
    @@ -1,9 +0,0 @@
    package ca.uwo.csd.cs2212.USERNAME;

    import junit.framework.Assert;
    import org.junit.Before;
    import org.junit.Test;

    public class TestBankAccount {

    }
    21 changes: 0 additions & 21 deletions pom.xml
    Original file line number Diff line number Diff line change
    @@ -1,21 +0,0 @@
    <project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>ca.uwo.csd.cs2212.USERNAME</groupId>
    <artifactId>USERNAME-lab5</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>

    <properties>
    <maven.compiler.source>7</maven.compiler.source>
    <maven.compiler.target>7</maven.compiler.target>
    </properties>

    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    </dependency>
    </dependencies>

    </project>
    24 changes: 0 additions & 24 deletions pom2.xml
    Original file line number Diff line number Diff line change
    @@ -1,24 +0,0 @@
    <build>
    <plugins>
    <plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.6.4.201312101107</version>
    <executions>
    <execution>
    <id>pre-unit-test</id>
    <goals>
    <goal>prepare-agent</goal>
    </goals>
    </execution>
    <execution>
    <id>post-unit-test</id>
    <phase>test</phase>
    <goals>
    <goal>report</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>
  4. @jeffshantz jeffshantz revised this gist Feb 16, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ sudo a2enmod proxy
    sudo a2enmod proxy_http
    ```

    ### `/etc/apache2/sites-availabe/jenkins.conf`
    ### `/etc/apache2/sites-available/jenkins.conf`

    ```bash
    <VirtualHost *:80>
  5. @jeffshantz jeffshantz revised this gist Feb 16, 2014. 4 changed files with 74 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions BankAccount.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    package ca.uwo.csd.cs2212.USERNAME;

    public class BankAccount {

    private double balance;

    public BankAccount(double balance) {
    this.balance = balance;
    }

    public double debit(double amount) {
    if (balance < amount) {
    amount = balance;
    }

    balance -= amount;
    return amount;
    }

    }
    9 changes: 9 additions & 0 deletions TestBankAccount.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    package ca.uwo.csd.cs2212.USERNAME;

    import junit.framework.Assert;
    import org.junit.Before;
    import org.junit.Test;

    public class TestBankAccount {

    }
    21 changes: 21 additions & 0 deletions pom.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>ca.uwo.csd.cs2212.USERNAME</groupId>
    <artifactId>USERNAME-lab5</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>

    <properties>
    <maven.compiler.source>7</maven.compiler.source>
    <maven.compiler.target>7</maven.compiler.target>
    </properties>

    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    </dependency>
    </dependencies>

    </project>
    24 changes: 24 additions & 0 deletions pom2.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <build>
    <plugins>
    <plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.6.4.201312101107</version>
    <executions>
    <execution>
    <id>pre-unit-test</id>
    <goals>
    <goal>prepare-agent</goal>
    </goals>
    </execution>
    <execution>
    <id>post-unit-test</id>
    <phase>test</phase>
    <goals>
    <goal>report</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>
  6. @jeffshantz jeffshantz revised this gist Feb 16, 2014. 1 changed file with 11 additions and 16 deletions.
    27 changes: 11 additions & 16 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    Initial Setup
    ============================================
    Continuous Integration with Jenkins on Amazon EC2
    =================================================

    Fixing Locales in Ubuntu 13.04 on Amazon EC2
    --------------------------------------------
    ## Initial Setup

    ### Fixing Locales in Ubuntu 13.04 on Amazon EC2

    ```bash
    sudo apt-get install language-pack-en
    ```

    Installing Jenkins
    ------------------
    ### Installing Jenkins

    ```bash
    wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
    @@ -18,20 +18,17 @@ sudo apt-get update
    sudo apt-get install jenkins
    ```

    Installing and Configuring Apache
    =================================
    ## Installing and Configuring Apache

    Installing Apache
    -----------------
    ### Installing Apache

    ```bash
    sudo apt-get install apache2
    sudo a2enmod proxy
    sudo a2enmod proxy_http
    ```

    `/etc/apache2/sites-availabe/jenkins.conf`
    --------------
    ### `/etc/apache2/sites-availabe/jenkins.conf`

    ```bash
    <VirtualHost *:80>
    @@ -46,16 +43,14 @@ sudo a2enmod proxy_http
    </VirtualHost>
    ```

    Enabling `jenkins.conf`
    -----------------------
    ### Enabling `jenkins.conf`

    ```bash
    sudo a2ensite jenkins
    sudo service apache2 reload
    ```

    Installing Java / Maven / Git
    =============================
    ## Installing Java / Maven / Git

    ```bash
    sudo add-apt-repository ppa:webupd8team/java
  7. @jeffshantz jeffshantz created this gist Feb 16, 2014.
    64 changes: 64 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,64 @@
    Initial Setup
    ============================================

    Fixing Locales in Ubuntu 13.04 on Amazon EC2
    --------------------------------------------

    ```bash
    sudo apt-get install language-pack-en
    ```

    Installing Jenkins
    ------------------

    ```bash
    wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
    echo "deb http://pkg.jenkins-ci.org/debian binary/" | sudo tee -a /etc/apt/sources.list.d/jenkins.list
    sudo apt-get update
    sudo apt-get install jenkins
    ```

    Installing and Configuring Apache
    =================================

    Installing Apache
    -----------------

    ```bash
    sudo apt-get install apache2
    sudo a2enmod proxy
    sudo a2enmod proxy_http
    ```

    `/etc/apache2/sites-availabe/jenkins.conf`
    --------------

    ```bash
    <VirtualHost *:80>
    ServerName HOSTNAME
    ProxyRequests Off
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/
    </VirtualHost>
    ```

    Enabling `jenkins.conf`
    -----------------------

    ```bash
    sudo a2ensite jenkins
    sudo service apache2 reload
    ```

    Installing Java / Maven / Git
    =============================

    ```bash
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer maven git-core
    ```