Skip to content

Commit

Permalink
update group list and rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Mar 23, 2020
1 parent b9632fe commit 65a107e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
19 changes: 10 additions & 9 deletions ci/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
export RUSTUP_HOME=/usr/local/rustup
export CARGO_HOME=/usr/local/cargo
export PATH=/usr/local/cargo/bin:$PATH
export RUST_VERSION=1.41.1
export RUST_VERSION=1.42.0

set -eux

dpkgArch="$(dpkg --print-architecture)"
case "${dpkgArch##*-}" in
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='e68f193542c68ce83c449809d2cad262cc2bbb99640eb47c58fc1dc58cc30add' ;;
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='7c1c329a676e50c287d8183b88f30cd6afd0be140826a9fbbc0e3d717fab34d7' ;;
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='d861cc86594776414de001b96964be645c4bfa27024052704f0976dc3aed1b18' ;;
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='89f1f797dca2e5c1d75790c3c6b7be0ee473a7f4eca9663e623a41272a358da0' ;;
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='ad1f8b5199b3b9e231472ed7aa08d2e5d1d539198a15c5b1e53c746aad81d27b' ;;
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6c6c3789dabf12171c7f500e06d21d8004b5318a5083df8b0b02c0e5ef1d017b' ;;
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='26942c80234bac34b3c1352abbd9187d3e23b43dae3cf56a9f9c1ea8ee53076d' ;;
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='27ae12bc294a34e566579deba3e066245d09b8871dc021ef45fc715dced05297' ;;
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;;
esac
url="https://static.rust-lang.org/rustup/archive/1.20.2/${rustArch}/rustup-init"
url="https://static.rust-lang.org/rustup/archive/1.21.1/${rustArch}/rustup-init"
wget "$url"
echo "${rustupSha256} *rustup-init" | sha256sum -c -
chmod +x rustup-init
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION
rm rustup-init
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
rustup --version
cargo --version
rustc --version

rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl
apt-get update
apt-get install -y musl-tools
HELM_INSTALL_DIR=/bin
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
curl -L -o myke https://github.com/fiji-flo/myke/releases/download/0.9.11/myke-0.9.11-x86_64-unknown-linux-musl
Expand Down
3 changes: 2 additions & 1 deletion openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ paths:
required: false
schema:
type: string
enum: ["MemberCount", "NameAsc", "NameDesc"]
enum: ["MemberCountAsc", "MemberCountDesc", "NameAsc", "NameDesc"]
default: "MemberCountDesc"
- in: query
name: "n"
description: next page id (offset)
Expand Down
3 changes: 2 additions & 1 deletion src/db/internal/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ pub fn list_groups(
query = query.filter(views::groups_list::name.ilike(format!("%{}%", filter)))
};
query = match sort_by {
SortGroupsBy::MembersCount => query.order(views::groups_list::members_count.desc()),
SortGroupsBy::MemberCountAsc => query.order(views::groups_list::members_count.asc()),
SortGroupsBy::MemberCountDesc => query.order(views::groups_list::members_count.desc()),
SortGroupsBy::NameAsc => query.order(views::groups_list::name.asc()),
SortGroupsBy::NameDesc => query.order(views::groups_list::name.desc()),
};
Expand Down
15 changes: 8 additions & 7 deletions src/db/operations/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ use uuid::Uuid;

#[derive(Deserialize)]
pub enum SortGroupsBy {
MembersCount,
MemberCountAsc,
MemberCountDesc,
NameAsc,
NameDesc,
}

impl Default for SortGroupsBy {
fn default() -> Self {
Self::MemberCountDesc
}
}

#[derive(Deserialize)]
pub enum SortMembersBy {
None,
Expand Down Expand Up @@ -51,12 +58,6 @@ impl Default for MembersQueryOptions {
}
}

impl Default for SortGroupsBy {
fn default() -> Self {
Self::MembersCount
}
}

#[derive(Deserialize)]
pub struct GroupUpdate {
pub description: Option<String>,
Expand Down

0 comments on commit 65a107e

Please sign in to comment.