Flynn: Gitlab deploys

Created on 23 Oct 2016  ·  4Comments  ·  Source: flynn/flynn

Related to #227

Just setup a 5 node cluster, and I'll be moving all my production apps over in the next few days. I must ask though, I love Github but is there a way for me to deploy with Gitlab?

kinquestion

Most helpful comment

I've been working on deploying to Flynn from gitlab and used Gitlab CI to great success. My CI step looks like this:

deploy to staging:
  environment: staging
  stage: deploy
  image: docker:git
  script:
   - L=/usr/local/bin/flynn && curl -sSL -A "`uname -sp`" https://dl.flynn.io/cli | zcat >$L && chmod +x $L
   - flynn cluster add -p $FLYNN_TLS_PIN $FLYNN_CLUSTER_NAME $FLYNN_CONTROLLER_URL $FLYNN_CONTROLLER_KEY --git-url=$FLYNN_GIT_URL
   - flynn -a APP remote add staging
   - git push staging HEAD:master
  when: manual

At some point in time I'll make a docker image containing the flynn-cli preinstalled but as it is very fast to install I'm okay with keeping it like this for now

All 4 comments

I think right now the best way to do this is to use your CI system to do the deployments after running your tests. I think Gitlab CI would be capable of this, using either the shell or Docker runners.

If there is a hook system you could look at https://github.com/lmars/flynn-webhook-deploy and see if it can be modified to suit your purposes.

I've been working on deploying to Flynn from gitlab and used Gitlab CI to great success. My CI step looks like this:

deploy to staging:
  environment: staging
  stage: deploy
  image: docker:git
  script:
   - L=/usr/local/bin/flynn && curl -sSL -A "`uname -sp`" https://dl.flynn.io/cli | zcat >$L && chmod +x $L
   - flynn cluster add -p $FLYNN_TLS_PIN $FLYNN_CLUSTER_NAME $FLYNN_CONTROLLER_URL $FLYNN_CONTROLLER_KEY --git-url=$FLYNN_GIT_URL
   - flynn -a APP remote add staging
   - git push staging HEAD:master
  when: manual

At some point in time I'll make a docker image containing the flynn-cli preinstalled but as it is very fast to install I'm okay with keeping it like this for now

@MBrouns that's cool! did you write a tutorial somewhere?

No I didn't unfortunately and I'm not working at the same company anymore either so it's hard to go back and see the full setup.
I do think the above step should contain about everything you need to get started though. If you need help with anything specific, just let me know!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onnimonni picture onnimonni  ·  6Comments

hadifarnoud picture hadifarnoud  ·  3Comments

kipparker picture kipparker  ·  3Comments

IsNull picture IsNull  ·  5Comments

deviousgeek picture deviousgeek  ·  7Comments