Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Added Build and Pr build github actions workflow #157

Merged
merged 28 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c16bf9e
initial commit
jaydee029 Jul 26, 2024
cdb8e89
initial commit
jaydee029 Jul 26, 2024
e1229bd
fetching and running docker image
jaydee029 Jul 26, 2024
9054653
fetching and running docker image
jaydee029 Jul 26, 2024
adfb657
fetching and running docker image
jaydee029 Jul 26, 2024
541f3f2
fetching and running docker image
jaydee029 Jul 26, 2024
cc4261c
fetching and running docker image
jaydee029 Jul 26, 2024
49ab62f
fetching and running docker image
jaydee029 Jul 26, 2024
1438a91
fetching and running docker image
jaydee029 Jul 26, 2024
f95fc37
fetching and running docker image
jaydee029 Jul 26, 2024
fd2ed1e
fetching and running docker image
jaydee029 Jul 26, 2024
5fce660
fetching and running docker image
jaydee029 Jul 26, 2024
98755b8
fetching and running docker image
jaydee029 Jul 26, 2024
dd6e114
added pr build workflow, docker images and config files
jaydee029 Jul 26, 2024
f097037
added pr build workflow, docker images and config files
jaydee029 Jul 26, 2024
53bcc9a
edited pr build workflow
jaydee029 Jul 26, 2024
238f766
Merge pull request #1 from jaydee029/build
jaydee029 Jul 26, 2024
8e6019b
edited pr build workflow
jaydee029 Jul 26, 2024
d57febd
edited pr build workflow
jaydee029 Jul 26, 2024
b2ccf72
edited pr build workflow
jaydee029 Jul 26, 2024
8cd5ce7
edited pr build workflow
jaydee029 Jul 26, 2024
1156ce4
Merge pull request #2 from jaydee029/build
jaydee029 Jul 26, 2024
39095ba
added custom settings.xml
jaydee029 Jul 29, 2024
052c20e
Merge pull request #3 from jaydee029/build
jaydee029 Jul 29, 2024
71cbb75
edit: namespace
jaydee029 Jul 29, 2024
17c07d4
Merge pull request #4 from jaydee029/build
jaydee029 Jul 29, 2024
bc7f41e
made required changes
jaydee029 Jul 30, 2024
a242f04
Merge pull request #5 from jaydee029/build
jaydee029 Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 237 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
name: PR build

on:
pull_request:
branches: [main]

env:
REGISTRY: ghcr.io
NAMESPACE: galasa-dev
IMAGE_TAG: main

jobs:
build-obr:
name: Build OBR using galasabld image and maven
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
path: obr

- name: Checkout framework
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/framework
path: framework

- name: Checkout managers
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/managers
path: managers

- name: Checkout extensions
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/extensions
path: extensions

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'semeru'
cache: maven

- name: Print githash
run: |
echo $GITHUB_SHA > ./obr.githash

- name: Make secrets directory
run : |
mkdir /home/runner/work/secrets

- name: Copy settings.xml
env:
MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }}
run : |
echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml
- name: Copy GPG passphrase
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run : |
echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file
- name: Copy GPG key
env:
GPG_KEY_BASE64: ${{ secrets.GPG_KEY }}
run : |
echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg

- name: Make GPG home directory and change permissions
run: |
mkdir /home/runner/work/gpg
chmod '700' /home/runner/work/gpg

- name: Import GPG
run: |
gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg

- name: Copy custom settings.xml
run: |
cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml

- name: Generate Galasa BOM
run: |
docker run --rm -v ${{github.workspace}}:/var/root/ ghcr.io/${{env.NAMESPACE}}/galasabld-amd64:${{env.IMAGE_TAG}} template --releaseMetadata var/root/framework/release.yaml --releaseMetadata /var/root/extensions/release.yaml --releaseMetadata /var/root/managers/release.yaml --releaseMetadata /var/root/obr/release.yaml --template /var/root/obr/galasa-bom/pom.template --output /var/root/obr/galasa-bom/pom.xml --bom

- name: Display Galasa BOM pom.xml
run: |
cat ${{github.workspace}}/obr/galasa-bom/pom.xml


- name: Build Galasa BOM with maven
run: |
mvn -f ${{github.workspace}}/obr/galasa-bom/pom.xml deploy -Dgpg.skip=true \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \
--batch-mode --errors --fail-at-end \
--settings /home/runner/work/gpg/settings.xml

