Skip to content

Commit fa59b6c

Browse files
committed
WIP
1 parent cd3b8ab commit fa59b6c

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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.determine-tag.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+
echo "jar_path=$(./gradlew properties | grep jarPathForOCI | cut -d" " -f2)" | tee -a $GITHUB_OUTPUT
44+
45+
build-oci-image:
46+
name: Build OCI images
47+
needs: prepare
48+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@feature/improve-docker-build
49+
with:
50+
image-name: docker-regis.iex.ec/iexec-blockchain-adpter-api
51+
image-tag: ${{ needs.prepare.outputs.image_tag }}
52+
dockerfile: Dockerfile
53+
context: .
54+
registry: docker-regis.iex.ec
55+
push: true
56+
security-scan: true
57+
security-report: "sarif"
58+
hadolint: true
59+
platforms: linux/amd64
60+
build-args: |
61+
jar=${{ needs.prepare.outputs.jar_path }}
62+
secrets:
63+
username: ${{ secrets.NEXUS_USERNAME }}
64+
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)