This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating Main Build and PR build pipelines using github actions (#53)
* pr build workflow Signed-off-by: dhruv <[email protected]> * pr build workflow Signed-off-by: dhruv <[email protected]> * go version edited Signed-off-by: dhruv <[email protected]> * docker path edited Signed-off-by: dhruv <[email protected]> * docker path edited Signed-off-by: dhruv <[email protected]> * docker command edited Signed-off-by: dhruv <[email protected]> * minor workflow edits Signed-off-by: dhruv <[email protected]> * main build workflow Signed-off-by: dhruv <[email protected]> * main build workflow edit Signed-off-by: dhruv <[email protected]> * main build workflow edit Signed-off-by: dhruv <[email protected]> * main build workflow edited Signed-off-by: dhruv <[email protected]> * main build workflow minor edits Signed-off-by: dhruv <[email protected]> * main build workflow minor edits Signed-off-by: dhruv <[email protected]> * main build workflow minor edits Signed-off-by: dhruv <[email protected]> * added jobs/steps to main build workflow Signed-off-by: dhruv <[email protected]> * minor edits in main build workflow Signed-off-by: dhruv <[email protected]> * added galasabld-ibm job, related certificates, dockerfiles Signed-off-by: dhruv <[email protected]> * minor fixes Signed-off-by: dhruv <[email protected]> * minor fixes Signed-off-by: dhruv <[email protected]> * testing Signed-off-by: dhruv <[email protected]> * testing Signed-off-by: dhruv <[email protected]> * adding pom Signed-off-by: dhruv <[email protected]> * testing upload artifacts action Signed-off-by: dhruv <[email protected]> * testing upload artifacts action Signed-off-by: dhruv <[email protected]> * testing upload artifacts action Signed-off-by: dhruv <[email protected]> * minor edits Signed-off-by: dhruv <[email protected]> * minor fixes Signed-off-by: dhruv <[email protected]> * namespace changes Signed-off-by: dhruv <[email protected]> * final fixes Signed-off-by: dhruv <[email protected]> * final fixes Signed-off-by: dhruv <[email protected]> * final fixes Signed-off-by: dhruv <[email protected]> * edited pr build to add pr number Signed-off-by: dhruv <[email protected]> * edited ibm image Signed-off-by: dhruv <[email protected]> --------- Signed-off-by: dhruv <[email protected]>
- Loading branch information
Showing
7 changed files
with
333 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: PR-build | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
IMAGE_TAG: ${{ github.event.number }} | ||
|
||
jobs: | ||
build-galasabld: | ||
name: build Galasabld | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Build galasabld using the makefile | ||
run: | | ||
make all | ||
- name: Build and test Galasa Image | ||
run: | | ||
docker build -t galasabld:${{env.IMAGE_TAG}} --build-arg platform=linux-amd64 -f dockerfiles/galasabld/dockerfile.galasabld . | ||
docker run --rm galasabld:${{env.IMAGE_TAG}} | ||
|
||
|
||
build-openapi2beans: | ||
name: build Openapi2beans | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Build and test openapi2beans using the makefile | ||
run: | | ||
make all -C openapi2beans/ | ||
- name: Build and test Openapi2beans Image | ||
run: | | ||
docker build -t openapi2beans:${{env.IMAGE_TAG}} --build-arg platform=linux-x86_64 -f dockerfiles/openapi2beans/dockerfile.openapi2beans . | ||
docker run --rm openapi2beans:${{env.IMAGE_TAG}} | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
name: Main Build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
NAMESPACE: galasa-dev | ||
IMAGE_TAG: main | ||
BRANCH: main | ||
|
||
jobs: | ||
build-Push-galasabld : | ||
name: Build and push Galasabld artefacts | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
config: [{'name':'linux','arch':'amd64'},{'name':'windows','arch':'amd64'},{'name':'darwin','arch':'amd64'},{'name':'darwin','arch':'arm64'},{'name':'linux','arch':'s390x'}] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Build galasabld using the makefile | ||
run: | | ||
echo $REGISTRY | ||
make all | ||
- name: Login to Github Container Regitery | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{env.REGISTRY}} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata for Galasabld Image | ||
id: metadata | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{env.REGISTRY}}/${{env.NAMESPACE}}/galasabld-amd64 | ||
|
||
- name: Build galasa Image for testing | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: dockerfiles/galasabld/dockerfile.galasabld | ||
build-args: platform=linux-amd64 | ||
load: true | ||
tags: galasabld-amd64:${{env.IMAGE_TAG}} | ||
|
||
- name: Testing Galasabld Image | ||
run: | | ||
docker run --rm galasabld-amd64:${{env.IMAGE_TAG}} | ||
- name: Build and push Galsabld Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: dockerfiles/galasabld/dockerfile.galasabld | ||
build-args: platform=linux-amd64 | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
|
||
- name: Push Galasabld executables | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: galasabld-${{matrix.config.name}}-${{matrix.config.arch}} | ||
path: bin/galasabld-${{matrix.config.name}}-${{matrix.config.arch}} | ||
|
||
|
||
build-Push-galasabld-ibm: | ||
name: Build and Push Galasabld IBM Image | ||
runs-on: ubuntu-latest | ||
needs: build-Push-galasabld | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Github Container Regitery | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{env.REGISTRY}} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata for Galasabld Image | ||
id: metadata | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{env.REGISTRY}}/${{env.NAMESPACE}}/galasabld-ibm | ||
|
||
- name: Build galasa Image for testing | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: dockerfiles/galasabld/dockerfile.galasabld-ibm | ||
build-args: | | ||
dockerRepository=ghcr.io | ||
branch=${{env.BRANCH}} | ||
load: true | ||
tags: galasabld-ibm:${{env.IMAGE_TAG}} | ||
|
||
- name: Testing Galasabld Image | ||
run: | | ||
docker run --rm galasabld-ibm:${{env.IMAGE_TAG}} | ||
- name: Build and push Galsabld-Ibm Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: dockerfiles/galasabld/dockerfile.galasabld-ibm | ||
build-args: | | ||
dockerRepository=ghcr.io | ||
branch=${{env.BRANCH}} | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
|
||
|
||
|
||
build-Push-openapi2beans: | ||
name: Build and push openapi2beans artefacts | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
config: [{'name':'darwin','arch':'arm64'},{'name':'darwin','arch':'x86_64'},{'name':'linux','arch':'x86_64'}] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Build openapi2beans using the makefile | ||
run: | | ||
make all -C openapi2beans/ | ||
- name: Login to Github Container Regitery | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{env.REGISTRY}} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata for openapi2beans Image | ||
id: metadata | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{env.REGISTRY}}/${{env.NAMESPACE}}/openapi2beans | ||
|
||
- name: Build openapi2beans Image for testing | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: dockerfiles/openapi2beans/dockerfile.openapi2beans | ||
build-args: platform=linux-x86_64 | ||
load: true | ||
tags: openapi2beans:${{env.IMAGE_TAG}} | ||
|
||
- name: Testing openapi2beans Image | ||
run: | | ||
docker run --rm openapi2beans:${{env.IMAGE_TAG}} | ||
- name: Build and push openapi2beans Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: dockerfiles/openapi2beans/dockerfile.openapi2beans | ||
build-args: platform=linux-x86_64 | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
|
||
- name: Push openapi2beans executables | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: openapi2beans-${{matrix.config.name}}-${{matrix.config.arch}} | ||
path: openapi2beans/bin/openapi2beans-${{matrix.config.name}}-${{matrix.config.arch}} | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MII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6GPGh0dHA6Ly9kYXltdnMxLnBv | ||
ay5pYm0uY29tOjIwMDEvUEtJU2Vydi9jYWNlcnRzUm9vdC9DUkwwLmNybDAdBgNV | ||
HQ4EFgQUBi/ax5ofP4dRuU3Q9tqul0ZKncgwHwYDVR0jBBgwFoAU+d4Y5Z4wE2lR | ||
p/15hUiMfA5v2OMwgYwGA1UdIASBhDCBgTB/BgMqAwQweDB2BggrBgEFBQcCARZq | ||
aHR0cDovL3czLTAzLmlibS5jb20vdHJhbnNmb3JtL3Nhcy9hcy13ZWIubnNmL0Nv | ||
bnRlbnREb2NzQnlUaXRsZS9JbmZvcm1hdGlvbitUZWNobm9sb2d5K1NlY3VyaXR5 | ||
K1N0YW5kYXJkczANBgkqhkiG9w0BAQsFAAOCAQEAWwI8opg0H1ukbTLsf+XXRrHY | ||
BDUB3pwAApSh9fruGc3Nt5IbKD8687oiutxBFwJ0xxPdP1/BL3HycCqzSDQFtSVd | ||
UASJOF1+GB9DNDwrreOWaUTg2cHCIxOij9E9ypU64we9OL27FjcwYKnDbqfOrsxr | ||
trRaxLmM2+lNaBHIMsAIbMH9vN11G7SpzsZ5Nr5hZXIlxfq9/HfQujE6hoCgt2ho | ||
M0i4gRyLdVOaNCHPeoVO6n7OsOKm36BgXT62B36e5rvdKzzbUZZLse9QPtvRychy | ||
APAX89wiHIqiFstesWL+kImp1C9L6iVM4DGbwGCqKxTnX2asika0xH3gWuoZjA== | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIID5TCCAs2gAwIBAgIBFDANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzE0 | ||
MDIGA1UEChMrSW50ZXJuYXRpb25hbCBCdXNpbmVzcyBNYWNoaW5lcyBDb3Jwb3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QjZZBCsF+cWbU1nxvRNQluzCsTDUEIfThJIF | ||
cLu0WkoQclUrC3d2tM8jclLPssb6/OV8GaJ+4mx4ri7HbGaUAOtA/TXKR6AuhgkR | ||
NPKYhpPU0q/PRlGXdwJP8zXb8+CXMMTnI5Upur7Tc5T3I/x1Gqfz7n1sTRZfsuiQ | ||
J5uua4hz4te3oV2tm7LWcNItHD43zttBTTx/m5icg71JE2gcr2oincw= | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM harbor.galasa.dev/docker_proxy_cache/library/alpine:3.18.4 | ||
|
||
ARG platform | ||
|
||
COPY bin/galasabld-${platform} /bin/galasabld | ||
|
||
ENTRYPOINT ["/bin/galasabld"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ARG dockerRepository | ||
ARG branch | ||
FROM ${dockerRepository}/galasa-dev/galasabld-amd64:${branch} | ||
|
||
USER root | ||
|
||
COPY certificates/ibmroot.pem /etc/ssl/certs/ibmroot.pem | ||
COPY certificates/ibminter.pem /etc/ssl/certs/ibminter.pem | ||
RUN cat /etc/ssl/certs/ibmroot.pem >> /etc/ssl/certs/ca-certificates.crt | ||
RUN cat /etc/ssl/certs/ibminter.pem >> /etc/ssl/certs/ca-certificates.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM harbor.galasa.dev/docker_proxy_cache/library/alpine:3.18.4 | ||
|
||
ARG platform | ||
|
||
COPY openapi2beans/bin/openapi2beans-${platform} /bin/openapi2beans | ||
|
||
ENTRYPOINT ["/bin/openapi2beans"] |