- name: Generate Galasa OBR
run: |
docker run --rm -v ${{github.workspace}}:/var/root/ ghcr.io/${{env.NAMESPACE}}/galasabld-amd64:${{env.IMAGE_TAG}} template --releaseMetadata var/root/framework/release.yaml --releaseMetadata /var/root/extensions/release.yaml --releaseMetadata /var/root/managers/release.yaml --releaseMetadata /var/root/obr/release.yaml --template /var/root/obr/dev.galasa.uber.obr/pom.template --output /var/root/obr/dev.galasa.uber.obr/pom.xml --obr

- name: Display Galasa OBR pom.xml
run: |
cat ${{github.workspace}}/obr/dev.galasa.uber.obr/pom.xml

- name: Build Galasa OBR with maven
run: |
mvn -f ${{github.workspace}}/obr/dev.galasa.uber.obr/pom.xml deploy -Dgpg.skip=true \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \
--batch-mode --errors --fail-at-end \
--settings /home/runner/work/gpg/settings.xml

- name: Build OBR image for testing
uses: docker/build-push-action@v5
with:
context: .
file: ${{github.workspace}}/obr/dockerfiles/dockerfile.obr
load: true
tags: obr:test
build-args: |
dockerRepository=${{env.REGISTRY}}
tag=${{env.IMAGE_TAG}}


build-obr-javadocs:
name: Build OBR javadocs using galasabld image and maven
runs-on: ubuntu-latest
needs: build-obr

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
path: obr

- name: Checkout framework
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/framework
path: framework

- name: Checkout managers
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/managers
path: managers

- name: Checkout extensions
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/extensions
path: extensions

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '18'
distribution: 'semeru'
cache: maven

- name: Make secrets directory
run : |
mkdir /home/runner/work/secrets

- name: Copy settings.xml
env:
MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }}
run : |
echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml

- name: Copy GPG passphrase
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run : |
echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file

- name: Copy GPG key
env:
GPG_KEY_BASE64: ${{ secrets.GPG_KEY }}
run : |
echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg

- name: Make GPG home directory and change permissions
run: |
mkdir /home/runner/work/gpg
chmod '700' /home/runner/work/gpg

- name: Import GPG
run: |
gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg

- name: Copy custom settings.xml
run: |
cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml

- name: Build Galasa Javadoc
run: |
docker run --rm -v ${{github.workspace}}:/var/root/ ghcr.io/${{env.NAMESPACE}}/galasabld-amd64:${{env.IMAGE_TAG}} template --releaseMetadata var/root/framework/release.yaml --releaseMetadata /var/root/extensions/release.yaml --releaseMetadata /var/root/managers/release.yaml --releaseMetadata /var/root/obr/release.yaml --template /var/root/obr/javadocs/pom.template --output /var/root/obr/javadocs/pom.xml --javadoc

- name: Display Galasa Javadoc pom.xml
run: |
cat ${{github.workspace}}/obr/javadocs/pom.xml

- name: Build javadoc site using maven
run: |
mvn -f ${{github.workspace}}/obr/javadocs/pom.xml deploy -Dgpg.skip=true \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/obr/javadocs/docker/repo \
-Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end \
--settings /home/runner/work/gpg/settings.xml

- name: Build javadocsite Image for testing
uses: docker/build-push-action@v5
with:
context: .
file: ${{github.workspace}}/obr/dockerfiles/dockerfile.javadocsite
load: true
tags: javadocsite:test

- name: Build Javadoc Maven repo Image for testing
uses: docker/build-push-action@v5
with:
context: .
file: ${{github.workspace}}/obr/dockerfiles/dockerfile.javadocmavenrepo
load: true
tags: javadocmavenrepo:test
build-args: |
dockerRepository=${{env.REGISTRY}}
tag=latest
5 changes: 5 additions & 0 deletions dockerfiles/dockerfile.javadocmavenrepo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG baseVersion
ARG dockerRepository
FROM ${dockerRepository}/galasadev/base-image:${baseVersion}

COPY obr/javadocs/docker/repo/ /usr/local/apache2/htdocs/
6 changes: 6 additions & 0 deletions dockerfiles/dockerfile.javadocsite
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM harbor.galasa.dev/docker_proxy_cache/library/httpd:2.4.59

RUN rm -v /usr/local/apache2/htdocs/*
COPY obr/dockerfiles/httpdconf/httpd.conf /usr/local/apache2/conf/httpd.conf

COPY obr/javadocs/target/site/apidocs/ /usr/local/apache2/htdocs/
7 changes: 7 additions & 0 deletions dockerfiles/dockerfile.obr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG dockerRepository
ARG tag

FROM ${dockerRepository}/galasadev/managers-maven-artefacts:${tag}

COPY obr/repo/ /usr/local/apache2/htdocs/
COPY obr.githash /usr/local/apache2/htdocs/obr.githash
Loading
Loading