Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rust-101
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tom.andrivet
rust-101
Commits
906c9cd0
Commit
906c9cd0
authored
1 year ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Add CI/CD for deployment of the book."
parent
0bc478f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+32
-2
32 additions, 2 deletions
.gitlab-ci.yml
book/src/SUMMARY.md
+2
-2
2 additions, 2 deletions
book/src/SUMMARY.md
with
34 additions
and
4 deletions
.gitlab-ci.yml
+
32
−
2
View file @
906c9cd0
...
@@ -5,10 +5,34 @@ image: "rust:1.70-alpine3.17"
...
@@ -5,10 +5,34 @@ image: "rust:1.70-alpine3.17"
before_script
:
before_script
:
-
apk add --no-cache musl-dev curl
-
apk add --no-cache musl-dev curl
-
mkdir -p $HOME/.cargo/bin
-
mkdir -p $HOME/.cargo/bin
-
which rustc
-
which cargo
-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.31/mdbook-v0.4.31-x86_64-unknown-linux-musl.tar.gz | tar -xz --directory=$HOME/.cargo/bin
-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.31/mdbook-v0.4.31-x86_64-unknown-linux-musl.tar.gz | tar -xz --directory=$HOME/.cargo/bin
-
export PATH=$PATH:$HOME/.cargo/bin
-
export PATH=$PATH:$HOME/.cargo/bin
##
## Install ssh-agent if not already installed, it is required by Docker.
##
-
'
which
ssh-agent
||
(apk
add
--update
openssh-client)'
-
'
which
rsync
||
(apk
add
--update
rsync)'
-
'
which
chmod
||
(apk
add
--update
chmod)'
##
## Run ssh-agent (inside the build environment)
##
-
eval $(ssh-agent -s)
##
## Give the right permissions, otherwise ssh-add will refuse to add files
## Add the SSH key stored in SSH_PRIVATE_KEY file type CI/CD variable to the agent store
##
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
##
## Create the SSH directory and give it the right permissions
##
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
##
## Assuming you created the SSH_KNOWN_HOSTS file type CI/CD variable, uncomment the
## following two lines.
##
-
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
-
chmod 644 ~/.ssh/known_hosts
test:cargo
:
test:cargo
:
script
:
script
:
...
@@ -21,3 +45,9 @@ run_test_doc:
...
@@ -21,3 +45,9 @@ run_test_doc:
-
cd ../book
-
cd ../book
-
mdbook test
-
mdbook test
-
mdbook build
-
mdbook build
run_deploy_book
:
script
:
-
cd book
-
mdbook build
-
rsync -avz book/* ur1bg_malas@ur1bg.ftp.infomaniak.com:web/malaspinas/rust-101/
This diff is collapsed.
Click to expand it.
book/src/SUMMARY.md
+
2
−
2
View file @
906c9cd0
# S
o
mma
ire
# S
u
mma
ry
-
[
Part 00
](
./part00.md
)
-
[
Part 00
](
./part00.md
)
-
[
Part 01
](
./part01.md
)
-
[
Part 01
](
./part01.md
)
...
@@ -22,4 +22,4 @@ $ mdbook build
...
@@ -22,4 +22,4 @@ $ mdbook build
et vous retrouverez l'index dans le fichier
et vous retrouverez l'index dans le fichier
```
bash
```
bash
$
book/index.html
$
book/index.html
```
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment