Skip to content

Instantly share code, notes, and snippets.

View vinirib's full-sized avatar

Vinícius Ribeiro vinirib

View GitHub Profile
@vinirib
vinirib / java11-junit5-archetype-generator.sh
Created January 6, 2024 16:26
Generate an artifact for java 11 and junit 5 project
# It will prompt groupId and artifactId where groupId could be something like "com.vratech" and artifactId "my-new-project"
mvn archetype:generate -DarchetypeGroupId=uk.co.markg.archetypes -DarchetypeArtifactId=java11-junit5 -DarchetypeVersion=1.0
@vinirib
vinirib / sampleREADME.md
Last active February 26, 2025 12:23 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.
#!groovy
pipeline {
agent any
stages {
stage('Can-I-Deploy Integration Check') {
steps {
sh 'curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.83.0/pact-1.83.0-linux-x86_64.tar.gz'
sh 'tar xzf pact-1.83.0-linux-x86_64.tar.gz'
dir('pact/bin') {
sh """./pact-broker can-i-deploy --retry-while-unknown=12 --retry-interval=10 --pacticipant AccountProvider --latest CONTRACT-TEST --broker-base-url http://pact_broker"""
#!groovy
pipeline {
agent any
environment {
BRANCH_NAME=env.GIT_BRANCH.replace("origin/", "")
}
stages {
stage('Can-I-Deploy Integration Check') {
steps {
sh 'curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.83.0/pact-1.83.0-linux-x86_64.tar.gz'
#!groovy
pipeline {
agent any
parameters {
string(name: 'pactConsumerTags', defaultValue: 'CONTRACT-TEST', description: 'Tags to verify')
}
stages {
stage ('Run Contract Tests'){
steps {
sh "chmod +x mvnw"
#!groovy
pipeline {
agent any
environment {
BRANCH_NAME=env.GIT_BRANCH.replace("origin/", "")
}
stages {
stage('Build and Publish Pacts') {
steps {
sh "chmod +x mvnw"
# Starting off with the Jenkins base Image
FROM jenkins/jenkins:2.230-jdk11
# Installing the plugins we need using the in-built install-plugins.sh script
RUN JENKINS_UC_DOWNLOAD=http://archives.jenkins-ci.org /usr/local/bin/install-plugins.sh git matrix-auth workflow-aggregator \
docker-workflow blueocean job-dsl credentials-binding simple-theme-plugin \
jquery gravatar
# Setting up environment variables for Jenkins admin user
ENV JENKINS_USER admin
version: '3.3'
services:
jenkins:
build:
context: ./jenkins_config
dockerfile: Dockerfile
image: jenkins-pact-ci
container_name: jenkins-pact-ci
restart: always
Computer says yes \o/
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS?
-----------------------|-----------|------------------------|-----------|---------
AccountBalanceConsumer | 0.0.1 | AccountBalanceProvider | 0.0.0 | true
./pact-broker can-i-deploy --pacticipant AccountBalanceConsumer --latest --broker-base-url http://localhost