Deploy Heroku - pinguet62/JSFring GitHub Wiki

Deploy to Heroku

Methods

Automatic deploy

Active the Automatic deploys option into Heroku app.

Plugin

<plugin>
	<groupId>com.heroku.sdk</groupId>
	<artifactId>heroku-maven-plugin</artifactId>
	<version>1.0.0</version>
	<configuration>
		<appName>jsfring-${project.artifactId}</appName>
		<processTypes>
			<web>java $JAVA_OPTS -Dserver.port=$PORT -jar target/${project.build.finalName}.${project.packaging}</web>
		</processTypes>
	</configuration>
</plugin>

Travis CI

https://docs.travis-ci.com/user/deployment/heroku

deploy:
    - file_glob: true
      file:
          - Procfile
          - jsfring-batch-admin/target/batch-admin-*.war
      provider: heroku
      api_key:
          secure: ...
      app: jsfring-batch-admin
      on:
          repo: pinguet62/JSFring
  • file: - Procfile: required by Heroku
  • file_glob: to use * & ** symbole, because of version into JAR/WAR filename
  • api_key.secure: see documentation to build key from API key

Slug

Definition

It's the root application folder by Heroku.

Paths:

  • Folder: target/heroku/app
  • Package: target/heroku/slug.tgz

Content:

  • target/
  • pom.xml
  • Procfile
  • system.properties

Issue: Slug limit size

To reduce the limit size: delete all unecessary files, and keep only application files (JAR & WAR). (report files are kept because used by CI utils)

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-clean-plugin</artifactId>
	<executions>
		<execution>
			<phase>install</phase>
			<goals>
				<goal>clean</goal>
			</goals>
			<configuration>
				<excludeDefaultDirectories>true</excludeDefaultDirectories>
				<filesets>
					<fileset>
						<directory>target</directory>
						<excludes>
							<!-- Reports -->
							<exclude>site/**</exclude>
							<exclude>jacoco.exec</exclude>
							<exclude>jacoco-it.exec</exclude>
							<!-- Executables -->
							<exclude>indexer-nosql-${project.version}.jar</exclude>
							<exclude>task-${project.version}.jar</exclude>
							<exclude>batch-admin-${project.version}.war</exclude>
							<exclude>webservice-${project.version}.war</exclude>
							<exclude>webapp-angularjs-${project.version}.war</exclude>
							<exclude>webapp-jsf-${project.version}.war</exclude>
						</excludes>
					</fileset>
				</filesets>
			</configuration>
		</execution>
	</executions>
</plugin>
⚠️ **GitHub.com Fallback** ⚠️