Skip to content

Commit

Permalink
Merge pull request #4 from lucimobility/feature/humble-release
Browse files Browse the repository at this point in the history
Added action and bash script
  • Loading branch information
Christian-Prather authored Aug 17, 2023
2 parents c6643ca + 2c9ef1f commit 7cdd40d
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Create and Deploy Docker

on:
workflow_dispatch:
inputs:
DEV:
type: boolean
description: "If the DEV image should be build"
required: true
default: false
RELEASE:
type: boolean
description: "If the public RELEASE image should be build"
required: true
default: false


env:
REPO: ${{github.event.repository.name}}
JF_URL: ${{ secrets.JF_URL }}
JF_ACCESS_TOKEN: ${{ secrets.artifactory_token}}

jobs:
Build-and-deploy-dev:
runs-on: ubuntu-latest
steps:
- uses: jfrog/setup-jfrog-cli@v3

- name: Checkout SDK Branch
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: ${{env.REPO}}

- name: Build and deploy dev
if: ${{ github.event.inputs.DEV == 'true'}}
run: |
cd ${{env.REPO}}
./build-and-deploy-dockers.sh -d
shell: bash

Build-and-deploy-release:
runs-on: ubuntu-latest
steps:
- uses: jfrog/setup-jfrog-cli@v3
- name: Checkout SDK Branch
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: ${{env.REPO}}

- name: Build and deploy release
if: ${{ github.event.inputs.RELEASE == 'true' }}
run: |
cd ${{env.REPO}}
./build-and-deploy-dockers.sh -r
shell: bash
27 changes: 27 additions & 0 deletions build-and-deploy-dockers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

while getopts 'dr' flag;
do
case "${flag}" in
d) development=true;;
r) release=true;;
esac
done

if [ "$development" = true ]; then
echo "Development building..."
cd development
# Build development image
docker build -t luci.jfrog.io/ros2-sdk-docker-local/luci-sdk-development-image:latest .
# Push development image to jfrog
docker push luci.jfrog.io/ros2-sdk-docker-local/luci-sdk-development-image:latest
fi

if [ "$release" = true ]; then
echo "Release building..."

# Build release image
docker build -t luci.jfrog.io/ros2-sdk-docker-local/luci-ros2-sdk:latest .
# Push release image to jfrog
docker push luci.jfrog.io/ros2-sdk-docker-local/luci-ros2-sdk:latest
fi

0 comments on commit 7cdd40d

Please sign in to comment.