Skip to content

Commit

Permalink
feat: add gitpod environment (#1)
Browse files Browse the repository at this point in the history
* Add gitpod env

* Update .gitpod.yml

* Update README.md

* Update .gitpod.Dockerfile
  • Loading branch information
ulbqb authored Jan 11, 2024
1 parent 9a9a2af commit 1268311
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & Push
on:
pull_request:
branches:
- main
- rc*/*
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-*" # Push events to matching v*, i.e. v20.15.10-rc5
env:
registry: docker.io
repository: finschia/cw-gitpod
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: login to the registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ${{env.registry}}
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: extract metadata for docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{env.registry}}/${{env.repository}}
tags: |
type=semver,pattern={{version}}
- name: docker build
uses: docker/build-push-action@v5
with:
push: ${{github.event_name != 'pull_request'}}
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}
platforms: linux/amd64
file: .gitpod.Dockerfile
16 changes: 16 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM gitpod/workspace-full@sha256:bb84c4490170fbfdeb577535a6dec5aafd1eb8fdf433f9a344bd8f4a69af5707
ARG FNSA_VERSION=2.0.1

RUN rustup toolchain install 1.69.0
RUN rustup default 1.69.0
RUN rustup target add wasm32-unknown-unknown
RUN rustup default 1.74.1
RUN cargo install [email protected]
RUN cargo install [email protected]
RUN rustup default 1.69.0

USER root
RUN wget -O /usr/local/bin/fnsad https://github.com/Finschia/finschia/releases/download/v$FNSA_VERSION/fnsad-$FNSA_VERSION-linux-amd64
RUN chmod 755 /usr/local/bin/fnsad

USER gitpod
31 changes: 31 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
image: finschia/cw-gitpod:latest

checkoutLocation: "cw-gitpod"
workspaceLocation: "./cw-gitpod/cosmwasm"

vscode:
extensions:
- rust-lang.rust-analyzer
- Spoorthi.cosmy-wasmy
- tamasfe.even-better-toml

tasks:
- name: Setup

init: |
##
# clone tutorials
cd ..
git clone https://github.com/Finschia/tutorials.git
cd cosmwasm
##
# generate workspace.
cargo generate --git https://github.com/Finschia/cw-workspace.git --name tutorial --init -o
command: |
##
# run localnet and faucet
cd ../tutorials/localnet/single
docker-compose up -d finschia faucet
cd ../../../cosmwasm
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# cw-gitpod
# CW Gitpod

This is an environment for developing Finschia CosmWasm contracts on [Gitpod](https://www.gitpod.io/).

This provides the following environment:

- Install rustc, cargo, cargo-check, cargo-generate, and fnsad in advance
- Run Finschia localnet and the faucet server in advance
- Install rust-analyzer, cosmy-wasmy, and even-better-toml for vscode in advance

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Finschia/cw-gitpod)
Empty file added cosmwasm/.gitkeep
Empty file.

0 comments on commit 1268311

Please sign in to comment.