Skip to content

Commit 1500590

Browse files
authored
chore: circle ci (#5)
* chore: fix rust version for circleci * chore: use different orb * chore: build with cargo and upload bin * chore: add arm build * chore: add test and build jobs to ci * chore: edit ci and add install script * chore: add install.sh * docs: install readme * chore: add filter only branch main for builds * docs: remove features paragraph * chore: fix circleci syntax
1 parent e2b0b88 commit 1500590

File tree

3 files changed

+80
-36
lines changed

3 files changed

+80
-36
lines changed

.circleci/config.yml

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,49 @@ version: 2.1
22

33
workflows:
44
version: 2
5-
build-multi:
5+
build:
66
jobs:
77
- test
8-
- build
8+
- build-arm:
9+
filters:
10+
branches:
11+
only:
12+
- main
13+
- build-linux:
14+
filters:
15+
branches:
16+
only:
17+
- main
918

1019
jobs:
11-
12-
test:
13-
docker:
14-
- image: cimg/rust:1.63.0
20+
21+
build-arm:
22+
machine:
23+
image: ubuntu-2004:202101-01
24+
resource_class: arm.medium
1525
steps:
1626
- checkout
17-
- run: cargo test
18-
19-
build:
20-
docker:
21-
- image: cimg/rust:1.63.0
27+
- run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
28+
- run: cargo build --release
29+
- store_artifacts:
30+
path: ~/project/target/release/glue
31+
destination: glue-arm
32+
33+
build-linux:
34+
machine:
35+
image: ubuntu-2004:current
36+
resource_class: medium
2237
steps:
2338
- checkout
39+
- run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
2440
- run: cargo build --release
2541
- store_artifacts:
2642
path: ~/project/target/release/glue
27-
destination: glue-x86_64
43+
destination: glue-x86
44+
45+
test:
46+
docker:
47+
- image: cimg/rust:1.63.0
48+
steps:
49+
- checkout
50+
- run: cargo test

README.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ Make requests, select JSON responses, nest them in other requests: A magnificent
77

88
## Table of Contents
99

10-
- [Features](#features)
11-
- [Install](#install)
12-
- [MacOS](#macos---homebrew)
13-
- [Linux, Windows, Other](#linux-windows-macos---build-from-source)
10+
- [Install & Update](#install--update)
1411
- [Usage](#usage)
1512
- [Simple request](#simple-request)
1613
- [JSON Result selector](#json-result-selector)
@@ -22,30 +19,19 @@ Make requests, select JSON responses, nest them in other requests: A magnificent
2219
- [Good First Issues](#good-first-issues)
2320
- [License](#license)
2421

25-
## Features
22+
## Install & Update
2623

27-
- [x] Full HTTP Client
28-
- [x] Nested requests
29-
- [x] Optimized parallel HTTP executor
30-
- [x] JSON Response Value selector
31-
- [x] Execute requests from files
32-
- [ ] Save and reuse requests
33-
34-
## Install
35-
36-
### MacOS - Homebrew
37-
38-
After installed [Homebrew](https://brew.sh/) on your system, run the following command in the terminal:
24+
At the moment, you can install or update glue for your system by building it from source. It has been done quite easy by the script `install.sh`
25+
in the root of the repo. To install glue:
3926

27+
1. Clone the repo
4028
```bash
41-
brew install glue
29+
git clone https://github.com/mikesposito/glue
30+
```
31+
2. Add execute permission and run install.sh
32+
```bash
33+
chmod +x ./install.sh && ./install.sh
4234
```
43-
44-
### Linux, Windows, MacOS - Build from source
45-
46-
1. Clone this repository
47-
2. Install Rust
48-
3. Build sources with `cargo build --release`
4935

5036
## Usage
5137

install.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Welcome to the glue installer. The current version of glue will be installed"
4+
5+
# Install Rust
6+
if ! command -v cargo --version &> /dev/null
7+
then
8+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | RUSTUP_INIT_SKIP_PATH_CHECK=true sh -s -- -y
9+
fi
10+
11+
# Build glue
12+
cargo build --release
13+
14+
# Move to Glue home
15+
mkdir $HOME/.glue
16+
mkdir $HOME/.glue/bin
17+
18+
cp target/release/glue $HOME/.glue/bin
19+
20+
if [[ ":$PATH:" == *"$HOME/.glue/bin"* ]]; then
21+
echo "Your path is correctly set already."
22+
else
23+
if [[ "$SHELL" == *"zsh" ]]; then
24+
echo "export PATH=$PATH:$HOME/.glue/bin" >> $HOME/.zshrc
25+
fi
26+
27+
if [ -n "$BASH_VERSION" ]; then
28+
echo 'export PATH=$PATH:$HOME/.glue/bin' >> $HOME/.bashrc
29+
fi
30+
31+
echo "$HOME/.glue/bin Added to your path."
32+
fi
33+
34+
echo "Install completed. Restart your terminal window or open a new one to execute the glue command"
35+
$HOME/.glue/bin/glue --version

0 commit comments

Comments
 (0)