my-calculator-poc / my-calculator-poc.github.io

The meta repo organize the operations for the POC
Apache License 2.0
1 stars 0 forks source link

Run docker image for Artifactory #4

Open jabrena opened 5 years ago

jabrena commented 5 years ago

It is necessary to run Artifactory to publish in localhost artifacts

jabrena commented 5 years ago

https://www.jfrog.com/confluence/display/RTF/Artifactory+Comparison+Matrix https://www.jfrog.com/confluence/display/RTF/Installing+with+Docker

OSS -> (Only support: Maven, Gradle, Ivy, SBT, Generic)

docker pull docker.bintray.io/jfrog/artifactory-oss:latest
docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss:latest

HOW TO: http://www.littlebigextra.com/how-to-install-artifactory-on-docker/

http://localhost:8081/artifactory

jabrena commented 5 years ago

HOW to publish in Artifactory from Maven:

https://www.jfrog.com/confluence/display/RTF/Maven+Artifactory+Plugin https://stackoverflow.com/questions/24122382/how-to-configure-maven2-to-publish-to-artifactory

jabrena commented 5 years ago
git clone https://github.com/my-calculator-poc/My-Sum-API.git
cd My-Sum-API
mvnw clean install

The JAR includes: contracts + mappings (Wiremock)

cd /Users/jabrena/.m2/repository/org/jab/microservices/my-sum/0.1.0-SNAPSHOT
jar tf my-sum-0.1.0-SNAPSHOT-stubs.jar 
META-INF/MANIFEST.MF
META-INF/
META-INF/org.jab.microservices/
META-INF/org.jab.microservices/my-sum/
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/sum/
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/given_request_when_empty_then_expectedResult.groovy
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/given_request_when_regativeNumbers_then_badRequest.groovy
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/given_request_when_OK_then_expectedResult.groovy
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/sum/given_request_when_OK_then_expectedResult.json
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/sum/given_request_when_partialRequest_then_expectedResult.json
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/sum/given_request_when_regativeNumbers_then_badRequest.json
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/given_request_when_numbersOnLimit_then_badRequest.groovy
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/given_request_when_partialRequest_then_expectedResult.groovy
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/contracts/sum/README.md
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/sum/given_request_when_empty_then_expectedResult.json
META-INF/org.jab.microservices/my-sum/0.1.0-SNAPSHOT/mappings/sum/given_request_when_numbersOnLimit_then_badRequest.json
jabrena commented 5 years ago

Releasing Producer SNAPSHOT https://github.com/my-calculator-poc/My-Sum-API/releases/tag/0.1.0-SNAPSHOT

jabrena commented 5 years ago

Step 2:

        <dependency>
            <groupId>org.jab.microservices</groupId>
            <artifactId>my-sum</artifactId>
            <version>0.1.0-SNAPSHOT</version>
            <classifier>stubs</classifier>
            <scope>test</scope>
        </dependency>
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
@AutoConfigureStubRunner(
        stubsMode = StubRunnerProperties.StubsMode.LOCAL,
        ids = {"org.jab.microservices:my-sum:0.1.0-SNAPSHOT"})
public class SumIntegrationTest2 {

    @Test
    public void noTest() {

    }

}