Skip to content

techchapter/dagger-pipeline-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dagger-pipeline-example

An example of using Dagger.io to test, build and publish an application

How to run the example locally

Requirements

  • Docker or any other OCI runtime installed

Approach 1: Use DevContainer

This approach uses the DevContainer extension to spin up a development environment with Go and Dagger.io CLI pre-installed.

  1. Clone the repository
git clone https://github.com/techchapter/dagger-pipeline-example.git
  1. Open the repository in Visual Studio Code
code dagger-pipeline-example
  1. Run command "Reopen in Container" inside Visual Studio Code

  2. Run the Dagger.io CLI to test and build the pipeline locally

dagger run --silent go run ./ci/ci.go
  1. The output should look something like this
DEV environment: exported file to ./ping-socket.tar 
To run use docker load -i ./ping-socket.tar

Approach 2: Install tools locally

This approach expect you to install Go and Dagger.io CLI on your development machine.

  1. Install Go and Dagger.io CLI
  2. Clone the repository
git clone https://github.com/techchapter/dagger-pipeline-example.git
  1. Run the Dagger.io CLI to test and build the pipeline locally
dagger run --silent go run ./ci/ci.go
  1. The output should look something like this
DEV environment: exported file to ./ping-socket.tar 
To run use docker load -i ./ping-socket.tar

How to run the exmaple in GitHub actions

  1. Fork the GitHub repository
  2. Clone the forked repository
  3. Create a simple change like the following
echo "RUN" >> changed-file.txt
  1. Commit and Push the change to the forked repo
  2. See the GitHub action running the CI pipeline, but this time actually publish the image to ttl.sh
  3. The output should look something like this
Published image to: ttl.sh/ping-socket-2021992@sha256:876f28eb26c9469df381f03ad9c82d4648a56349c984d37b186379228ba452b1

About

An example of using Dagger.io to test, build and publish an application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages