Skip to content

Commit 9f495e6

Browse files
committed
WIP
1 parent cd3b8ab commit 9f495e6

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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: Determine base tag
22+
id: determine-tag
23+
run: |
24+
if [ "${{ github.event_name }}" = "pull_request" ] ; then
25+
SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8)
26+
else
27+
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
28+
fi
29+
30+
if [ "${{ github.ref_name }}" = "main" ] ; then
31+
echo "Processing main branch"
32+
echo "image_tag=dev-${SHORT_SHA}" | tee -a $GITHUB_OUTPUT
33+
else
34+
# This covers feature/ and bugfix/ branches
35+
echo "Processing feature/bugfix branch ${{ github.head_ref }}"
36+
echo "image_tag=feature-${SHORT_SHA}" | tee -a $GITHUB_OUTPUT
37+
fi
38+
echo "jar_path=$(./gradlew properties | grep jarPathForOCI | cut -d" " -f2)" | tee -a $GITHUB_OUTPUT
39+
40+
build-oci-image:
41+
name: Build OCI images
42+
needs: prepare
43+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@feature/improve-docker-build
44+
with:
45+
image-name: docker-regis.iex.ec/iexec-blockchain-adpter-api
46+
image-tag: ${{ needs.prepare.outputs.image_tag }}
47+
dockerfile: Dockerfile
48+
context: .
49+
registry: docker-regis.iex.ec
50+
push: true
51+
security-scan: true
52+
security-report: "sarif"
53+
hadolint: true
54+
platforms: linux/amd64
55+
build-args: |
56+
jar=${{ needs.prepare.outputs.jar_path }}
57+
secrets:
58+
username: ${{ secrets.NEXUS_USERNAME }}
59+
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)