Skip to content

Commit

Permalink
fix: get deployment to work
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 7, 2020
1 parent ed634bf commit 77d2c6b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 39 deletions.
1 change: 0 additions & 1 deletion packages/cosmic-swingset/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ FROM golang:1.14-buster

WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN cd ../.. && go mod init github.com/Agoric/agoric-sdk
RUN go mod download

COPY Makefile* *.go ./
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmic-swingset/lib/ag-solo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG TAG=latest
FROM agoric/agoric-sdk:$TAG

WORKDIR /usr/src/cosmic-swingset
WORKDIR /usr/src/app
RUN ln -sf $PWD/bin/ag-solo /usr/local/bin/
COPY . lib/ag-solo/
WORKDIR /usr/src/app/solo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
become: yes
become_user: "{{ service }}"
shell: "\
ag-chain-cosmos gentx --home-server=/home/{{ service }}/.{{ service }} \
ag-cosmos-helper gentx --home-server=/home/{{ service }}/.{{ service }} \
--keyring-backend=test --amount={{ STAKER_AMOUNT }} \
{{ (website | default(None)) and '--website=' ~ website }} \
{{ (identity | default(None)) and '--identity=' ~ identity }} \
Expand Down
46 changes: 10 additions & 36 deletions packages/deployment/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,49 +260,25 @@ show-config display the client connection parameters

case 'bump-chain-version': {
await inited();
const { _: subArgs, ...subOpts } = parseArgs(args.slice(1), {
string: ['tag'],
});

const subArgs = args.slice(1);
const versionFile = `chain-version.txt`;

let major = 0;
let minor = 0;
let revision = 0;
let tag = '';
let epoch = '0';
if (await exists(versionFile)) {
const vstr = await trimReadFile(versionFile);
const match = vstr.match(/^(\d+)\.(\d+)\.(\d+)(.*)$/);
if (match) {
[major, minor, revision, tag] = match.slice(1);
} else {
tag = vstr;
}
const match = vstr.match(/^(\d+)/);
epoch = match[1] || '0';
}

let versionKind = subArgs[0];
if (subOpts.tag !== undefined) {
tag = subOpts.tag;
} else if (subArgs[0] === undefined || String(subArgs[0]) === 'true') {
if (subArgs[0] === undefined || String(subArgs[0]) === 'true') {
// Default bump.
versionKind = 'patch';
versionKind = 'epoch';
}

switch (versionKind) {
case 'major':
major = Number(major) + 1;
minor = '0';
revision = '0';
break;

case 'minor':
minor = Number(minor) + 1;
revision = '0';
break;

case 'revision':
case 'patch':
revision = Number(revision) + 1;
case 'epoch':
epoch = Number(epoch) + 1;
break;

case 'none':
Expand All @@ -311,13 +287,11 @@ show-config display the client connection parameters

default:
if (!versionKind.match(/^[1-9]/)) {
throw Error(
`${versionKind} is not one of "major", "minor", "revision", or 1.2.3`,
);
throw Error(`${versionKind} is not one of "epoch", or NNN`);
}
}

let vstr = `${major}.${minor}.${revision}${tag}`;
let vstr = `${epoch}`;
if (versionKind.match(/^[1-9]/)) {
vstr = versionKind;
}
Expand Down

0 comments on commit 77d2c6b

Please sign in to comment.