-
Notifications
You must be signed in to change notification settings - Fork 34
feat: docker support #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: docker support #238
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5e83257
feat: docker support
fmenezes e2430ab
fix: docs
fmenezes c07a174
fix: auth
fmenezes fd0ebb7
fix: tag
fmenezes 900626a
fix: docs
fmenezes 2e5b4be
fix: styles
fmenezes 968cd27
fix: dist path
fmenezes 8a04017
fix: dockerfile command order
fmenezes 528b4f1
fix: add todo for latest tag
fmenezes d92b95f
fix: checkout code for specific version
fmenezes 7030f93
fix: pin version
fmenezes fabb1c8
fix: readme
fmenezes ee0ae2b
fix: action name
fmenezes 4b44f9b
fix: styles and add latest tag
fmenezes 4fd4a6f
fix: correct docker repo
fmenezes 6c714b3
fix: add telemetry
fmenezes f7ef003
fix: docker labels
fmenezes 9f7370e
Revert "fix: add telemetry"
fmenezes 440b3cf
fix: entrypoint
fmenezes e12a318
fix: address small comments
fmenezes 5ede17a
fix: remove pr
fmenezes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,50 @@ | ||
# See RELEASING.md#DockerImage for more details about the steps in this workflow. | ||
name: Daily Release AtlasCLI Docker Image | ||
on: | ||
schedule: | ||
- cron: "0 1 * * *" # Every day at 1:00 AM | ||
workflow_dispatch: # Run the action manually | ||
pull_request: # TODO: delete this before merging | ||
jobs: | ||
build_images: | ||
name: Build and publish docker image to staging registry | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_REPOSITORY: docker.io/mongodb/apix_test | ||
TAG_PREFIX: mongodb-mcp-server | ||
steps: | ||
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
with: | ||
config: ${{ vars.PERMISSIONS_CONFIG }} | ||
- name: Check out code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set properties | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] This name is a bit vague, forcing readers to actually read the script being executed - would it make sense to replace with "Set date and version"? |
||
id: set-properties | ||
run: | | ||
DATE=$(date +'%Y-%m-%d') | ||
VERSION=$(npm pkg get version | tr -d '"') | ||
echo "DATE=${DATE}" >> "$GITHUB_OUTPUT" | ||
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d | ||
with: | ||
username: "${{ secrets.DOCKERHUB_USER }}" | ||
password: "${{ secrets.DOCKERHUB_SECRET }}" | ||
- name: Build and push image to dockerhub staging registry | ||
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
tags: | ||
${{ env.IMAGE_REPOSITORY }}:${{ env.TAG_PREFIX }}${{ steps.set-properties.outputs.VERSION }}, ${{ env.IMAGE_REPOSITORY }}:${{ env.TAG_PREFIX }}${{ steps.set-properties.outputs.VERSION }}-${{ steps.set-properties.outputs.DATE }} | ||
file: Dockerfile | ||
push: true | ||
# - name: Create Issue | ||
# if: ${{ failure() }} | ||
# uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd | ||
# with: | ||
# labels: failed-release | ||
# title: Release Failure for Atlas CLI Docker Image ${{ env.TAG_PREFIX }}${{ steps.set-properties.outputs.VERSION }}-${{ steps.set-properties.outputs.DATE }} | ||
# body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
|
This file contains hidden or 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,15 @@ | ||
FROM node:22 AS build | ||
WORKDIR /app | ||
COPY package.json package-lock.json tsconfig.build.json ./ | ||
RUN npm install --ignore-scripts | ||
COPY src src | ||
RUN npm run build | ||
|
||
FROM node:22 | ||
WORKDIR /app | ||
COPY --from=build /app/package.json /app/package.json | ||
COPY --from=build /app/package-lock.json /app/package-lock.json | ||
COPY --from=build /app/dist dist | ||
RUN npm ci --omit=dev --ignore-scripts | ||
ENV NODE_ENV=production | ||
CMD ["node", "dist/index.js"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this? Doesn't seem like it's created.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://github.com/GitHubSecurityLab/actions-permissions/tree/v1/monitor, it is advisable to keep a variable even if it does not exist yet.