You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Containers: Add VS Code tasks and improve overall documentation & flexibility (#12)
* make START_DIR configurable
* fix permissions order
* fix start dir bug
* fix logic
* make START_DIR
* cool loggins
* reuse clone function
* i'm a bash noob
* even more of a bash noob
* add hashed info
* add ability to add tasks
* add vs code instructions for task
* rclone fix
* document vscode tasks
* fix labels
* mention additional variables
* add better docs for dev tools
* support rclone flags
Other code-server environment variables (such as `CODE_SERVER_CONFIG`) can also be used. See the [code-server FAQ](https://github.com/cdr/code-server/blob/main/docs/FAQ.md) for details.
26
+
24
27
## 💾 Persist your filesystem with `rclone`
25
28
26
29
This image has built-in support for [rclone](https://rclone.org/) so that your files don't get lost when code-server is re-deployed.
@@ -44,18 +47,24 @@ Now, you can add the following the environment variables in the code-server clou
| RCLONE_DATA | the encoded rclone config you copied in step 3 | n/a | ✅ |
50
+
| RCLONE_DATA | the encoded rclone config you copied in step 3 | n/a | ✅ |
48
51
| RCLONE_REMOTE_NAME | the name of the remote you added in step 2.<br />check with `$ rclone listremotes`| code-server-remote ||
49
52
| RCLONE_SOURCE | source directory to sync files in the code-server container | the project directory: `/home/coder/project`||
50
53
| RCLONE_DESTINATION | the path in the remote that rclone syncs to. change this if you have multiple code-server environments, or if you want to better organize your files. | code-server-files ||
51
-
54
+
| RCLONE_VSCODE_TASKS | import push and pull shortcuts into VS Code | true |
55
+
| RCLONE_AUTO_PUSH | automatically push files on startup if the rclone remote is empty (environment -> rclone remote) | true ||
56
+
| RCLONE_AUTO_PULL | automatically pull files on startup if the rclone remote is not empty (rclone -> environment remote) | true ||
57
+
| RCLONE_FLAGS | additional flags to attach to the push and pull script. type `rclone help flags for a list." |||
52
58
```sh
53
59
54
-
# How to use:
60
+
#--- How to use ---
55
61
62
+
# Terminal:
56
63
$ sh /home/coder/push_remote.sh # save your uncomitted files to the remote
57
-
58
64
$ sh /home/coder/pull_remote.sh # get latest files from the remote
# function to clone the git repo or add a user's first file if no repo was specified.
10
+
project_init () {
11
+
[ -z"${GIT_REPO}" ] &&echo"[$PREFIX] No GIT_REPO specified"&&echo"Example file. Have questions? Join us at https://community.coder.com">$START_DIR/coder.txt || git clone $GIT_REPO$START_DIR
12
+
}
4
13
5
14
# add rclone config and start rclone, if supplied
6
15
if [[ -z"${RCLONE_DATA}" ]];then
7
-
echo"RCLONE_DATA is not specified. Files will not persist"
16
+
echo"[$PREFIX] RCLONE_DATA is not specified. Files will not persist"
Copy file name to clipboardExpand all lines: guides/heroku.md
+2
Original file line number
Diff line number
Diff line change
@@ -50,3 +50,5 @@ Press the button in the top right of the repo, or or click to [use this template
50
50
1. Head back to Heroku and notice a new deployment has started. After it has completed, you can use these tools in your environment.
51
51
52
52
1. (Optional): [Configure rclone](https://github.com/cdr/deploy-code-server/tree/main/deploy-container#-persist-your-filesystem-with-rclone) so that you can save your VS Code config and files without commiting
53
+
54
+
See the [deploy-container README](../deploy-container) for other config vars for your environment.
Copy file name to clipboardExpand all lines: guides/railway.md
+2
Original file line number
Diff line number
Diff line change
@@ -42,3 +42,5 @@ You also need to specity a `PASSWORD` and a `GIT_REPO` to clone in your environm
42
42
1. Head back to Railway and notice a new deployment was created. After it has completed, you can use these tools in your environment.
43
43
44
44
1. (Optional): [Configure rclone](https://github.com/cdr/deploy-code-server/tree/main/deploy-container#-persist-your-filesystem-with-rclone) so that you can save your VS Code config and files without commiting
45
+
46
+
See the [deploy-container README](../deploy-container) for other config vars for your environment.
0 commit comments