Skip to content

Commit

Permalink
Add deploy job for cross compiled aarch64 (netty#10883)
Browse files Browse the repository at this point in the history
Motivation:

We should also deploy snapshots for our cross compiled native jars.

Modifications:

- Add job and docker files for deploying cross compiled native jars
- Ensure we map the maven cache into our docker containers

Result:

Deploy aarch64 jars and re-use cache
  • Loading branch information
normanmaurer authored Dec 22, 2020
1 parent 11d2ce7 commit 0af6031
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 13 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,41 @@ jobs:

- name: Deploy snapshots
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run deploy

deploy-linux-aarch64:
runs-on: ubuntu-latest
# We depend on the deploy of linux-x86_64 so we can download the dependencies
needs: deploy-linux-x86_64
steps:
- uses: s4u/[email protected]
with:
servers: |
[{
"id": "sonatype-nexus-snapshots",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
- uses: actions/checkout@v2

# Cache .m2/repository
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: deploy-linux-aarch64-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
deploy-linux-aarch64-${{ runner.os }}-maven-
# Enable caching of Docker layers
- uses: satackey/[email protected]
continue-on-error: true
with:
key: deploy-linux-aarch64-docker-cache-{hash}
restore-keys: |
deploy-linux-aarch64-docker-cache-
- name: Build docker image
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-7.yaml build

- name: Deploy snapshots
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-7.yaml run deploy
35 changes: 35 additions & 0 deletions docker/docker-compose.centos-7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: "3"

services:


cross-compile-aarch64-runtime-setup:
image: netty:cross_compile_aarch64
build:
context: ../
dockerfile: docker/Dockerfile.cross_compile_aarch64
args:
gcc_version: "4.9-2016.02"
java_version: "[email protected]"

cross-compile-aarch64-common: &cross-compile-aarch64-common
depends_on: [ cross-compile-aarch64-runtime-setup ]
image: netty:cross_compile_aarch64
volumes:
- ~/.ssh:/root/.ssh
- ~/.gnupg:/root/.gnupg
- ~/.m2:/root/.m2
- ..:/code
working_dir: /code

cross-compile-aarch64-deploy:
<<: *cross-compile-aarch64-common
command: /bin/bash -cl "./mvnw -pl transport-native-unix-common,transport-native-epoll clean deploy -Plinux-aarch64 -DskipTests=true"

cross-compile-aarch64-shell:
<<: *cross-compile-aarch64-common
entrypoint: /bin/bash

cross-compile-aarch64-build:
<<: *cross-compile-aarch64-common
command: /bin/bash -cl "./mvnw -pl transport-native-unix-common,transport-native-epoll clean package -Plinux-aarch64 -DskipTests=true"
17 changes: 4 additions & 13 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ services:
image: netty:default
depends_on: [runtime-setup]
volumes:
- ~/.ssh:/root/.ssh:delegated
- ~/.gnupg:/root/.gnupg:delegated
- ..:/code:delegated
- ~/.ssh:/root/.ssh
- ~/.gnupg:/root/.gnupg
- ~/.m2:/root/.m2
- ..:/code
working_dir: /code

build-leak:
Expand All @@ -27,11 +28,6 @@ services:

deploy:
<<: *common
volumes:
- ~/.ssh:/root/.ssh
- ~/.gnupg:/root/.gnupg
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code
command: /bin/bash -cl "./mvnw clean deploy -DskipTests=true"

test-leak:
Expand All @@ -48,9 +44,4 @@ services:

shell:
<<: *common
volumes:
- ~/.ssh:/root/.ssh:delegated
- ~/.gnupg:/root/.gnupg:delegated
- ..:/code:delegated
- ~/.m2:/root/.m2:delegated
entrypoint: /bin/bash

0 comments on commit 0af6031

Please sign in to comment.