Skip to content

Commit

Permalink
Update image-release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
davi17g committed Dec 29, 2024
1 parent 1b84d85 commit ce91bec
Showing 1 changed file with 77 additions and 77 deletions.
154 changes: 77 additions & 77 deletions .github/workflows/image-release.yaml
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
name: Build Release Docker Images
on:
push:
tags:
- 'v*'

workflow_dispatch:
jobs:
build-images:
runs-on: ubuntu-latest
steps:
- name: Checkout Automation Code
uses: actions/checkout@v4
- name: Get Metadata
run: |
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
echo "TAG=$(cat VERSION | cut -c 2-)" >> $GITHUB_ENV
echo "ISO8601=$(LC_TIME=en_US.UTF-8 date "+%Y-%m-%dT%H:%M:%S%z")" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Jfrog
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.ARTIFACTORY_URL }}
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
- name: Login to JFrog
uses: docker/login-action@v2
with:
registry: aerospike.jfrog.io
username: ${{ secrets.ARTIFACTORY_USER }}
password: ${{ secrets.ARTIFACTORY_TOKEN }}
- name: Build and Push
uses: docker/bake-action@v4
env:
GIT_COMMIT_SHA: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref }}
LATEST: false
TAG: ${{env.TAG}}
VERSION: ${{env.VERSION}}
CONTEXT: ${{ github.workspace }}
ISO8601: ${{env.ISO8601}}
with:
workdir: ${{ github.workspace }}
files: ${{ github.workspace }}/build/docker-build/docker-bake.hcl
targets: default
- name: Promote image with version tag
env:
ARTIFACTORY_CONTAINER_DEV: ${{ vars.ARTIFACTORY_CONTAINER_DEV }}
ARTIFACTORY_CONTAINER_PROD: ${{ vars.ARTIFACTORY_CONTAINER_PROD }}
TAG: ${{env.TAG}}
run: |
jfrog rt docker-promote aerospike-backup-service \
"$ARTIFACTORY_CONTAINER_DEV" \
"$ARTIFACTORY_CONTAINER_PROD" \
--source-tag "$TAG" \
--target-tag "$TAG" \
--user "${{ secrets.ARTIFACTORY_USER }}" \
--password "${{ secrets.ARTIFACTORY_TOKEN }}" \
--url "${{ secrets.ARTIFACTORY_PROMOTE_URL }}" \
--copy
- name: Promote image with latest tag
env:
ARTIFACTORY_CONTAINER_DEV: ${{ vars.ARTIFACTORY_CONTAINER_DEV }}
ARTIFACTORY_CONTAINER_PROD: ${{ vars.ARTIFACTORY_CONTAINER_PROD }}
TAG: ${{env.TAG}}
run: |
jfrog rt docker-promote aerospike-backup-service \
"$ARTIFACTORY_CONTAINER_DEV" \
"$ARTIFACTORY_CONTAINER_PROD" \
--source-tag "$TAG" \
--target-tag "latest" \
--user "${{ secrets.ARTIFACTORY_USER }}" \
--password "${{ secrets.ARTIFACTORY_TOKEN }}" \
--url "${{ secrets.ARTIFACTORY_PROMOTE_URL }}" \
--copy
#name: Build Release Docker Images
#on:
# push:
# tags:
# - 'v*'
#
# workflow_dispatch:
#jobs:
# build-images:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Automation Code
# uses: actions/checkout@v4
# - name: Get Metadata
# run: |
# echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
# echo "TAG=$(cat VERSION | cut -c 2-)" >> $GITHUB_ENV
# echo "ISO8601=$(LC_TIME=en_US.UTF-8 date "+%Y-%m-%dT%H:%M:%S%z")" >> $GITHUB_ENV
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Setup Jfrog
# uses: jfrog/setup-jfrog-cli@v3
# env:
# JF_URL: ${{ secrets.ARTIFACTORY_URL }}
# JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
# - name: Login to JFrog
# uses: docker/login-action@v2
# with:
# registry: aerospike.jfrog.io
# username: ${{ secrets.ARTIFACTORY_USER }}
# password: ${{ secrets.ARTIFACTORY_TOKEN }}
# - name: Build and Push
# uses: docker/bake-action@v4
# env:
# GIT_COMMIT_SHA: ${{ github.sha }}
# GIT_BRANCH: ${{ github.ref }}
# LATEST: false
# TAG: ${{env.TAG}}
# VERSION: ${{env.VERSION}}
# CONTEXT: ${{ github.workspace }}
# ISO8601: ${{env.ISO8601}}
# with:
# workdir: ${{ github.workspace }}
# files: ${{ github.workspace }}/build/docker-build/docker-bake.hcl
# targets: default
# - name: Promote image with version tag
# env:
# ARTIFACTORY_CONTAINER_DEV: ${{ vars.ARTIFACTORY_CONTAINER_DEV }}
# ARTIFACTORY_CONTAINER_PROD: ${{ vars.ARTIFACTORY_CONTAINER_PROD }}
# TAG: ${{env.TAG}}
# run: |
# jfrog rt docker-promote aerospike-backup-service \
# "$ARTIFACTORY_CONTAINER_DEV" \
# "$ARTIFACTORY_CONTAINER_PROD" \
# --source-tag "$TAG" \
# --target-tag "$TAG" \
# --user "${{ secrets.ARTIFACTORY_USER }}" \
# --password "${{ secrets.ARTIFACTORY_TOKEN }}" \
# --url "${{ secrets.ARTIFACTORY_PROMOTE_URL }}" \
# --copy
# - name: Promote image with latest tag
# env:
# ARTIFACTORY_CONTAINER_DEV: ${{ vars.ARTIFACTORY_CONTAINER_DEV }}
# ARTIFACTORY_CONTAINER_PROD: ${{ vars.ARTIFACTORY_CONTAINER_PROD }}
# TAG: ${{env.TAG}}
# run: |
# jfrog rt docker-promote aerospike-backup-service \
# "$ARTIFACTORY_CONTAINER_DEV" \
# "$ARTIFACTORY_CONTAINER_PROD" \
# --source-tag "$TAG" \
# --target-tag "latest" \
# --user "${{ secrets.ARTIFACTORY_USER }}" \
# --password "${{ secrets.ARTIFACTORY_TOKEN }}" \
# --url "${{ secrets.ARTIFACTORY_PROMOTE_URL }}" \
# --copy

0 comments on commit ce91bec

Please sign in to comment.