mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
Fix permission issue catched by GAS Scanner
Support UI UT add output ad npm install add npm install
This commit is contained in:
parent
a4a5ff6c60
commit
1d0721fdfc
@ -79,6 +79,8 @@ script:
|
||||
- sudo mkdir -p /harbor
|
||||
- sudo mv ./VERSION /harbor/VERSION
|
||||
- sudo service mysql stop
|
||||
- sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.1.1
|
||||
- cat ./src/ui_ng/lib/npm-ut-test-results
|
||||
- sudo ./tests/testprepare.sh
|
||||
- sudo docker-compose -f ./make/docker-compose.test.yml up -d
|
||||
- go list ./... | grep -v -E 'vendor|tests' | xargs -L1 fgt golint
|
||||
|
4
Makefile
4
Makefile
@ -385,6 +385,10 @@ refresh_clarity_builder:
|
||||
$(DOCKERRMIMAGE) $(REGISTRYSERVER)$(DOCKERIMAGENAME_ADMINSERVER):$(NEWCLARITYVERSION); \
|
||||
fi
|
||||
|
||||
run_clarity_ut:
|
||||
@echo "run clarity ut ..."
|
||||
@$(DOCKERCMD) run --rm -v $(UINGPATH)/lib:$(CLARITYSEEDPATH)/lib -v $(BUILDPATH)/tests:$(CLARITYSEEDPATH)/tests $(CLARITYIMAGE) $(SHELL) $(CLARITYSEEDPATH)/tests/run-clarity-ut.sh
|
||||
|
||||
pushimage:
|
||||
@echo "pushing harbor images ..."
|
||||
@$(DOCKERTAG) $(DOCKERIMAGENAME_ADMINSERVER):$(VERSIONTAG) $(REGISTRYSERVER)$(DOCKERIMAGENAME_ADMINSERVER):$(VERSIONTAG)
|
||||
|
@ -38,7 +38,7 @@ func NewLogger(jobID int64) (*log.Logger, error) {
|
||||
log.Errorf("Failed to create directory for log file %s, the error: %v", logFile, err)
|
||||
}
|
||||
}
|
||||
f, err := os.OpenFile(logFile, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0660)
|
||||
f, err := os.OpenFile(logFile, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
log.Errorf("Failed to open log file %s, the log of job %d will be printed to standard output, the error: %v", logFile, jobID, err)
|
||||
f = os.Stdout
|
||||
|
10
tests/run-clarity-ut.sh
Normal file
10
tests/run-clarity-ut.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cp -r /harbor_ui/lib/* /harbor_ui
|
||||
|
||||
npm install
|
||||
npm run test > lib/npm-ut-test-results
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user