forked from aws-observability/aws-otel-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reused mose of the Makefile from upstream but disabled all the GitHub Actions from upstream.
- Loading branch information
Showing
18 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: push | ||
|
||
name: CI | ||
|
||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
AWS_OTEL_COLLECTOR_IT_AUTOMATION_PAT: ${{ secrets.AWS_OTEL_COLLECTOR_IT_AUTOMATION_PAT }} | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: | ||
- { repo: balena-unify-dart-runtime } | ||
env: | ||
TARGET_ARCH: armhf | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: push aws-otel-collector image | ||
run: | | ||
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
docker buildx create --use --platform linux/arm/v7 | ||
make docker-build-armhf | ||
- name: update docker-compose | ||
env: | ||
COMPOSE_REPO: ${{ matrix.platform.repo }} | ||
run: | | ||
glog() { git --no-pager log --format=format:"$1" -n 1; } | ||
export GIT_AUTHOR_NAME=$(glog '%an') GIT_AUTHOR_EMAIL=$(glog '%ae') GIT_AUTHOR_DATE=$(glog '%ad') | ||
export GIT_COMMITTER_NAME=dwelobot GIT_COMMITTER_EMAIL='[email protected]' | ||
.github/workflows/update_docker_compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- release/v* | ||
|
||
name: PR | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^1.23.1' | ||
- name: Make sure the code has no compilation errors | ||
run: | | ||
make armhf-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
if [ -z "${DISABLE_COMPOSE_UPDATES}" ]; then | ||
echo "Updating docker compose" | ||
else | ||
echo "Compose updates are disabled. Unset DISABLE_COMPOSE_UPDATES to re-enable." | ||
exit 0 | ||
fi | ||
|
||
|
||
# If no COMPOSE_REPO specified, fallback to defaults. | ||
if [ -z "${COMPOSE_REPO}" ]; then | ||
case "$TARGET_ARCH" in | ||
armhf) COMPOSE_REPO=balena-unify-dart-runtime ;; | ||
*) exit 1 ;; | ||
esac | ||
fi | ||
|
||
GIT_SHA="${GIT_SHA:-$(git rev-parse "$GITHUB_SHA")}" | ||
|
||
GITHUB_ORG_NAME="${GITHUB_ORG_NAME:-LevelHome}" | ||
DOCKER_IMAGE_LOCATION="${dwelocom}" | ||
DOCKER_IMAGE_NAME="awscollector" | ||
NEW_TAG="${GIT_SHA}" | ||
BRANCH="${TRAVIS_BRANCH:-$(git rev-parse --abbrev-ref "$GITHUB_REF")}" | ||
|
||
tmpdir=$(mktemp -d) | ||
trap 'rm -rf "$tmpdir"' EXIT SIGINT | ||
|
||
cd "$tmpdir" | ||
|
||
echo "git url: https://github.com/${GITHUB_ORG_NAME}/${COMPOSE_REPO}.git" | ||
git clone "https://${GITHUB_ORG_NAME}:${AWS_OTEL_COLLECTOR_IT_AUTOMATION_PAT}@github.com/${GITHUB_ORG_NAME}/${COMPOSE_REPO}.git" repo | ||
# git remote set-url origin "https://github.com/${GITHUB_ORG_NAME}/${COMPOSE_REPO}.git" | ||
cd repo | ||
git checkout "${BRANCH}" || git checkout -b "${BRANCH}" | ||
docker_repo="$DOCKER_IMAGE_LOCATION/$DOCKER_IMAGE_NAME" | ||
echo "docker_repo: ${docker_repo}" | ||
sed -i.bak -E "s%${docker_repo}:.+$%${docker_repo}:${NEW_TAG}%g" docker-compose.yml | ||
git add docker-compose.yml | ||
git commit -m "Update $DOCKER_IMAGE_NAME to ${NEW_TAG}" | ||
git push origin "${BRANCH}:${BRANCH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters