Skip to content

Commit

Permalink
INFRA-401: Setup CI/CD pipelines (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
enyachoke committed Nov 20, 2023
1 parent a83ced2 commit 896ca15
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build
on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- uses: actions/setup-node@v3
with:
node-version: 12
- name: Build OCD3
run: ./gradlew build
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- uses: actions/setup-node@v3
with:
node-version: 12
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }}
- name: Build OCD3
run: ./gradlew build
- name: Deploy OCD3
if: github.event_name != 'pull_request'
run: ./gradlew deploy
env:
mksRepoUrl: 'https://nexus.mekomsolutions.net/repository/maven-snapshots'
mksRepoUsername: "${{ secrets.NEXUS_USERNAME }}"
mksRepoPassword: "${{ secrets.NEXUS_PASSWORD }}"
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VERSION=2.346.2
ARG VERSION=2.346.3
FROM jenkins/jenkins:$VERSION
MAINTAINER Mekom Solutions <support@mekomsolutions.com>

Expand Down
2 changes: 1 addition & 1 deletion docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def getShortCommit() {

task buildDockerImage(type: DockerBuildImage) {
inputDir = file('.')
images = [dockerHubRepo + ':' + version, dockerHubRepo + ':' + 'latest']
images = [dockerHubRepo + ':' + version, dockerHubRepo + ':' + 'latest', dockerHubRepo + ':' + getShortCommit()]
}

task build() {
Expand Down

0 comments on commit 896ca15

Please sign in to comment.