Cross Development for Amiga

and CI/CD using Docker

George “walkero” Sokianos

https://walkero.gr

George Sokianos

Software Engineer

nickname: walkero
nationality: Greek
living in: Dublin, Ireland
Beta tester for:
  • AmigaOS 4
  • AmigaOS 3
  • X1000, X5000 & A1222
  • Enchancer Package
Sysadmin/developer on:
  • Amigans.net
  • OS4Coding.net
  • Amiga-Look.org
  • AmigaBlogs.net
  • Amiga.gr
  • ComicAmi
  • aiostreams
  • ApiGnosis

Agenda

  • What is Docker and what are the benefits
  • Setup VBCC and GCC for Amiga Development
  • VSCode IDE
  • Continuous Integration and Continuous Delivery

What Docker is

Docker is an open platform for developing, shipping, and running applications.

Parts of Docker

  • Images
  • Containers
  • Networks
  • Volumes

Benefits

  • Easy, fast and problem free setup
  • Standardised Development Environment
  • All major Operating Systems support Docker (Linux, MacOS, Windows)
  • Use any tools you like for development (Version Control System, IDE etc.)
  • Development Environment isolation
  • Multiple compilers on the same machine
  • Small footprint
  • Code is shared between the host machine and Docker containers
  • Docker can be used on CI/CD process (Jenkins, CircleCI, Drone)
  • Version Control
  • Expandable
  • Big community

Setup without Docker

… wait, there is more

…. ouf ….

  • Windows only using Cygnix
  • GCC 8 only

Setup with Docker

First of all you need to install Docker on your operating system

https://docs.docker.com/get-docker/

VBCC setup

VBCC for AmigaOS 4


docker run -it --rm --name vbcc-ppc -v "$PWD"/code:/opt/code -w /opt/code walkero/docker4amigavbcc:latest-ppc /bin/bash

VBCC for AmigaOS 3


docker run -it --rm --name vbcc-m68k -v "$PWD"/code:/opt/code -w /opt/code walkero/docker4amigavbcc:latest-m68k /bin/bash

VBCC for MorphOS


docker run -it --rm --name vbcc-mos -v "$PWD"/code:/opt/code -w /opt/code walkero/docker4amigavbcc:latest-mos /bin/bash

GCC setup

GCC for AmigaOS 4


docker run -it --rm --name gcc-ppc -v "$PWD"/code:/opt/code -w /opt/code walkero/odysseyondocker:latest /bin/bash

GCC for AROS


docker run -it --rm --name gcc-aros -v "$PWD":/usr/src -w /usr/src walkero/dde4aros:latest /bin/bash

Demo Time

Let’s install VBCC and GCC compilers for
application development for AmigaOS 3 & 4

Docker Compose

docker-compose.yml


version: '3'

services:
  vbcc-m68k:
    image: 'walkero/docker4amigavbcc:latest-m68k'
    volumes:
      - './code:/opt/code'

  vbcc-ppc:
    image: 'walkero/docker4amigavbcc:latest-ppc'
    volumes:
      - './code:/opt/code'

Demo Time

Let me show you my VBCC setup,
using Docker Compose

Tools

You can use any tool you like

  • Version Control Systems (VCS) like SVN, Git etc.
  • VSCode, NotePad++ etc.
  • ApiGnosis

VSCode

Useful extensions

  • Remote - Containers by Microsoft
  • C/C++ by Microsoft
  • Amiga Assembly by Paul Raingeard
  • GitLens by Eric Amodio
  • Git History by Don Jayamanne
  • TaskRunnerCode by Sana Ajani

Demo time

Let’s have a look at VSCode

ApiGnosis

https://bitbucket.org/walkero/apignosis/wiki

  • Select the documentation folder on your local machine
  • Parse selected document on the fly
  • Get list of available methods and info
  • Runs on Windows, Linux and MacOS

Demo time

Let’s check ApiGnosis

App development lifecycle

  1. Plan a feature/fix a problem
  2. Code development on my machine
  3. Test on my machine(s)
  4. Manual release
  5. Support
  6. GOTO 1

CI/CD

It aims at building, testing, and releasing software with greater speed and frequency.

  • Drone
  • Jenkins
  • CircleCI

Continuous integration (CI)

Continuous integration (CI) is the practice of merging all developers’ working copies to a shared mainline several times a day.

Continuous delivery (CD)

Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time and, when releasing the software, doing so manually.


kind: pipeline
type: docker
name: compile-iGame

steps:
  - name: compile-m68k-000
    pull: always
    image: walkero/docker4amigavbcc:latest-m68k
    commands:
      - cd /drone/src
      - make -f Makefile.docker
  - name: compile-m68k-030
    image: walkero/docker4amigavbcc:latest-m68k
    commands:
      - cd /drone/src
      - make -f Makefile.docker iGame.030
  - name: compile-m68k-040
    image: walkero/docker4amigavbcc:latest-m68k
    commands:
      - cd /drone/src
      - make -f Makefile.docker iGame.040
  - name: compile-m68k-060
    image: walkero/docker4amigavbcc:latest-m68k
    commands:
      - cd /drone/src
      - make -f Makefile.docker iGame.060
  - name: compile-os4
    pull: always
    image: walkero/docker4amigavbcc:latest-ppc
    commands:
      - cd /drone/src
      - make -f Makefile.docker iGame.OS4
  - name: compile-mos
    pull: always
    image: walkero/docker4amigavbcc:latest-mos
    commands:
      - cd /drone/src
      - make -f Makefile.docker iGame.MOS

