Skip to content

Commit 662474f

Browse files
committed
WIP
1 parent cd3b8ab commit 662474f

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/ci.yaml

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