Skip to content

Commit

Permalink
Feature/mig script create from template (#13)
Browse files Browse the repository at this point in the history
* chore: create image from template
* chore: bump all the cargo.toml  and package.json versions for the packages

---------

Authored-by: Amninder Kaur <[email protected]>
  • Loading branch information
akaur13 authored Feb 28, 2024
1 parent f6febd9 commit 03aaea2
Show file tree
Hide file tree
Showing 22 changed files with 278 additions and 151 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ linker = "aarch64-linux-gnu-gcc"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]


8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ MONITOR_POLLING_INTERVAL_IN_SECS=5
MONITOR_TASK_RETENTION_PERIOD_IN_SECS=864000

RUST_LOG=ERROR

# POSTGRES ENV FOR CREATE DB
PG_DATABASE_TEMPLATE=
PG_DATABASE_ADMIN=
SCYLLA_CREATE_DB=

# FOR DROPPING THE DB
#SCYLLA_CLEANUP_MODE=
7 changes: 3 additions & 4 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ jobs:
node-version: 18
check-latest: true
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.75.0
if: ${{ !matrix.settings.docker }}
with:
toolchain: stable
toolchain: 1.75.0
target: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v4
Expand Down Expand Up @@ -177,5 +177,4 @@ jobs:
- run: ls -R ./scylla_pg_js/artifacts

- name: Publish
run: PATH=$PATH:$(pwd) bin/npm-release.sh # only run on release created or tag

run: PATH=$PATH:$(pwd) bin/npm-release.sh # only run on release created or tag
2 changes: 1 addition & 1 deletion .github/workflows/rust_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
with:
toolchain: stable
toolchain: 1.75.0
- run: bin/ubuntu-setup.sh
- run: rustup component add rustfmt clippy
- name: cargo build
Expand Down
169 changes: 80 additions & 89 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ log = { version = "0.4", features = [
"std",
"kv_unstable_serde",
] }
env_logger = "0.10"
7 changes: 5 additions & 2 deletions Dockerfile.scylla_pg_migration
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN adduser \
WORKDIR /tmp
COPY ./ .
# Build binary in release mode
RUN cargo build --release --bin db_migrate
RUN cargo build --release --package scylla_pg_core

#
# Run image based on buster-slim to reduce image size while still using glibc
Expand All @@ -30,7 +30,10 @@ COPY --from=BUILD /etc/passwd /etc/passwd
COPY --from=BUILD /etc/group /etc/group
# Copy binary from build
COPY --from=BUILD /tmp/target/release/db_migrate ./
COPY --from=BUILD /tmp/target/release/db_create ./
COPY --from=BUILD /tmp/target/release/db_delete ./
COPY --from=BUILD /tmp/bin/create_db_and_migrate.sh ./
# Use an unprivileged user
USER ${USER}:${USER}
# Entry point
CMD ["/opt/build/db_migrate"]
CMD ["/opt/build/create_db_and_migrate.sh"]
Loading

0 comments on commit 03aaea2

Please sign in to comment.