trigger:
  branch:
    include:
      - develop
  event:
    include:
      - push
      - pull_request


Demo time

Continuous integration & Continuous delivery

Continuous deployment (CD)

Continuous deployment (CD) is a software engineering approach in which software functionalities are delivered frequently through automated deployments.


kind: pipeline
name: build-images-from-tag

steps:
  - name: build-base-image-from-tag
    image: plugins/docker
    settings:
      repo: walkero/docker4amigavbcc
      tags:
        - ${DRONE_TAG/\//-}-ppc
      cache_from:
        - walkero/docker4amigavbcc:latest-base
      dockerfile: base/Dockerfile
      username:
        from_secret: DOCKERHUB_USERNAME
      password:
        from_secret: DOCKERHUB_PASSWORD
  - name: build-ppc-image-from-tag
    image: plugins/docker
    settings:
      repo: walkero/docker4amigavbcc
      tags:
        - ${DRONE_TAG/\//-}-ppc
      cache_from:
        - "walkero/docker4amigavbcc:latest-ppc"
      dockerfile: ppc/Dockerfile
      username:
        from_secret: DOCKERHUB_USERNAME
      password:
        from_secret: DOCKERHUB_PASSWORD

trigger:
  event:
    include:
    - tag



kind:
pipeline
  type: docker
  name: release-aiostreams

steps:
  - name: create-release-archive
    image: walkero/docker4amigavbcc:latest-base
    commands:
      - cd /drone/src
      - mkdir aiostreams
      - chmod 755 dailymotion.py dlive.py lbrytv.py peertube.py skaitv.py twitch.py vimeo.py wasd.py youtube.py
      - mv ./docs ./aiostreams/
      - mv ./simplejson ./aiostreams/
      - mv ./*.py ./aiostreams/
      - mv ./*.py.examples ./aiostreams/
      - mv ./*.info ./aiostreams/
      - mv ./*.md ./aiostreams/docs/
      - mv LICENSE ./aiostreams/docs/
      - mkdir release
      - lha -aq2o6 aiostreams-${DRONE_TAG}.lha aiostreams/
  - name: deploy-on-repo
    image: plugins/github-release
    settings:
      api_key:
        from_secret: GITHUB_RELEASE_API_KEY
      files:
        - "./aiostreams-*.lha"
      title: "${DRONE_TAG} release"
  - name: Prepare Aminet release
    image: walkero/docker4amigavbcc:latest-base
    commands:
      - mkdir aminet-release
      - cp aiostreams-${DRONE_TAG}.lha ./aminet-release/aiostreams.lha
      - cp aminet.readme ./aminet-release/aiostreams.readme
  - name: Upload to Aminet
    image: cschlosser/drone-ftps
    environment:
      FTP_USERNAME: "anonymous"
      FTP_PASSWORD: "walkero@gmail.com"
      PLUGIN_HOSTNAME: main.aminet.net:21
      PLUGIN_SRC_DIR: /aminet-release
      PLUGIN_DEST_DIR: ./new
      PLUGIN_SECURE: "false"
      PLUGIN_VERIFY: "false"
      PLUGIN_CHMOD: "false"
  - name: Prepare OS4Depot release
    image: walkero/docker4amigavbcc:latest-base
    environment:
        OS4DEPOT_PASSPHRASE: 
            from_secret: OS4DEPOT_PASSPHRASE
    commands:
      - mkdir os4depot-release
      - cp aiostreams-${DRONE_TAG}.lha ./os4depot-release/aiostreams.lha
      - cp os4depot.readme ./os4depot-release/aiostreams_lha.readme
      - sed -i "s/OS4DEPOT_PASSPHRASE/$OS4DEPOT_PASSPHRASE/" ./os4depot-release/aiostreams_lha.readme
  - name: Upload to OS4Depot
    image: cschlosser/drone-ftps
    environment:
      FTP_USERNAME: "ftp"
      FTP_PASSWORD: ""
      PLUGIN_HOSTNAME: os4depot.net:21
      PLUGIN_SRC_DIR: /os4depot-release
      PLUGIN_DEST_DIR: ./upload
      PLUGIN_SECURE: "false"
      PLUGIN_VERIFY: "false"
      PLUGIN_CHMOD: "false"

trigger:
  event:
    include:
      - tag


Demo time

Continuous deployment

What to remember

Flexibility

Automation

Collaboration

More free time

Let’s discuss

https://walkero.gr/presentations/amiwest20

walkero@gmail.com

tw: @gsokianos

Reload?