Skip to content

Commit

Permalink
release to artifactory on commits to main branch(open-telemetry#13)
Browse files Browse the repository at this point in the history
* deploy via jfrog

* expand on readme for artifactory push
  • Loading branch information
Abdurrahman Allawala authored and edma2 committed Aug 14, 2024
1 parent 28eedec commit c7886e3
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@

As of 8/4/2022, changes are localized only to receiver/statsdreceiver.

For all commits on the main branch, CI will tag and release the `github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver` Go module for consumption in downstream systems.

In order to use this Go module:
- The env var, GOPROXY, must be set to resolve from Artifactory:
- `export GOPROXY=https://artifactory.d.musta.ch/artifactory/api/go/golang-airbnb,https://proxy.golang.org,direct`
- The env var GONOSUMDB, must be set for the receiver/statsdreceiver module in order for Go mod to resolve
- `export GONOSUMDB=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver`

## To update the fork from upstream:
Prerequisites:
* Upstream set
Expand Down
6 changes: 6 additions & 0 deletions _infra/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ENV GO=go
# Delete forward-udp to enable statsd_receiver testing
RUN rm -f /usr/local/bin/forward-udp

# Install jfrog-cli to be able to release to artifactory
RUN curl https://releases.jfrog.io/artifactory/jfrog-gpg-public/jfrog_public_gpg.key | sudo apt-key add - \
&& echo "deb https://releases.jfrog.io/artifactory/jfrog-debs xenial contrib" | sudo tee -a /etc/apt/sources.list \
&& apt update \
&& apt install -y jfrog-cli-v2

# Install yq from artifactory
RUN curl -s0 https://artifactory.d.musta.ch/artifactory/generic-airbnb/yq/4.23.1/yq_linux_amd64 > /usr/local/bin/yq \
&& chmod a+x /usr/local/bin/yq
Expand Down
8 changes: 5 additions & 3 deletions _infra/ci/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
env:
COMPONENT_PATH: "receiver/statsdreceiver"

- name: Tag repo
path: _infra/ci/jobs/tag_repo.yml
- name: Release receiver/statsdreceiver
path: _infra/ci/jobs/release_component.yml
options:
only_run_if: "env('JORB_GIT_BRANCH') == 'airbnb'"
only_run_if: "env('JORB_GIT_BRANCH') == 'airbnb'"
env:
COMPONENT_PATH: "receiver/statsdreceiver"
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,37 @@ steps:
command: |
cd /jorb/repo-copy-rw
TAG=$(yq '.module-sets.contrib-base.version' versions.yaml)-${JORB_GIT_BRANCH}-$(git rev-parse --short HEAD)
TAG=${COMPONENT_PATH}/$(yq '.module-sets.contrib-base.version' versions.yaml)-$(git rev-parse --short HEAD)
git tag $TAG
git push origin $TAG
git push origin $TAG
- type: run
label: Release to Artifactory
env:
ARTIFACTORY_TOKEN: "{% secret key=ARTIFACTORY_TOKEN %}"
command: |
TAG=$(yq '.module-sets.contrib-base.version' versions.yaml)-$(git rev-parse --short HEAD)
echo "Configuring jfrog cli..."
# Config Artifactory CLI
jfrog c add \
--url="https://artifactory.d.musta.ch/" \
--artifactory-url="https://artifactory.d.musta.ch/artifactory/" \
--interactive=false \
--access-token="$ARTIFACTORY_TOKEN" \
"airbnb-artifactory"
echo "Configuring go-config"
# Golang Repo Config
jfrog go-config \
--repo-deploy=golang-airbnb \
--server-id-deploy="airbnb-artifactory" \
--global
# Publish
cd $COMPONENT_PATH
echo "Publishing: $TAG via jfrog rt go-publish"
jfrog gp \
--url=https://artifactory.d.musta.ch/artifactory \
"$TAG"
12 changes: 12 additions & 0 deletions _infra/ci/secrets/ci.a.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,17 @@
},
"auth_tag": "1ajbH9mfszNRCVQx87khVQ==",
"annotations": "eyJ1cGRhdGVkX2F0IjoxNjU5NDAzNzAzLCJ1c2FnZV9jb250ZXh0Ijp7ImdpdF9yZXBvX3NsdWciOiJ0aGlyZC1wYXJ0eS9vcGVudGVsZW1ldHJ5LWNvbGx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jx9j4F/eJNyRehzE5EFIDNqQh1aLSGWXTAqMI4BS8otB7joak/cVGfTMe6YiT/VOyJGlycr5lhQTadoQrhq",
"iv": "S93wjwaJqSixPAiB",
"__keys__": {
"__shared__ci_secrets.production": {
"key": "hw4mVKMd0fE0Xl0WpkZoZxnzhFISaCoN1NnBegTJJcUsa7dhl2Y4MpjH/d0IgXThd9zQSTAALRBKd8THj07skPkz8KWZ66b6b5e/MOtKmH64ezTW8OptwUyaQ7eTgAxo1yDgqbn7TcALOAGn2CruLLZi+7/+q1HGob8gyG0wwcGYQEgJD7XJ7fULUx+Wh8oLf4eQRMnIr9deljRW5qtsbSUAgB5pK+5NVjgLLDj1/5QuA+76Lg3kEakkmYTuQgDd+jF71ROznjMg2oIuIB42vUWYtiRJYhKfqUiHfQQXA3eswPzX5BUvqvBBknaXg5rcRxVPcOtVwwsu8JUewCnLoA==",
"sig": "90bff42516bebc2d2d3df04ff0a085b48676a2ccd1438394a0b9eef84b5d5d1c"
}
},
"auth_tag": "0RsbzxGl/mibfI5El0ssiw==",
"annotations": "eyJ1cGRhdGVkX2F0IjoxNjYxMjkzNjI3LCJ1c2FnZV9jb250ZXh0Ijp7ImdpdF9yZXBvX3NsdWciOiJ0aGlyZC1wYXJ0eS9vcGVudGVsZW1ldHJ5LWNvbGxlY3Rvci1jb250cmliIn19"
}
}

0 comments on commit c7886e3

Please sign in to comment.