Skip to content

Commit c9a359c

Browse files
authored
[CI/CD] Initial Commit (#1)
1 parent e7056ef commit c9a359c

File tree

5 files changed

+277
-1
lines changed

5 files changed

+277
-1
lines changed

.github/dependabot.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
8+
updates:
9+
- package-ecosystem: maven
10+
directory: "/"
11+
schedule:
12+
interval: daily
13+
open-pull-requests-limit: 10
14+
labels:
15+
- dependencies
16+
- package-ecosystem: docker
17+
directory: "/application"
18+
schedule:
19+
interval: daily
20+
open-pull-requests-limit: 10
21+
commit-message:
22+
prefix: "[Docker] "
23+
labels:
24+
- dependencies

.github/workflows/build.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build - Platform
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Cache local Maven repository
18+
uses: actions/cache@v3
19+
with:
20+
path: ~/.m2/repository
21+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22+
restore-keys: ${{ runner.os }}-maven-
23+
24+
- name: Set up JDK Corretto 20
25+
uses: actions/setup-java@v3
26+
with:
27+
distribution: 'corretto'
28+
java-version: '20'
29+
architecture: x64
30+
31+
- name: Maven Build
32+
run: mvn clean install
33+
34+
- name: Build and Push Docker Image
35+
run: |
36+
docker buildx create --name dirigible-builder
37+
docker buildx use dirigible-builder
38+
cd application
39+
docker buildx build --tag custom-stack -o type=image --platform=linux/arm64,linux/amd64 .
40+
docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
41+
docker buildx build --push --tag ghcr.io/dirigiblelabs/custom-stack:latest -o type=image --platform=linux/arm64,linux/amd64 .
42+
43+
integration-tests:
44+
runs-on: ${{ matrix.os }}-latest
45+
continue-on-error: true
46+
strategy:
47+
matrix:
48+
os: [ windows ]
49+
steps:
50+
- name: Setup Chrome
51+
uses: browser-actions/[email protected]
52+
with:
53+
chrome-version: stable
54+
- if: runner.os == 'Linux'
55+
run: chrome --version
56+
- if: runner.os == 'macOS'
57+
run: chromium --version
58+
- if: runner.os == 'Windows'
59+
run: (Get-Item (Get-Command chrome).Source).VersionInfo.ProductVersion
60+
- uses: actions/checkout@v3
61+
with:
62+
fetch-depth: 0
63+
- name: Cache local Maven repository
64+
uses: actions/cache@v3
65+
with:
66+
path: ~/.m2/repository
67+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
68+
restore-keys: ${{ runner.os }}-maven-
69+
- name: Set up JDK Corretto 21
70+
uses: actions/setup-java@v3
71+
with:
72+
distribution: 'corretto'
73+
java-version: '21'
74+
architecture: x64
75+
- name: Install NodeJS
76+
uses: actions/setup-node@v3
77+
with:
78+
node-version: 18
79+
- name: Install esbuild
80+
run: npm i -g esbuild
81+
- name: Install TypeScript compiler
82+
run: npm i -g typescript
83+
- name: Maven Build
84+
run: mvn -T 1C clean install -D skipTests -D maven.javadoc.skip=true -D license.skip=true -U
85+
- name: Integration tests
86+
run: mvn verify -P integration-tests
87+
- name: Upload selenide screenshots
88+
uses: actions/[email protected]
89+
if: always()
90+
with:
91+
retention-days: 1
92+
name: selenide-screenshots
93+
path: application/build/reports/tests

.github/workflows/pull-request.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Pull Request - Platform
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
pull-request:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Cache local Maven repository
18+
uses: actions/cache@v3
19+
with:
20+
path: ~/.m2/repository
21+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22+
restore-keys: ${{ runner.os }}-maven-
23+
24+
- name: Set up JDK Corretto 20
25+
uses: actions/setup-java@v3
26+
with:
27+
distribution: 'corretto'
28+
java-version: '20'
29+
architecture: x64
30+
31+
- name: Maven Build
32+
run: mvn clean install
33+
34+
- name: Build Docker Image
35+
run: |
36+
docker buildx create --name dirigible-builder
37+
docker buildx use dirigible-builder
38+
cd application
39+
docker buildx build --tag custom-stack -o type=image --platform=linux/arm64,linux/amd64 .
40+
41+
integration-tests:
42+
runs-on: ${{ matrix.os }}-latest
43+
continue-on-error: true
44+
strategy:
45+
matrix:
46+
os: [ windows ]
47+
steps:
48+
- name: Setup Chrome
49+
uses: browser-actions/[email protected]
50+
with:
51+
chrome-version: stable
52+
- if: runner.os == 'Linux'
53+
run: chrome --version
54+
- if: runner.os == 'macOS'
55+
run: chromium --version
56+
- if: runner.os == 'Windows'
57+
run: (Get-Item (Get-Command chrome).Source).VersionInfo.ProductVersion
58+
- uses: actions/checkout@v3
59+
with:
60+
fetch-depth: 0
61+
- name: Cache local Maven repository
62+
uses: actions/cache@v3
63+
with:
64+
path: ~/.m2/repository
65+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
66+
restore-keys: ${{ runner.os }}-maven-
67+
- name: Set up JDK Corretto 21
68+
uses: actions/setup-java@v3
69+
with:
70+
distribution: 'corretto'
71+
java-version: 21
72+
- name: Install NodeJS
73+
uses: actions/setup-node@v3
74+
with:
75+
node-version: 18
76+
- name: Install esbuild
77+
run: npm i -g esbuild
78+
- name: Install TypeScript compiler
79+
run: npm i -g typescript
80+
- name: Maven Build
81+
run: mvn -T 1C clean install -D skipTests -D maven.javadoc.skip=true -D license.skip=true -U
82+
- name: Integration tests
83+
run: mvn verify -P integration-tests
84+
- name: Upload selenide screenshots
85+
uses: actions/[email protected]
86+
if: always()
87+
with:
88+
retention-days: 1
89+
name: selenide-screenshots
90+
path: application/build/reports/tests

.github/workflows/release.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release - Platform
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-version:
7+
description: Release Version
8+
required: true
9+
default: 1.0.0
10+
snapshot-version:
11+
description: Snapshot Version
12+
required: true
13+
default: 1.0.0-SNAPSHOT
14+
15+
run-name: 'version set to ${{ inputs.release-version }} for release'
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
token: ${{ secrets.GH_TOKEN }}
25+
fetch-depth: 0
26+
27+
- name: Cache local Maven repository
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.m2/repository
31+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-maven-
33+
34+
- name: "Configure Git"
35+
run: |
36+
git fetch
37+
git checkout ${{ inputs.branch }}
38+
git config user.name "${{ secrets.GH_USERNAME }}"
39+
git config user.email "${{ secrets.GH_EMAIL }}"
40+
41+
- name: Maven Set Release Version
42+
run: |
43+
mvn versions:set -DnewVersion=${{ inputs.release-version }}
44+
git add .
45+
git commit -m "version set to ${{ inputs.release-version }} for release"
46+
47+
- name: Maven Build
48+
run: mvn clean install
49+
50+
- name: Build and Push Docker Image (buildx)
51+
run: |
52+
docker buildx create --name dirigible-builder
53+
docker buildx use dirigible-builder
54+
cd application
55+
docker buildx build --tag custom-stack -o type=image --platform=linux/arm64,linux/amd64 .
56+
docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
57+
docker buildx build --push --tag ghcr.io/dirigiblelabs/custom-stack:${{ inputs.release-version }} -o type=image --platform=linux/arm64,linux/amd64 .
58+
59+
- name: "Create Release"
60+
uses: softprops/action-gh-release@v1
61+
with:
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
tag_name: v${{ inputs.release-version }}
64+
name: ${{ inputs.release-version }}
65+
draft: false
66+
prerelease: false
67+
files: |
68+
LICENSE
69+
body: ${{ inputs.release-content }}

branding/src/main/resources/META-INF/dirigible/ide-branding/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"guid": "ide-branding",
33
"repository": {
44
"type": "git",
5-
"branch": "main",
5+
"branch": "master",
66
"url": "https://github.com/dirigiblelabs/sample-custom-stack.git"
77
}
88
}

0 commit comments

Comments
 (0)