Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Docker image with sentry-cli pre-installed #139

Closed
jonaskello opened this issue Nov 2, 2017 · 9 comments
Closed

Docker image with sentry-cli pre-installed #139

jonaskello opened this issue Nov 2, 2017 · 9 comments
Assignees

Comments

@jonaskello
Copy link

I'm looking for a docker image with sentry-cli pre-installed to use in gitlab runner. Is there such an image? Otherwise consider this a request for that :-).

@jonaskello
Copy link
Author

I found #110 and #70 are related.

@jan-auer
Copy link
Member

jan-auer commented Nov 2, 2017

They are related. However, if you don't care about the container size, it could be easier to base off something like ubuntu and just use the prebuilt sentry-cli-Linux-x86_64.

@jonaskello
Copy link
Author

Yes, I came to the same conclusion so I made an image based on ubuntu. It is available here.

It would still be nice to have an official image tough, maybe based on something smaller like alpine, so I'lll leave this open for now.

@mitsuhiko
Copy link
Member

Is there a specific reason you want this in a docker container? Wouldn't it be more useful if we just distribute a binary that can run on alpine?

@jonaskello
Copy link
Author

Yes, if there was a ready-made image this would make it very simple to use sentry-cli in gitlab runner for example to upload source maps during builds. Gitlab runs each build job as a separate docker container. So the job to upload source-maps would run under a sentry-cli container, preferable the official one.

Currently I would have to roll my own docker image and keep it up to date etc. in order to use sentry-cli for gitlab builds. This is how it is used in gitlab:

sentry:
  stage: publish
  image: 
    name: dividab/sentry-cli:1.21.0
    entrypoint: [""]
  script:
    - export SENTRY_URL=https://sentry.mydomain.com
    - export SENTRY_AUTH_TOKEN=XXXXXXXX
    - export SENTRY_ORG=myorg
    - export SENTRY_PROJECT=myproj
    - export SENTRY_DISABLE_UPDATE_CHECK=true
    - sentry-cli releases new $CI_PIPELINE_ID
    - sentry-cli releases files $CI_PIPELINE_ID upload-sourcemaps ./dist

@mitsuhiko
Copy link
Member

@jonaskello so how do you combine multiple tools?

@jonaskello
Copy link
Author

You just make more jobs in gitlab running under other containers. Each job just does one distinct thing so it does not need a lot of tools, just enough to complete it's own part.

For example if you want to build a webapp with webpack, then publish the sourcemaps to sentry, then deploy to rancher, you would create three separate jobs that runs under three separate images. The first job would use the official node image as webpack needs node. The second would use the sentry-cli image. The third would use the rancher-cli image.

Here's a more complete example how my app is built in gitlab:

build:
  image: node:8.6.0
  stage: build
  script:
     - {commands that build the app using node}
  artifacts:
    paths:
    - dist/

docker:
  stage: publish
  image: docker:17.03.0
    script:
    - {commands that builds and publish a docker image}

sentry:
  stage: publish
  image: 
    name: dividab/sentry-cli:1.21.0
    entrypoint: [""]
  script:
    - {commands that publish sourcemaps to sentry}

deploy_develop:
  stage: deploy
  image: cdrx/rancher-gitlab-deploy
  script:
    - {commands that publishes the app on rancher}

@jan-auer jan-auer self-assigned this Nov 4, 2017
@jan-auer
Copy link
Member

Quick update: 6f3f144 has added a Dockerfile and we're preparing to start publishing on Dockerhub in one of the next releases.

@jan-auer
Copy link
Member

jan-auer commented Dec 1, 2017

Released with 1.25.0, find more info here.
Thanks for your input and have fun!

@jan-auer jan-auer closed this as completed Dec 1, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants