Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Continuous integration
on:
pull_request: # All
# pull_request: # All
push:
branches:
- main
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/image-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

name: Publish monitoring image to Docker Registry (on new release tag)
on:
pull_request: # All
push:
tags:
# To modify to trigger the job for fork's releases
Expand All @@ -21,15 +22,13 @@ jobs:
name: Build and Push to Docker Hub
runs-on: ubuntu-latest
# To modify to enable the job for forked repository
if: github.repository == 'interuss/monitoring'
# if: github.repository == 'interuss/monitoring'
permissions:
id-token: write # needed for signing the images with GitHub OIDC Token

steps:
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
with:
cosign-release: 'v2.6.1'
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
- name: Job information
run: |
echo "Job information"
Expand All @@ -46,12 +45,12 @@ jobs:
submodules: true
fetch-depth: 0

- name: Log in to Docker Hub
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Log in to Docker Hub
# uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
# with:
# registry: docker.io
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build, push and sign image
env:
Expand Down
25 changes: 15 additions & 10 deletions build/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ cd "${BASEDIR}"
VERSION=$(./scripts/git/version.sh monitoring)
LATEST_TAG="latest"


docker run -d -p 5000:5000 --name registry registry:2

DOCKER_URL="localhost:5000"

if [[ -z "${DOCKER_URL}" ]]; then
echo "DOCKER_URL environment variable is not set; building image to interuss/monitoring..."
./monitoring/build.sh
Expand All @@ -41,7 +46,7 @@ else
echo "Building image ${TAG}"
./monitoring/build.sh "${TAG}"

echo "Pushing docker image ${TAG}..."
# echo "Pushing docker image ${TAG}..."
docker image push "${TAG}"

echo "Built and pushed docker image ${TAG}"
Expand All @@ -59,13 +64,13 @@ else

fi

if [[ "${DOCKER_UPDATE_LATEST}" == "true" ]]; then
echo "Tagging docker image ${DOCKER_URL}/monitoring:${LATEST_TAG}..."
docker tag "${TAG}" "${DOCKER_URL}/monitoring:${LATEST_TAG}"

echo "Pushing docker image ${DOCKER_URL}/monitoring:${LATEST_TAG}..."
docker image push "${DOCKER_URL}/monitoring:${LATEST_TAG}"

echo "Built and pushed docker image ${DOCKER_URL}/monitoring:${LATEST_TAG}"
fi
# if [[ "${DOCKER_UPDATE_LATEST}" == "true" ]]; then
# echo "Tagging docker image ${DOCKER_URL}/monitoring:${LATEST_TAG}..."
# docker tag "${TAG}" "${DOCKER_URL}/monitoring:${LATEST_TAG}"
#
# echo "Pushing docker image ${DOCKER_URL}/monitoring:${LATEST_TAG}..."
# docker image push "${DOCKER_URL}/monitoring:${LATEST_TAG}"
#
# echo "Built and pushed docker image ${DOCKER_URL}/monitoring:${LATEST_TAG}"
# fi
fi
Loading