-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add Docker distribution * fix: change output directory name * feat: add image labels * chore: debug ci * fix: ci syntax * fix: enable release ci * chore: ci job wording * fix: dockerfile name * feat: add symlink for instrument.js
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
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,42 @@ | ||
name: Publish splunk-otel-js Docker image to ghcr.io | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-image: | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Put GITHUB_REF_NAME into env | ||
run: echo GITHUB_REF_NAME=${GITHUB_REF_NAME} >> $GITHUB_ENV | ||
|
||
- name: Set the major version number | ||
run: echo MAJOR_VERSION=${GITHUB_REF_NAME} | sed -e 's/\..*//' >> $GITHUB_ENV | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: build and publish container | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
file: Dockerfile | ||
build-args: | | ||
RELEASE_VER=${{ env.GITHUB_REF_NAME }} | ||
tags: | | ||
ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:latest | ||
ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:${{ env.MAJOR_VERSION }} | ||
ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:${{ env.GITHUB_REF_NAME }} | ||
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,18 @@ | ||
FROM node:16 AS build | ||
|
||
WORKDIR /splunk-otel-js | ||
COPY . . | ||
RUN npm install | ||
RUN npm run compile | ||
RUN npm run prebuild:os '14.0.0' '15.0.0' '16.0.0' '17.0.1' '18.0.0' | ||
RUN npm pack && tar xf splunk-otel-$(npm view @splunk/otel version).tgz | ||
RUN npm prune --omit=dev && cp -r node_modules/ package | ||
|
||
FROM busybox | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/signalfx/splunk-otel-js" | ||
LABEL org.opencontainers.image.description="Splunk Distribution of OpenTelemetry Node.js Instrumentation" | ||
|
||
COPY --from=build /splunk-otel-js/package /autoinstrumentation | ||
RUN chmod -R go+r /autoinstrumentation | ||
RUN cd /autoinstrumentation && ln -s ./instrument.js /autoinstrumentation/autoinstrumentation.js |