Skip to content

Commit

Permalink
add buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
tharindu1st committed Dec 19, 2022
1 parent cb414d5 commit 38e8eb6
Show file tree
Hide file tree
Showing 15 changed files with 271 additions and 72 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/adapter-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Install Go
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.19'
-
name: Install Revive
go-version: "1.19"
- name: Install Revive
shell: sh
run: |
go install github.com/mgechev/revive@latest
-
name: Set release username and email
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
-
name: Checkout Product-APIM
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: '0'
fetch-depth: "0"
path: apk-repo

-
name: Run Gradle build
- name: Run Gradle build
run: |
cd apk-repo/adapter
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
9 changes: 2 additions & 7 deletions .github/workflows/admin-domain-service-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ jobs:
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Checkout Product-APIM
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
- name: Build APKBase Temporarily
run: |
cd apk-repo/apkBase
gradle build
- name: Run Gradle build
run: |
cd apk-repo/admin/admin-domain-service
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
gradle :ballerina:commit_toml_files
git push
9 changes: 2 additions & 7 deletions .github/workflows/backoffice-internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ jobs:
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Checkout Product-APIM
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
- name: Build APKBase Temporarily
run: |
cd apk-repo/apkBase
gradle build
- name: Run Gradle build
run: |
cd apk-repo/backoffice/backoffice-internal-domain-service
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
gradle :ballerina:commit_toml_files
git push
9 changes: 2 additions & 7 deletions .github/workflows/backoffice-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ jobs:
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Checkout Product-APIM
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
- name: Build APKBase Temporarily
run: |
cd apk-repo/apkBase
gradle build
- name: Run Gradle build
run: |
cd apk-repo/backoffice/backoffice-domain-service
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
gradle :ballerina:commit_toml_files
git push
9 changes: 2 additions & 7 deletions .github/workflows/devportal-domain-service-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@ jobs:
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Checkout Product-APIM
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
- name: Build APKBase Temporarily
run: |
cd apk-repo/apkBase
gradle build
- name: Run Gradle build
run: |
cd apk-repo/devportal/devportal-domain-service
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
gradle :ballerina:commit_toml_files
git push
21 changes: 8 additions & 13 deletions .github/workflows/management-server-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,27 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Install Go
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.19'
-
name: Install Revive
go-version: "1.19"
- name: Install Revive
shell: sh
run: |
go install github.com/mgechev/revive@latest
-
name: Set release username and email
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
-
name: Checkout Product-APIM
- name: Checkout Product-APIM
uses: actions/checkout@v3
with:
fetch-depth: '0'
fetch-depth: "0"
path: apk-repo

-
name: Run Gradle build
- name: Run Gradle build
run: |
cd apk-repo/management-server
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
go install github.com/mgechev/revive@latest
- name: Checkout apk repo.
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/runtime-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ jobs:
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: Checkout Product-APIM
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
- name: Build APKBase Temporarily
run: |
cd apk-repo/apkBase
gradle build
- name: Run Gradle build
run: |
cd apk-repo/runtime/runtime-domain-service
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }}
gradle release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -PmultiArch=true
gradle :ballerina:commit_toml_files
git push
48 changes: 47 additions & 1 deletion admin/admin-domain-service/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,57 @@
#
#---------------------------------------------------------------

FROM apkbase:0.0.1-SNAPSHOT
FROM ubuntu:20.04

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

# install JDK Dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_VERSION jdk-11.0.17+8

RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
amd64|i386:x86-64) \
ESUM='752616097e09d7f60a3ad8bd312f90eaf50ac72577e55df229fe6e8091148f79'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jre_x64_linux_hotspot_11.0.17_8.tar.gz'; \
;; \
aarch64|arm64) \
ESUM='bd6efe3290c8b5a42f695a55a26f3e3c9c284288574879d4b7089f31f5114177'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.17_8.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /opt/java/openjdk; \
cd /opt/java/openjdk; \
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
rm -rf /tmp/openjdk.tar.gz;

ENV JAVA_HOME=/opt/java/openjdk \
PATH="/opt/java/openjdk/bin:$PATH"

RUN echo Verifying install ... \
&& echo java --version && java --version \
&& echo Complete.

ARG USER=wso2apk
ARG USER_ID=802
ARG USER_GROUP=wso2
ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}

RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER}

COPY docker-entrypoint.sh ${USER_HOME}
ADD admin ${USER_HOME}/admin
RUN chown -R ${USER} ${USER_HOME}/admin
Expand Down
48 changes: 47 additions & 1 deletion backoffice/backoffice-domain-service/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,57 @@
#
#---------------------------------------------------------------

FROM apkbase:0.0.1-SNAPSHOT
FROM ubuntu:20.04

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

# install JDK Dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_VERSION jdk-11.0.17+8

RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
amd64|i386:x86-64) \
ESUM='752616097e09d7f60a3ad8bd312f90eaf50ac72577e55df229fe6e8091148f79'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jre_x64_linux_hotspot_11.0.17_8.tar.gz'; \
;; \
aarch64|arm64) \
ESUM='bd6efe3290c8b5a42f695a55a26f3e3c9c284288574879d4b7089f31f5114177'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.17_8.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /opt/java/openjdk; \
cd /opt/java/openjdk; \
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
rm -rf /tmp/openjdk.tar.gz;

ENV JAVA_HOME=/opt/java/openjdk \
PATH="/opt/java/openjdk/bin:$PATH"

RUN echo Verifying install ... \
&& echo java --version && java --version \
&& echo Complete.

ARG USER=wso2apk
ARG USER_ID=802
ARG USER_GROUP=wso2
ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}

RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER}

COPY docker-entrypoint.sh ${USER_HOME}
ADD backoffice ${USER_HOME}/backoffice
RUN chown -R ${USER} ${USER_HOME}/backoffice
Expand Down
51 changes: 50 additions & 1 deletion backoffice/backoffice-internal-domain-service/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,56 @@
#
#---------------------------------------------------------------

FROM apkbase:0.0.1-SNAPSHOT
FROM ubuntu:20.04

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

# install JDK Dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_VERSION jdk-11.0.17+8

RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
amd64|i386:x86-64) \
ESUM='752616097e09d7f60a3ad8bd312f90eaf50ac72577e55df229fe6e8091148f79'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jre_x64_linux_hotspot_11.0.17_8.tar.gz'; \
;; \
aarch64|arm64) \
ESUM='bd6efe3290c8b5a42f695a55a26f3e3c9c284288574879d4b7089f31f5114177'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.17_8.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /opt/java/openjdk; \
cd /opt/java/openjdk; \
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
rm -rf /tmp/openjdk.tar.gz;

ENV JAVA_HOME=/opt/java/openjdk \
PATH="/opt/java/openjdk/bin:$PATH"

RUN echo Verifying install ... \
&& echo java --version && java --version \
&& echo Complete.

ARG USER=wso2apk
ARG USER_ID=802
ARG USER_GROUP=wso2
ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}

RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER}

ARG USER=wso2apk
ARG USER_HOME=/home/${USER}
Expand Down
2 changes: 0 additions & 2 deletions build-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ set -e
#All relative paths etc designed from root directory. Users can customize this as per demand. Ex: If you wish to
#build and run runtime domain service then can build it alone and do deployment.
current_dir=$PWD;
#Component build sample. You can build any component with this
cd apkBase;gradle build;
cd $current_dir;
cd backoffice/backoffice-domain-service;gradle build;
cd $current_dir;
Expand Down
Loading

0 comments on commit 38e8eb6

Please sign in to comment.