Skip to content

Commit

Permalink
Merge pull request #66 from piotr-iohk/make_release
Browse files Browse the repository at this point in the history
Make release scripts
  • Loading branch information
piotr-iohk authored Oct 1, 2021
2 parents 018872b + e37bf9a commit 579c0c0
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 14 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,36 @@ on:
jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build and push docker
uses: docker/build-push-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: piotrstachyra/icarus
tag_with_ref: true
tags: latest
push: ${{ startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')}}

- name: Get the tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: get_tag
run: |
echo $GITHUB_REF | cut -d / -f 3
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Build and push on release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: docker_build_release
uses: docker/build-push-action@v2
with:
push: true
tags: piotrstachyra/icarus:latest,piotrstachyra/icarus:${{ steps.get_tag.outputs.VERSION }}

- name: Build and push on master
if: ${{ startsWith(github.ref, 'refs/heads/master')}}
id: docker_build_master
uses: docker/build-push-action@v2
with:
push: true
tags: piotrstachyra/icarus:master
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ version: "3.5"

services:
cardano-node:
image: inputoutput/cardano-node:latest
image: inputoutput/cardano-node:1.30.1
environment:
NETWORK:
volumes:
- node-${NETWORK}-db:/data
- node-ipc:/ipc
- node-config:/nix/store
restart: on-failure

cardano-wallet:
image: inputoutput/cardano-wallet:latest
image: inputoutput/cardano-wallet:2021.9.29
volumes:
- wallet-${NETWORK}-db:/wallet-db
- node-ipc:/ipc
- node-config:/config
ports:
- 8090:8090
entrypoint: []
command: bash -c "
([[ $$NETWORK == \"mainnet\" ]] && $$CMD --mainnet) ||
([[ $$NETWORK == \"testnet\" ]] && $$CMD --testnet /config/*testnet-byron-genesis.json)
($$CMD --testnet /config/${NETWORK}/genesis-byron.json)
"
environment:
CMD: "cardano-wallet serve --node-socket /ipc/node.socket --database /wallet-db --listen-address 0.0.0.0"
NETWORK:
restart: on-failure

icarus:
image: piotrstachyra/icarus:latest
image: piotrstachyra/icarus:v2021-09-29
network_mode: "host"
restart: on-failure

volumes:
node-mainnet-db:
node-testnet-db:
node-alonzo-purple-db:
wallet-mainnet-db:
wallet-testnet-db:
wallet-alonzo-purple-db:
node-ipc:
node-config:
2 changes: 1 addition & 1 deletion helpers/app_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Helpers
module App
def version
'v2021-09-29'
'v2021-09-29' #version
end

def is_connected?(w)
Expand Down
26 changes: 26 additions & 0 deletions scripts/make_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /usr/bin/env bash

set -euo pipefail

GIT_TAG="v2021-09-29"
NODE_TAG="1.30.1"

DOCKER_TAG=`echo "${GIT_TAG##v}" | sed -e s/-0/-/g -e s/-/./g`

echo "Updating docker-compose.yml with WALLET:$DOCKER_TAG, NODE:$NODE_TAG"
sed -i "s|inputoutput/cardano-wallet:.*|inputoutput/cardano-wallet:$DOCKER_TAG|" docker-compose.yml
sed -i "s|inputoutput/cardano-node:.*|inputoutput/cardano-node:$NODE_TAG|" docker-compose.yml
echo ""

echo "Updating Ikar version to $GIT_TAG"
sed -i "s|'.*' #version|'$GIT_TAG' #version|" ./helpers/app_helpers.rb
sed -i "s|piotrstachyra/icarus:.*|piotrstachyra/icarus:$GIT_TAG|" docker-compose.yml
echo ""

read -p "Do you want to create a commit (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
msg="Bump version to wallet/ikar: $GIT_TAG and node:$NODE_TAG"
git diff --quiet || git commit -am "$msg"
fi

0 comments on commit 579c0c0

Please sign in to comment.