Skip to content

Commit 9b67401

Browse files
committed
WIP
1 parent cd3b8ab commit 9b67401

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

.github/workflows/ci.yaml

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