Skip to content

Commit 775c084

Browse files
committed
WIP
1 parent cd3b8ab commit 775c084

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Rust CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
prepare:
10+
name: Determine image tag
11+
runs-on: ubuntu-latest
12+
#if: |
13+
# github.ref_name == 'main' ||
14+
# startsWith(github.head_ref, 'feature/') ||
15+
# startsWith(github.head_ref, 'bugfix/') ||
16+
# (github.event_name == 'workflow_dispatch' && (startsWith(github.ref_name, 'feature/') || startsWith(github.ref_name, 'bugfix/')))
17+
outputs:
18+
image_tag: ${{ steps.determine-tag.outputs.image_tag }}
19+
jar_path: ${{ steps.jar-path.outputs.jar_path }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Determine base tag
27+
id: determine-tag
28+
run: |
29+
if [ "${{ github.event_name }}" = "pull_request" ] ; then
30+
SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8)
31+
else
32+
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
33+
fi
34+
35+
if [ "${{ github.ref_name }}" = "main" ] ; then
36+
echo "Processing main branch"
37+
echo "image_tag=dev-${SHORT_SHA}" | tee -a $GITHUB_OUTPUT
38+
else
39+
# This covers feature/ and bugfix/ branches
40+
echo "Processing feature/bugfix branch ${{ github.head_ref }}"
41+
echo "image_tag=feature-${SHORT_SHA}" | tee -a $GITHUB_OUTPUT
42+
fi
43+
44+
- name: Build jar
45+
id: jar-path
46+
run: |
47+
./gradlew build
48+
echo "jar_path=$(./gradlew properties | grep jarPathForOCI | cut -d" " -f2)" | tee -a $GITHUB_OUTPUT
49+
with:
50+
env:
51+
ORG_GRADLE_PROJECT_nexusUser: ${{ secrets.NEXUS_USERNAME }}
52+
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }}
53+
54+
build-oci-image:
55+
name: Build OCI images
56+
needs: prepare
57+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@feature/improve-docker-build
58+
with:
59+
image-name: docker-regis.iex.ec/iexec-blockchain-adpter-api
60+
image-tag: ${{ needs.prepare.outputs.image_tag }}
61+
dockerfile: Dockerfile
62+
context: .
63+
registry: docker-regis.iex.ec
64+
push: true
65+
security-scan: true
66+
security-report: "sarif"
67+
hadolint: true
68+
platforms: linux/amd64
69+
build-args: |
70+
jar=${{ needs.prepare.outputs.jar_path }}
71+
secrets:
72+
username: ${{ secrets.NEXUS_USERNAME }}
73+
password: ${{ secrets.NEXUS_PASSWORD }}

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
buildJavaProject(
33
integrationTestsEnvVars: ['BROKER_PRIVATE_KEY'],
44
shouldPublishJars: true,
5-
shouldPublishDockerImages: true)
5+
shouldPublishDockerImages: false)

0 commit comments

Comments
 (0)