Skip to content

Commit 896ca15

Browse files
authored
INFRA-401: Setup CI/CD pipelines (#36)
1 parent a83ced2 commit 896ca15

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

.github/workflows/build.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build
2+
on: [push,pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-java@v3
9+
with:
10+
distribution: temurin
11+
java-version: 11
12+
13+
- name: Setup Gradle
14+
uses: gradle/gradle-build-action@v2
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 12
18+
- name: Build OCD3
19+
run: ./gradlew build

.github/workflows/deploy.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
12+
with:
13+
distribution: temurin
14+
java-version: 11
15+
- name: Setup Gradle
16+
uses: gradle/gradle-build-action@v2
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 12
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
with:
23+
platforms: linux/amd64,linux/arm64
24+
- name: Set up Docker Buildx
25+
id: buildx
26+
uses: docker/setup-buildx-action@v2
27+
- name: Login to DockerHub
28+
if: github.event_name != 'pull_request'
29+
uses: docker/login-action@v1
30+
with:
31+
username: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }}
32+
password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }}
33+
- name: Build OCD3
34+
run: ./gradlew build
35+
- name: Deploy OCD3
36+
if: github.event_name != 'pull_request'
37+
run: ./gradlew deploy
38+
env:
39+
mksRepoUrl: 'https://nexus.mekomsolutions.net/repository/maven-snapshots'
40+
mksRepoUsername: "${{ secrets.NEXUS_USERNAME }}"
41+
mksRepoPassword: "${{ secrets.NEXUS_PASSWORD }}"

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG VERSION=2.346.2
1+
ARG VERSION=2.346.3
22
FROM jenkins/jenkins:$VERSION
33
MAINTAINER Mekom Solutions <[email protected]>
44

docker/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def getShortCommit() {
2525

2626
task buildDockerImage(type: DockerBuildImage) {
2727
inputDir = file('.')
28-
images = [dockerHubRepo + ':' + version, dockerHubRepo + ':' + 'latest']
28+
images = [dockerHubRepo + ':' + version, dockerHubRepo + ':' + 'latest', dockerHubRepo + ':' + getShortCommit()]
2929
}
3030

3131
task build() {

0 commit comments

Comments
 (0)