switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    how we made a build server using webhooks, fastlane and bash (part 1)
    How We Made A Build Server Using Webhooks, Fastlane And Bash (Part 1)
    Jan 21, 2019
    laravel logo
    Local Scopes In Laravel
    Feb 28, 2019

    How We Made A Build Server Using Webhooks, Fastlane And Bash (Part 2)

    how we made a build server using webhooks, fastlane and bash (part 1)
    how we made a build server using webhooks, fastlane and bash (part 1)

    The next step in creating the build server is getting the build script to run on the local build server.

    1. 1. Install zerotier on build server and webhook server
    2. 2. Setup ssh keys

    3. 3. Setup script to send through data

    1. Install zerotier on build server and webhook server


    You should have a webhook server setup as described in our previous blog post How We Made A Build Server Using Webhooks, Fastlane And Bash (Part 1).

    Follow the instructions for downloading and installing zerotier here:

    https://www.zerotier.com/download.shtml.

    To put it simply, Zerotier can make networks that look like LAN networks over any network. This will allow the webhook server to run a script via SSH on the local build server.

    You will need a zerotier account. Once you have created an account at https://my.zerotier.com/. Login and go to the Networks section and tap create to create a new network. Your new network should appear in the list of "New Networks" or "My Networks". Click the new network to see details.

    Copy the NetworkID at the top of the screen, you can use this to join the network from any zerotier client. In ubuntu (or mac) as we have setup the webhook server, this requires the zerotier-cli command:

    zerotier-cli join a0cbf4b62a76c663

    You should see something in the terminal like `200 OK`. Next this computer needs to be authorised to join the network from the dashboard. Using the same process add the build server.

    When both machines are authorised and connected you should be able to see their zerotier ip addresses in the dashboard.


    2. Setup SSH key


    https://www.ssh.com/ssh/keygen/

    For our setup put our webhook server's public ssh key in the build server's authorized_keys file. This allows the webhook server to access the build server directly. It would be more secure to have Webhook installed on the build server too, this would mean that if the webhook server was compromised your build server would not be. Or possibly even for the webhook server to simply route webhook requests directly to the build server.


    3. Setup scripts to send through data


    As setup in the previous blog post the webhook server parses the webhook body into a shell script:

    #!/bin/bash
    echo $1 # username
    echo $2 # new type
    echo $3 # branch_name
    echo $4 # commit_hash
    echo $5 # commit_message
    echo 'ios-push-webhook'
    # /Users/lavalamp/test_ios.sh "$1" "$2" "$3" "$4" "$5"
    echo "/Users/username/build_serve.sh "\""$1"\"" "\""$2"\"" "\""$3"\"" "\""$4"\"" "\""$5"\" | ssh username@255.255.255.255

    The first five echo statements are for keeping logs and showing what the arguments are to this command. This script then simply passes on these arguments to the build_serve.sh script on the build server


    Conclusion


    Although this method can be improved upon, it is great for a proof of concept.

    Next time we will be showing off the build server shell script that we're sending arguments to.

    Contact us


      Related posts:

      how we made a build server using webhooks, fastlane and bash (part 1)How We Made A Build Server Using Webhooks, Fastlane And Bash (Part 1) implementing laravel echoImplementing Laravel Echo And Socket.io With A Laravel API And Ionic Vue App laravel envoyer and forgeProvisioning A New Digital Ocean Server With Laravel Forge, And Deploying Code With Laravel Envoyer how to setup git-ftp for windowsHow To Setup Git-ftp For Windows
      Share
      30
      Tielman Janse van Vuuren
      Tielman Janse van Vuuren
      Tielman is an experienced mobile and backend developer. Quality is his motto, no matter what programming language or platform.

      Leave a Reply Cancel reply

      Your email address will not be published. Required fields are marked *

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165

      +61(0) 42 420 8911


      switchon@lavalamp.biz


      Unit 1 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy