Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 991a221b20 | |||
| 3be2bf2e0b | |||
| 1835fb7b2d | 
							
								
								
									
										58
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								.drone.yml
									
									
									
									
									
								
							| @@ -1,33 +1,35 @@ | |||||||
| --- |  | ||||||
| kind: pipeline | kind: pipeline | ||||||
| type: docker |  | ||||||
| name: default | name: default | ||||||
| trigger: |  | ||||||
|   branch: |  | ||||||
|     - master |  | ||||||
|  |  | ||||||
| steps: | steps: | ||||||
| - name: Budowanie dokcumentacji  | - name: terratest | ||||||
|   image: paramah/hugo-deploy |   image: plugins/docker | ||||||
|   commands: |   settings: | ||||||
|   - npm install -g postcss-cli  |     username: | ||||||
|   - npm install postcss autoprefixer |       from_secret: hub_username | ||||||
|   - git submodule update --init --recursive |     password: | ||||||
|   - hugo --destination /drone/src/build |       from_secret: hub_password | ||||||
|   - minify -r -o /drone/src/build /drone/src/build |     repo: | ||||||
|  |       from_secret: hub_repo | ||||||
|  |     tags: latest | ||||||
|  |   when: | ||||||
|  |     branch: | ||||||
|  |       - master | ||||||
|  |  | ||||||
| - name: Deploy dokumentacji | - name: notify | ||||||
|   image: paramah/hugo-deploy |   image: appleboy/drone-telegram | ||||||
|   commands: |   settings: | ||||||
|   - eval `ssh-agent -s` |     token: | ||||||
|   - echo "$SSH_KEY" | ssh-add - |       from_secret: telegram_bot_token | ||||||
|   - mkdir -p ~/.ssh |     to: | ||||||
|   - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config |       from_secret: telegram_group_id | ||||||
|   - rsync -rv -e "ssh -p 65522" /drone/src/build/ $SSH_URI:$DEST --checksum |     message: > | ||||||
|   environment: |       {{#success build.status}} | ||||||
|     SSH_KEY: |         build {{build.link}} triggerd by {{commit.link}} from {{commit.author}} succeeded | ||||||
|       from_secret: drone_ssh_key |       {{else}} | ||||||
|     SSH_URI: |         build {{build.link}} triggerd by {{commit.link}} from {{commit.author}} failed | ||||||
|       from_secret: ssh_uri |       {{/success}} | ||||||
|     DEST: |   when: | ||||||
|       from_secret: destination |     status: | ||||||
|  |       - success | ||||||
|  |       - failure | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +0,0 @@ | |||||||
| /public/ |  | ||||||
| /resources/_gen/ |  | ||||||
| hugo_stats.json |  | ||||||
| public/ |  | ||||||
| resources/ |  | ||||||
| node_modules/ |  | ||||||
| @@ -1,34 +0,0 @@ | |||||||
| # Docsy hugo deploy |  | ||||||
|  |  | ||||||
| Skrypt umożliwia szybki automatyczny deploy dokumentacji opartej o [docsy](https://www.docsy.dev/docs/). |  | ||||||
|  |  | ||||||
| # Zawiera |  | ||||||
|  |  | ||||||
| `.gitignore` dla hugo  |  | ||||||
| `init.sh` skrypt inicjujący repozytorium dla docsy (subrepo dla tematu) |  | ||||||
| `.drone.yml` skrypt do automatycznego deploymentu |  | ||||||
|  |  | ||||||
| # Wymagania |  | ||||||
|  |  | ||||||
| - [drone.io cli](https://docs.drone.io/cli/install/) |  | ||||||
| - [hugo](https://gohugo.io/getting-started/installing/) |  | ||||||
|  |  | ||||||
| # Użycie |  | ||||||
|  |  | ||||||
| Musimy aktywować repozytorium na naszym drone.io |  | ||||||
|  |  | ||||||
| ``` |  | ||||||
| cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --name="$1 "  --data="$2)}' |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| Wymagane zmienne: |  | ||||||
|  |  | ||||||
| ``` |  | ||||||
| domain= |  | ||||||
| site_path= |  | ||||||
| ssh_host= |  | ||||||
| ssh_username= |  | ||||||
| ssh_password= |  | ||||||
| ssh_port= |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
							
								
								
									
										19
									
								
								TERRATEST_DEPLOY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								TERRATEST_DEPLOY.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | # Drone docker deploy | ||||||
|  |  | ||||||
|  | ## Użycie | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | cat ${args[0]} |awk -F\= '{system("drone secret add --repository='${args[1]}' --name="$1 "  --data="$2)}' | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | Wymagane zmienne: | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | hub_username= | ||||||
|  | hub_password= | ||||||
|  | hub_repo= | ||||||
|  | telegram_bot_token= | ||||||
|  | telegram_group_id= | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -1,34 +0,0 @@ | |||||||
| #!/bin/bash |  | ||||||
|  |  | ||||||
| # |  | ||||||
| # Helper functions |  | ||||||
| # |  | ||||||
| declare -i term_width=120 |  | ||||||
|  |  | ||||||
| h1() { |  | ||||||
|     declare border padding text |  | ||||||
|     border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m' |  | ||||||
|     padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))" |  | ||||||
|     text="\\e[1m$*\\e[0m" |  | ||||||
|     echo -e "$border" |  | ||||||
|     echo -e "${padding}${text}${padding}" |  | ||||||
|     echo -e "$border" |  | ||||||
| } |  | ||||||
|  |  | ||||||
| h2() { |  | ||||||
|     printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*" |  | ||||||
| } |  | ||||||
|  |  | ||||||
| h1 "Inicjalizacja struktury hugo" |  | ||||||
| hugo new site --force ./ |  | ||||||
| h1 "Inicjalizacja repozytorium git" |  | ||||||
| git init |  | ||||||
| h2 "Inicjalizacja submodułu z docsy" |  | ||||||
| git submodule add https://github.com/google/docsy.git themes/docsy |  | ||||||
| echo 'theme = "docsy"' >> config.toml |  | ||||||
| git submodule update --init --recursive |  | ||||||
| h1 "Obsłga mermaid" |  | ||||||
| mv tmp_layouts layouts |  | ||||||
| h1 "Czyszczenie repozytorium" |  | ||||||
| rm init_docsy.sh |  | ||||||
|  |  | ||||||
| @@ -1,9 +0,0 @@ | |||||||
| <!-- MermaidJS support --> |  | ||||||
| <script async src="https://unpkg.com/mermaid@8.7.0/dist/mermaid.min.js"></script> |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <div class="mermaid"> |  | ||||||
|   {{.Inner}} |  | ||||||
| </div> |  | ||||||
|  |  | ||||||
|  |  | ||||||
		Reference in New Issue
	
	Block a user