Giter Site home page Giter Site logo

devops-build's Introduction

DevOps Build

  1. Open your GitHub account (Register if needed)
  2. Create new repository "maven-test" + README
  3. Clone your repository to your client
git clone https://your-git-url
  1. Create GitHub issue and a branch to create a new maven application
  2. Pull your repository and initialize a maven demo application
mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=hu.bme.mit.devops -DartifactId=maven-app
  1. Extend pom.xml with the following part
<properties>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
  </properties>
  1. Build and package the code
mvn package
  1. Try to execute the artefact
java -jar %%jar file name%%
  1. Add mainClass name
<project>
  ...
  <build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<mainClass>hu.bme.mit.devops.App</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
  1. Execute again
java -jar %%jar file name%%
  1. Commit and push your code, review and close your issue, while merge your code.
git commit, merge
  1. Create a new issue and branch to create a Gradle application
mkdir gradle-app 
cd gradle-app
gradle init --type java-application

Set Java compatibility level in build.gradle file

apply plugin: 'java'
...
compileJava {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

Run the application

gradle run
  1. Commit and push your code, review and close your issue, while merge your code.
  2. Create an issue for maven to gradle conversion
  3. Convert your maven project into a gradle project and try to execute it
gradle init --type pom
gradle tasks
gradle run
  1. Extend build.gradle
apply plugin: 'application'
mainClassName = 'hu.bme.mit.devops.App'
  1. Create new repository for the demo SpringBoot RESTFul application
  2. Clone spring example
git clone https://github.com/szatmari/devops-build.git
  1. Set new origin
git remote -v
git remote add myorigin https://your-springboot-git-url
git remote -v
git pull myorigin master --allow-unrelated-histories
  1. Commit and push to myorigin
  2. Run the SpringBoot REST App
gradle bootRun
  1. Test the application:
curl http://localhost:8080/greeting?name=Zoltan
  1. Add dependency (src/main/java/hello/Greeting.java)
import org.joda.time.LocalTime;
...
    public String getContent() {
        LocalTime currentTime = new LocalTime();
        return content +" " + currentTime;
    }
  1. Test the application again
curl http://localhost:8080/greeting?name=Zoltan

devops-build's People

Contributors

szatmari avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

devops-build's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.