Compare commits
	
		
			34 Commits
		
	
	
		
			ffcf6f372d
			...
			curl-test
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7f38e567d9 | |||
| 57958bd383 | |||
| 3abd4c1519 | |||
| 67ac0b03a5 | |||
| c3824dc377 | |||
| a6d44cf54a | |||
| b7f30d3436 | |||
| ccd503b0e7 | |||
| 4dd5054000 | |||
| 989a491429 | |||
| 1b8d1d0725 | |||
| 1d9e4c71d3 | |||
| 23f8755c95 | |||
| c24b9e4cdc | |||
| 2733d4f567 | |||
| 7cc5c91dce | |||
| a4cb903627 | |||
| 9849cb8b19 | |||
| 08f13cc088 | |||
| d1d51d2bef | |||
| 44589c69e2 | |||
| b046d9f250 | |||
| c730ee5717 | |||
| 68f41fb16e | |||
| b26c1729ec | |||
| 8090ba597b | |||
| 4f29c7a212 | |||
| 6f0d80576a | |||
| 42694115bd | |||
| a870a370c9 | |||
| ff2030cc49 | |||
| 737905e195 | |||
| 169fbf9bc6 | |||
| 445d041eae | 
							
								
								
									
										63
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										63
									
								
								.drone.yml
									
									
									
									
									
								
							| @@ -1,30 +1,73 @@ | |||||||
|  | --- | ||||||
| kind: pipeline | kind: pipeline | ||||||
| type: kubernetes | type: kubernetes | ||||||
| name: default | name: default | ||||||
|  |  | ||||||
| steps: | steps: | ||||||
|   - name: test |   - name: test | ||||||
|   image: golang |     image: golang:1.20.4 | ||||||
|     commands: |     commands: | ||||||
|  |       - pwd | ||||||
|       - go test -v |       - go test -v | ||||||
|       - go build |       - go build | ||||||
|  |       - echo "hello" > /shared/greetings.txt | ||||||
|  |       - hostname >> /shared/greetings.txt | ||||||
|  |     volumes: | ||||||
|  |       - name: shared | ||||||
|  |         path: /shared | ||||||
|     resources: |     resources: | ||||||
|       limits: |       limits: | ||||||
|       cpu: 1 |         cpu: 1000 | ||||||
|       memory: 100MiB |         memory: 300MiB | ||||||
|       requests: |       requests: | ||||||
|       cpu: 1 |         cpu: 500 | ||||||
|       memory: 50MiB |         memory: 200MiB | ||||||
|  |  | ||||||
|  |   - name: download | ||||||
|  |     image: fedora:38 | ||||||
|  |     commands: | ||||||
|  |       - ls; pwd | ||||||
|  |       - ./scripts/download-release test/187 dist/ | ||||||
|  |     resources: | ||||||
|  |       requests: | ||||||
|  |         cpu: 250 | ||||||
|  |         memory: 64MiB | ||||||
|  |       limits: | ||||||
|  |         cpu: 250 | ||||||
|  |         memory: 256MiB | ||||||
|  |  | ||||||
|  |   - name: read | ||||||
|  |     pull: if-not-exists | ||||||
|  |     image: alpine | ||||||
|  |     volumes: | ||||||
|  |       - name: shared | ||||||
|  |         path: /shared | ||||||
|  |     commands: | ||||||
|  |       - pwd | ||||||
|  |       - ls /shared | ||||||
|  |       - cat /shared/greetings.txt | ||||||
|  |  | ||||||
|   - name: docker |   - name: docker | ||||||
|   #image: plugins/docker |     image: harbor.ntppool.org/ntppool/drone-kaniko:main | ||||||
|   image: banzaicloud/drone-kaniko |     pull: always | ||||||
|     settings: |     settings: | ||||||
|     repo: drone-test/drone-test |       repo: ask/drone-test | ||||||
|       registry: harbor.ntppool.org |       registry: harbor.ntppool.org | ||||||
|     tags: latest,${DRONE_COMMIT_SHA} |       auto_tag: true | ||||||
|     #auto_tag: true |       tags: SHA7,${DRONE_SOURCE_BRANCH} | ||||||
|  |       cache: true | ||||||
|       username: |       username: | ||||||
|         from_secret: harbor_username |         from_secret: harbor_username | ||||||
|       password: |       password: | ||||||
|         from_secret: harbor_password |         from_secret: harbor_password | ||||||
|  |  | ||||||
|  | volumes: | ||||||
|  |   - name: shared | ||||||
|  |     claim: | ||||||
|  |       name: go-pkg | ||||||
|  |  | ||||||
|  | --- | ||||||
|  | kind: signature | ||||||
|  | hmac: 94513b436eb1b0ef9f1d1b0f128328f23bb343f1b9d9d6e7a0e80dacc22d3c48 | ||||||
|  |  | ||||||
|  | ... | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| FROM golang:1.14.3 as builder | FROM golang:1.16.4-alpine3.13 as builder | ||||||
| WORKDIR /go/src/gitea.develooper.com/ask/drone-test | WORKDIR /go/src/gitea.develooper.com/ask/drone-test | ||||||
| ADD . . | ADD . . | ||||||
| RUN CGO_ENABLED=0 GOOS=linux go build -o demo | RUN CGO_ENABLED=1 GOOS=linux go build -o demo | ||||||
|  |  | ||||||
| FROM alpine:3.11 as production | FROM alpine:3.13 as production | ||||||
| COPY --from=builder /go/src/gitea.develooper.com/ask/drone-test/demo . | COPY --from=builder /go/src/gitea.develooper.com/ask/drone-test/demo . | ||||||
| CMD ["./demo"] | CMD ["./demo"] | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								main_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								main_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | package main | ||||||
|  |  | ||||||
|  | import "testing" | ||||||
|  |  | ||||||
|  | func TestMain(t *testing.T) { | ||||||
|  |    t.Log("it's all okay") | ||||||
|  | } | ||||||
							
								
								
									
										30
									
								
								scripts/download-release
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										30
									
								
								scripts/download-release
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | #!/bin/bash | ||||||
|  |  | ||||||
|  | BUILD=$1 | ||||||
|  | DIR=$2 | ||||||
|  |  | ||||||
|  | set -euo pipefail | ||||||
|  |  | ||||||
|  | if [ -z "$DIR" ]; then | ||||||
|  |   echo run with $0 BUILD_NUMBER DIR | ||||||
|  |   exit 2 | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | mkdir -p $DIR | ||||||
|  |  | ||||||
|  | BASE=https://geodns.bitnames.com/monitor/builds/$BUILD | ||||||
|  |  | ||||||
|  | files=`curl -sSf $BASE/checksums.txt | awk '{print $2}'` | ||||||
|  | metafiles="checksums.txt metadata.json CHANGELOG.md artifacts.json" | ||||||
|  |  | ||||||
|  | for f in $metafiles; do | ||||||
|  |   url=$BASE/$f | ||||||
|  |   echo downloading $url | ||||||
|  |   curl --remove-on-error -sSfRo $DIR/$f $url || true | ||||||
|  | done | ||||||
|  |  | ||||||
|  | for f in $files; do | ||||||
|  |   url=$BASE/$f | ||||||
|  |   echo downloading $url | ||||||
|  |   curl --remove-on-error -sSfRo $DIR/$f $url | ||||||
|  | done | ||||||
		Reference in New Issue
	
	Block a user