Skip to content

Commit df2e31e

Browse files
Merge pull request #46 from splitio/INFRA-8947
Add ECR docker registry
2 parents fba2b0f + 0646912 commit df2e31e

3 files changed

Lines changed: 63 additions & 15 deletions

File tree

.github/workflows/docker.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
id-token: write
11+
812
jobs:
913
build-docker-image:
1014
name: Build and push Docker image
@@ -13,25 +17,45 @@ jobs:
1317
matrix:
1418
fips_mode: [enabled, disabled]
1519
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Login to DockerHub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ vars.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_RO_TOKEN }}
28+
29+
- name: Configure AWS credentials
30+
if: ${{ github.event_name == 'push' }}
31+
uses: aws-actions/configure-aws-credentials@v4
32+
with:
33+
role-to-assume: ${{ vars.ECR_TESTING_ROLE_ARN }}
34+
aws-region: us-east-1
35+
36+
- name: Login to Amazon ECR
37+
if: ${{ github.event_name == 'push' }}
38+
uses: aws-actions/amazon-ecr-login@v2
39+
1640
- name: Login to Artifactory
41+
if: ${{ github.event_name == 'push' }}
1742
uses: docker/login-action@v3
1843
with:
19-
registry: splitio-docker.jfrog.io
20-
username: ${{ secrets.ARTIFACTORY_DOCKER_USER }}
44+
registry: ${{ vars.ARTIFACTORY_DOCKER_REGISTRY }}
45+
username: ${{ vars.ARTIFACTORY_DOCKER_USER }}
2146
password: ${{ secrets.ARTIFACTORY_DOCKER_PASS }}
2247

23-
- name: Checkout code
24-
uses: actions/checkout@v4
25-
2648
- name: Set VERSION env
2749
run: echo "VERSION=$(cat splitio/version.go | grep 'Version =' | awk '{print $4}' | tr -d '"')" >> $GITHUB_ENV
2850

29-
- name: Docker build and push
30-
uses: docker/build-push-action@v5
51+
- name: Docker Build and Push
52+
uses: docker/build-push-action@v6
3153
with:
3254
context: .
3355
file: "infra/sidecar.Dockerfile"
3456
push: true
35-
tags: splitio-docker.jfrog.io/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }}
57+
tags: |
58+
${{ vars.ARTIFACTORY_DOCKER_REGISTRY }}/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }}
59+
${{ vars.ECR_TESTING_URL }}/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }}
3660
build-args: |
3761
FIPS_MODE=${{ matrix.fips_mode }}

.github/workflows/unstable.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
branches-ignore:
55
- main
66

7+
permissions:
8+
contents: read
9+
id-token: write
10+
711
jobs:
812
push-docker-image:
913
name: Build and Push Docker Image
@@ -12,25 +16,45 @@ jobs:
1216
matrix:
1317
fips_mode: [enabled, disabled]
1418
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Login to DockerHub
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ vars.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_RO_TOKEN }}
27+
28+
- name: Configure AWS credentials
29+
if: ${{ github.event_name == 'push' }}
30+
uses: aws-actions/configure-aws-credentials@v4
31+
with:
32+
role-to-assume: ${{ vars.ECR_TESTING_ROLE_ARN }}
33+
aws-region: us-east-1
34+
35+
- name: Login to ECR
36+
if: ${{ github.event_name == 'push' }}
37+
uses: aws-actions/amazon-ecr-login@v2
38+
1539
- name: Login to Artifactory
40+
if: ${{ github.event_name == 'push' }}
1641
uses: docker/login-action@v3
1742
with:
1843
registry: splitio-docker-dev.jfrog.io
19-
username: ${{ secrets.ARTIFACTORY_DOCKER_USER }}
44+
username: ${{ vars.ARTIFACTORY_DOCKER_USER }}
2045
password: ${{ secrets.ARTIFACTORY_DOCKER_PASS }}
2146

22-
- name: Checkout code
23-
uses: actions/checkout@v4
24-
2547
- name: Get short hash
2648
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
2749

2850
- name: Docker Build and Push
29-
uses: docker/build-push-action@v5
51+
uses: docker/build-push-action@v6
3052
with:
3153
context: .
3254
file: "infra/sidecar.Dockerfile"
3355
push: true
34-
tags: splitio-docker-dev.jfrog.io/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || '' }}:${{ env.SHORT_SHA }}
56+
tags: |
57+
splitio-docker-dev.jfrog.io/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || '' }}:${{ env.SHORT_SHA }}
58+
${{ vars.ECR_TESTING_URL }}/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || '' }}:${{ env.SHORT_SHA }}
3559
build-args: |
3660
FIPS_MODE=${{ matrix.fips_mode }}

splitio/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package splitio
22

3-
const Version = "1.6.0"
3+
const Version = "1.6.1"

0 commit comments

Comments
 (0)