Skip to content

Commit e3d4c60

Browse files
committed
WIP
1 parent cd3b8ab commit e3d4c60

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

.github/workflows/ci.yaml

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